Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
cicdCI/CD: workflows, actions, lockfiles, pins, runners, release gatesenhancementNew capability or improvement to existing behaviourpriority:p2Normal - queue itscope:repoConfined to this repositorystatus:readyFully specified and ready to be picked up
Description
Detector spec (from hypatia#333 Pattern 4)
Pattern 4 — Workflow triggers reference branches that don't exist in the repo
Severity: low (dead config, but signals maintenance drift)
Detection (Hypatia.Rules.StructuralDrift):
- For each workflow file, collect
on.push.branches,on.pull_request.branches,on.push.branches-ignore, etc. - Resolve them against the repo's actual branch list (via the git index or GitHub API).
- Flag any branch name that:
- Doesn't exist as a ref, AND
- Isn't a glob pattern, AND
- Isn't the default branch name (some teams keep
master/mainfor migration symmetry — exempt those).
Worked examples (this session):
affinescript/.github/workflows/{semgrep,spark-theatre-gate}.yml—branches: [main, master]while the repo usesmainexclusively. Fix: affinescript#379 droppedmaster.hypatia/.github/workflows/{tests,verify-proofs}.yml—developandmasterwere dead. Fix: hypatia#331 dropped them.
Remediation guidance to emit:
Drop branch refs in workflow triggers that don't resolve to actual branches in this repo. Confirms intent and avoids ambiguity.
Implementation pointers
- Detection algorithm: Collect
on.push.branches,on.pull_request.branches,on.push.branches-ignoreper workflow; resolve against actual repo branches; flag names that aren't refs, aren't globs, and aren't the default branch. - Real-world example:
affinescript/.github/workflows/{semgrep,spark-theatre-gate}.ymllistedmasterwhile repo usesmainonly;hypatia/.github/workflows/{tests,verify-proofs}.ymllisted deaddevelopandmaster. - Landed fix (reference): affinescript#379 (dropped
masterin affinescript); hypatia#331 (droppeddevelop/masterin hypatia). - Rule statement: Drop branch refs in workflow triggers that don't resolve to actual branches in this repo. Confirms intent and avoids ambiguity.
Acceptance
- Rule encoded in hypatia (file path follows existing rule naming convention —
lib/rules/<name>.exif Elixir, or matching the repo's rule DSL) - Test fixture exercising the positive case + at least one negative case
- Smoke test passes against the cited landed-fix repo
Source cohort: hypatia#333.
Metadata
Metadata
Assignees
Labels
cicdCI/CD: workflows, actions, lockfiles, pins, runners, release gatesenhancementNew capability or improvement to existing behaviourpriority:p2Normal - queue itscope:repoConfined to this repositorystatus:readyFully specified and ready to be picked up
Activity
hyperpolymath commentedon May 30, 2026
cicd triage 2026-05-30 — scoped plan + park
PR #403 ships the first batch of 4 rules from this cohort (#336, #337, #338, #390). This issue is in the next batch; landing it requires more substantial work than the first four:
Detection needs gh API call to list branches OR git index read for actual refs. Compare against
on.push.branches+on.pull_request.branchesper workflow. Add to lib/rules/structural_drift.ex as SD015.The issue body is the implementation spec (detection algorithm + worked example + remediation guidance — well-formed). Next-batch PR will pick this up. Leaving open with
cicdlabel.feat(rules): Group-B #333-cohort detectors — SD021/WF023/stale-issue-…
hyperpolymath commentedon May 31, 2026
Detector landed in PR #411 (merged,
d460d6c):Hypatia.Rules.StructuralDrift.check_workflow_branch_refs/3(SD021) — flagson.push/on.pull_request.branchesrefs (inline[a, b]and block- aforms) that aren't in the repo's live branch list; glob patterns and the default branch are exempt.test/rules/group_b_detectors_test.exsRemaining (keeping this open): the detector takes
actual_branchesas a parameter today; wiring the live branch-list signal (git index / GitHub API) into the scan flow + the smoke test against the affinescript/hypatia fixes are the follow-up.Generated by Claude Code
hyperpolymath commentedon May 31, 2026
Forward-pointer (2026-05-31): hypatia#409 (proposed WF021-WF025) was closed as partially superseded — main's recent WF021-WF023 work consumed the WF021/WF024 slots. The 3 detector ideas in this cohort (#361/#363/#366) remain owed and should be implemented by a successor PR using WF024+ numbering (main's highest is WF023).
hyperpolymath commentedon Sep 30, 2026
Consolidated into the roadmap tracker #886 during the 2026-09-30 issue sweep. The idea is kept there as a checklist item; reopen this issue when work starts.