feat(oas:sync): support x-internal, apply-tag-changes and apply-endpoint-order - #52
Merged
Merged
Conversation
…int-order
Mirrors how the platform (gitto's APIDefinition handler) applies these
extensions when an API definition is resynced:
- x-internal: operation-level value wins over root. When present it sets
`hidden` on new and existing pages in both directions; when absent,
existing pages keep their own `hidden`. A tag page is hidden once every
operation in it is internal, and is never unhidden by sync.
- apply-tag-changes (root, strict `true`): existing operation pages inside
the API's category move to their current tag's folder (hand-moved pages
in another category are left alone), tag page title/excerpt follow the
spec, and emptied tag folders are deleted when generated or flattened to
`<tag>.md` when hand-edited.
- apply-endpoint-order (root, strict `true`): each folder's `_order.yaml`
is reordered to spec order, refilling only the slots this API's pages
already hold (gitto's applyOASOrder). Files never move.
oas:sync is no longer create-only; moves and frontmatter/order updates are
reported as "Moved" / "Updated".
Also adds an oas-reference lint warning for `x-readme: { internal }`, which
the `oas` package documents but the platform's page sync ignores.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves the conflict with #49 (GitHub Action) in oas:sync's run(): keeps main's printSyncResults()/writeGithubActionsOutputs() structure and fail-on-skip behavior, adding the moved/updated totals to its summary. Adds moved-count and updated-count Action outputs, and rebuilds dist-gha. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
… --fix and reporting - Recognize a generated tag page by its shape alone rather than comparing its excerpt to the current spec's tags; once a tag leaves the spec there is nothing to compare against, and the page was being flattened into a stale <tag>.md instead of deleted. - Only run the sync from lint --fix when at least one finding is fixable. - Collapse duplicate _order.yaml entries before refilling slots so apply-endpoint-order never writes "- undefined". - Report a file in "updated" once even when two passes touch it. - Rebuild dist-gha.
…spec still supplies that text An excerpt-only edit to a tag page was being deleted along with its emptied folder. Nothing records what a page was generated from, so the excerpt is now accepted as generated only when the current spec supplies that exact text under some tag's description — which covers the common retag, a rename that keeps its description. Anything else is treated as a possible edit and the page is flattened, never deleted.
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.
Mirrors how the platform (gitto's APIDefinition handler) applies these extensions when an API definition is resynced:
hiddenon new and existing pages in both directions; when absent, existing pages keep their ownhidden. A tag page is hidden once every operation in it is internal, and is never unhidden by sync.true): existing operation pages inside the API's category move to their current tag's folder (hand-moved pages in another category are left alone), tag page title/excerpt follow the spec, and emptied tag folders are deleted when generated or flattened to<tag>.mdwhen hand-edited.true): each folder's_order.yamlis reordered to spec order, refilling only the slots this API's pages already hold (gitto's applyOASOrder). Files never move.oas:sync is no longer create-only; moves and frontmatter/order updates are reported as "Moved" / "Updated".
Also adds an oas-reference lint warning for
x-readme: { internal }, which theoaspackage documents but the platform's page sync ignores.🧰 Changes
Describe in detail what this PR is for.
🧬 QA & Testing
Provide as much information as you can on how to test what you've done.