Repository navigation
ci(api-spec): handle endpoints that leave the spec, alert when the sync fails - #893
Merged
Merged
Conversation
…nc fails
The nightly spec sync only handled added endpoints. When the API dropped
GET /v2/usage/terms/{id}/projections, its menu entry stopped the job before
it opened a PR, from Nov 25 until it was removed by hand (#891). The
heartbeat ping ran on failure too, so Checkly never alerted.
- Add prune-removed-endpoints.mjs, which runs before the endpoint check.
It removes menu entries and MDX stubs for endpoints that are no longer
in the spec, redirects their old URLs to the next page of the same
group, and lists them in the PR description.
- Keep auto-merge off for a sync PR that removed endpoints, so a person
checks the redirects.
- Ping the heartbeat only when the job succeeds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
This branch was successfully 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.
What was wrong
The nightly job that copies the latest API spec into the docs failed every run from Nov 25 until #891, and nobody was alerted. There were two problems:
GET /v2/usage/terms/{id}/projections, the docs menu (docs.json) still listed it. The job's endpoint check stopped on that entry before it could open a PR. fix(api): drop the removed term projections endpoint from the menu #891 removed the entry by hand. Without a job change, the next removed endpoint breaks it again.if: always(), so it reported success even when the job failed.What changed
New step: remove pages of endpoints that left the spec (
.github/scripts/prune-removed-endpoints.mjs). It runs before the endpoint check. For each menu entry whose endpoint is no longer in the spec, it:docs.json, and deletes the page file if the page was an.mdxfile,Schema-generated pages get their URL from the spec, so the old URL is read from the previous spec in git.
No auto-merge when endpoints were removed. Additions still merge on their own. If a run removes something, auto-merge stays off, so a person checks the redirect targets and any pages that still link to the old URL.
Heartbeat only on success. A failed run now shows up in Checkly as a missed heartbeat.
Verified
docs.jsonchange as fix(api): drop the removed term projections endpoint from the menu #891. Every later step of the job passed.api-navigation.test.mjscover a removed generated page, a removed.mdxpage, redirects being updated, a group that ends up empty, and a run with nothing to remove.npm run test:api-docspasses (8 tests).actionlint(with shellcheck) passes on the workflow.What the reader has to do
Check the settings of the Checkly heartbeat check that this job pings. The job runs on weekdays only, so the heartbeat's period and grace time must cover the weekend, or it will alert every Monday.
🤖 Generated with Claude Code