feat: lint:spec command + changelog generation (Phase 3 hub side)#5
Merged
Conversation
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.
The hub-side half of the gates/changelog work: it owns the lint command and generates the changelog.
lint:specis now the single-source lint command"lint:spec": "spectral lint --ruleset .spectral.yaml --fail-severity error", called asnpm run lint:spec -- <file>. The ruleset, the Spectral engine/version, and the severity all live here, so the producer's pre-merge gate (next) just runs this command rather than pinning its own Spectral. Errors fail; warnings don't.Changelog on publish
publish.tsdiffs the previous published spec against the incoming one (oasdiff changelog ... -f markdown) and prepends a## <tag> (<date>)entry toCHANGELOG.md, also folding the diff into the release notes. Best-effort: ifoasdiffis absent or errors, it falls back to a neutral note rather than failing the publish.CHANGELOG.mdis reset to a clean header so entries prepend cleanly (newest on top).Verification
npm run typecheckclean,npm test11/11,npm run lint:spec -- spec/openapi.jsonruns (no crash).oasdiffdiff populates once it's installed in the producer's publish job (the remaining producer-side bit); until then entries read "No API-surface changes detected." / "Initial published spec."