Skip to content

feat(ci): fail the build on a sidebar link to a deleted /api page - #12398

Open
sileht wants to merge 1 commit into
devs/sileht/api-eventlogs-404/make-link-check-actually-check-links--8f9a56dcfrom
devs/sileht/api-eventlogs-404/fail-build-sidebar-link-deleted-api-page--c67fc8c9
Open

feat(ci): fail the build on a sidebar link to a deleted /api page#12398
sileht wants to merge 1 commit into
devs/sileht/api-eventlogs-404/make-link-check-actually-check-links--8f9a56dcfrom
devs/sileht/api-eventlogs-404/fail-build-sidebar-link-deleted-api-page--c67fc8c9

Conversation

@sileht

@sileht sileht commented Aug 15, 2026

Copy link
Copy Markdown
Member

The repaired link check catches this bug class, but only on a pull request,
and a pull request is not how it arrives. /api/* routes are generated from
the OpenAPI spec's tags, and that spec lands by bot sync pushed straight to
main — no pull request, so no CI. A tag rename would deploy the 404 and stay
broken until some unrelated pull request tripped over it days later, failing
on a link its author never touched.

Add the gate where a schema sync actually passes: the build. This mirrors
validate-data-type-anchors, which exists for the same reason against the same
sync, and pairs it with a unit test so docs-side edits still get the faster
signal in pull request CI.

The check is fed the same preprocessed schema and the same groupByTag /
slugifyTag that src/pages/api/[tag].astro uses to emit the routes, so it
cannot disagree with what the build produces, and it reads
src/content/docs/api/ through the same recursive, partial-excluding glob the
docs collection uses, so adding a hand-written page needs no change here.

A nav path is resolved without its anchor or query: navItems already ships
anchored entries elsewhere, and the /api pages are the ones with a heading
per endpoint, so reading an anchor as part of the slug would fail the deploy
on a link that resolves.

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com

Depends-On: #12397

The repaired link check catches this bug class, but only on a pull request,
and a pull request is not how it arrives. `/api/*` routes are generated from
the OpenAPI spec's tags, and that spec lands by bot sync pushed straight to
main — no pull request, so no CI. A tag rename would deploy the 404 and stay
broken until some unrelated pull request tripped over it days later, failing
on a link its author never touched.

Add the gate where a schema sync actually passes: the build. This mirrors
validate-data-type-anchors, which exists for the same reason against the same
sync, and pairs it with a unit test so docs-side edits still get the faster
signal in pull request CI.

The check is fed the same preprocessed schema and the same `groupByTag` /
`slugifyTag` that `src/pages/api/[tag].astro` uses to emit the routes, so it
cannot disagree with what the build produces, and it reads
`src/content/docs/api/` through the same recursive, partial-excluding glob the
docs collection uses, so adding a hand-written page needs no change here.

A nav path is resolved without its anchor or query: navItems already ships
anchored entries elsewhere, and the `/api` pages are the ones with a heading
per endpoint, so reading an anchor as part of the slug would fail the deploy
on a link that resolves.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Change-Id: Ic67fc8c90348b1693fa3c5254157de8a000085f4
@mergify
mergify Bot had a problem deploying to Mergify Merge Protections August 15, 2026 20:18 Failure
@sileht

sileht commented Aug 15, 2026

Copy link
Copy Markdown
Member Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 fix(api): point the Activity Log sidebar entry at its real page #12396
2 fix(ci): make the link check actually check links #12397
3 feat(ci): fail the build on a sidebar link to a deleted /api page #12398 👈

@mergify

mergify Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 3 of 7 protections blocking · waiting on 👀 reviews and ⛓️ dependency

Protection Waiting on
🔴 ⛓️ Depends-On Requirements ⛓️ dependency
🔴 👀 Review Requirements 👀 reviews
🔴 🔎 Reviews 👀 reviews
🟢 🤖 Continuous Integration
🟢 Enforce conventional commit
🟢 📕 PR description
🟢 🚦 Auto-queue

🔴 ⛓️ Depends-On Requirements

Waiting for

This rule is failing.

Requirement based on the presence of Depends-On in the body of the pull request

🔴 👀 Review Requirements

Waiting for

  • #approved-reviews-by >= 2
This rule is failing.
  • any of:
    • #approved-reviews-by >= 2
    • author = dependabot[bot]
    • all of:
      • author = mergify-ci-bot
      • -head ~= ^docs-agent/

🔴 🔎 Reviews

Waiting for

  • #review-requested = 0
This rule is failing.
  • #review-requested = 0
  • #changes-requested-reviews-by = 0
  • #review-threads-unresolved = 0

Show 4 satisfied protections

🟢 🤖 Continuous Integration

  • all of:
    • check-success = build
    • check-success = lint
    • check-success = test
    • any of:
      • check-success = test-broken-links
      • label = ignore-broken-links
    • any of:
      • check-success=Cloudflare Pages
      • -head-repo-full-name~=^Mergifyio/

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|internal|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?!?:

🟢 📕 PR description

  • body ~= (?ms:.{48,})

🟢 🚦 Auto-queue

When all merge protections are satisfied, this pull request will be queued automatically.

@mergify
mergify Bot requested a review from a team August 15, 2026 20:21
@sileht
sileht marked this pull request as ready for review August 15, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant