ci: fail the build when the generated OpenAPI spec or web client is stale - #2178
Open
andyst-dev wants to merge 1 commit into
Open
andyst-dev wants to merge 1 commit into
andyst-dev wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Follow-up to #2115.
The generated OpenAPI spec and the web client had drifted from the routes. Regenerating both on
maintoday is clean andpnpm --filter @tunarr/web typecheckpasses, so the drift itself is already resolved (the client was regenerated in 464c296, and c97d767 fixed the spec emission that made the client generate incorrectly). What is still missing is the enforcement suggested in the issue, so the same drift cannot land again unnoticed.This adds one step to the existing
buildjob:@tunarr/typesand@tunarr/shared,generate-openapiagainst a throwaway database directory viaTUNARR_DATABASE_PATH, so it does not read or pollute any existing Tunarr data,generate-client,web/src/generatedordocs/generatedchanged.Verified locally on
main(754786b): the step exits 0 on a clean tree after regenerating both artifacts, and exits 1 with the type diff when I add a field to a route schema and regenerate. I could not run the job on GitHub Actions itself; the runner needs only Node 22 and pnpm, which the job already sets up.If you would rather fix drift at the source than gate it in CI, feel free to close this and the issue - the current tree is already consistent.
Refs #2115