fix(sidebar): match category label by tag prefix#557
Merged
Conversation
The auto-fixer's findCategoryItemsByLabel looked for an exact equality
between the OpenAPI tag and the sidebar category's label. That works
for most cases but breaks when a category adds a clarifying
parenthetical to its label — e.g. label "Custom Metadata (Any
Datasource)" for spec tag "Custom Metadata", which the docs author
chose so the indexing sidebar makes the cross-datasource scope
obvious at a glance.
Allow the match to fall back to `${tag} (` prefix matching so a
category can extend its label with a parenthetical qualifier without
breaking auto-insertion. Restrictive enough to avoid accidental
matches (the open-paren is required), permissive enough to handle
the existing convention.
Without this, the regenerate workflow's sidebar:fix silently warns
about unfixable entries and produces a sidebars.ts that's missing
the relevant operations, which then fails the docusaurus build.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… entries
Two changes that ship together to break the current CI deadlock:
1. Auto-fixer enhancement (the systemic fix). findCategoryItemsByLabel
did exact-equality matching between OpenAPI tag and sidebar label.
That breaks when a category adds a clarifying parenthetical — e.g.
spec tag "Custom Metadata" vs label "Custom Metadata (Any
Datasource)". Allow a fall-through `${tag} (` prefix match so a
category can keep its scope qualifier without breaking
auto-insertion.
2. Sidebar entries for the 5 new /custom-metadata operations the
upstream spec added. Without #1, sidebar:fix silently warned about
them and produced a sidebars.ts that was missing the entries; that
broke `sidebar:check` on every open PR rebased to current main and
prevented the regenerate workflow from producing a clean PR. Adding
the entries here unblocks the chain so the regenerate workflow can
take over going forward.
The 5 entries are exactly what the fixer produces from the live spec
under the existing "Custom Metadata (Any Datasource)" category.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
🤖 Generated with Claude Code