Skip to content

test: fail CI when the fix-guide slug list drifts - #3

Merged
PabloCodes7 merged 1 commit into
mainfrom
guard/fix-guide-slugs
Jul 14, 2026
Merged

test: fail CI when the fix-guide slug list drifts#3
PabloCodes7 merged 1 commit into
mainfrom
guard/fix-guide-slugs

Conversation

@PabloCodes7

Copy link
Copy Markdown
Contributor

FIX_GUIDE_SLUGS in scripts/annotate.py decides whether a failure class links to its /fix/<slug> guide or to the generic index. It is hand-maintained, and its comment claimed to mirror patchrail.cli._FIX_GUIDE_SLUGS — a symbol the CLI has since removed, so nothing actually tied the list to reality.

It can rot in two directions:

  • a slug that is not a real failure class — a dead entry, and a renamed class silently loses its guide link;
  • a slug with no published guide — the action hands users a 404.

This derives both sources of truth (patchrail ci classes and the guide index on getpatchrail.com) and fails on either divergence. Mutation-checked: adding a bogus slug, or dropping one that is published, both turn the suite red.

Current state is clean — the 31 slugs match the 31 published guides exactly, and the 9 newer classes (xcode, docs-build, shell-lint, elixir, db-migration, k8s, helm, node-script-missing, pre-commit) correctly fall back to the index rather than 404.

Notes: the network check skips rather than fails if the site is unreachable, so an outage can't red the repo. It also runs weekly, since publishing or removing a guide drifts the list with no commit here to trigger CI.

FIX_GUIDE_SLUGS is hand-maintained, and its comment still claimed to mirror
patchrail.cli._FIX_GUIDE_SLUGS -- a symbol the CLI removed, so nothing had
tied the list to reality for a while. It can rot two ways: a slug that is not
a real failure class (dead entry, or a rename that silently drops the guide
link), or a slug with no published guide (the action hands users a 404).

Derive both sources of truth -- 'patchrail ci classes' and the guide index on
getpatchrail.com -- and fail on either divergence. The network check skips
cleanly if the site is unreachable, so an outage cannot red the repo. Also run
weekly: publishing or removing a guide drifts the list with no commit here.

Today the 31 slugs match the 31 published guides exactly; the 9 newer classes
correctly fall back to the index.
@PabloCodes7
PabloCodes7 merged commit a3dc802 into main Jul 14, 2026
2 checks passed
@PabloCodes7
PabloCodes7 deleted the guard/fix-guide-slugs branch July 14, 2026 05:09
PabloCodes7 added a commit that referenced this pull request Jul 14, 2026
Everyone pins patchrail/ci-triage-action@v1, but CI only ever tested the
commit. The tag had fallen two commits behind main, so the guide-slug guard
added in #3 was validating code that no user actually runs.

Move v1 to each main commit that passes both jobs, and document in the README
that v1 floats within the v1 line (with SHA pinning as the alternative).

Co-authored-by: PabloCodes7 <pablocodes7@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant