Skip to content

hypatia: detect stale continue-on-error masks tied to closed issues (from #333 cohort, pattern 5) #364

@hyperpolymath

Description

@hyperpolymath

Detector spec (from hypatia#333 Pattern 5)

Pattern 5 — continue-on-error: true on a job, paired with documentation that says "remove this when X lands"

Severity: medium (gate-quality erosion; the workflow drifts further from green main-line)

Detection (Hypatia.Rules.WorkflowAudit):

  • For each job with continue-on-error: true:
    • Scan the job's leading comments for phrases like until #N lands, until #N closes, remove when #N.
    • If a referenced issue is now closed or merged (via GitHub API), flag as "stale continue-on-error mask".
  • Bonus: detect continue-on-error on a job whose name matches an entry in branch-protection's required_status_checks.contexts (structural contradiction).

Worked example (this session):

Remediation guidance to emit:

If the gating issue has closed, drop continue-on-error: true and let the job report accurately. If the issue is still open but the workflow logic has changed (e.g. root cause fixed differently), also drop and update the comment.

Implementation pointers

  • Detection algorithm: For each continue-on-error: true job, scan leading comments for until #N lands/until #N closes/remove when #N; resolve #N via GitHub API; flag if closed/merged. Bonus: contradiction check against branch-protection required contexts.
  • Real-world example: affinescript/.github/workflows/ci.yml vscode-smoke had continue-on-error: true with comment "Remove the continue-on-error: true line when chore(deps): bump bb8 from 0.8.6 to 0.9.1 #104 publishes the adapter to npm."
  • Landed fix (reference): affinescript#380 (root cause fixed; mask removed even though chore(deps): bump bb8 from 0.8.6 to 0.9.1 #104 still open).
  • Rule statement: If the gating issue has closed, drop continue-on-error: true and let the job report accurately. If the issue is still open but the workflow logic has changed (e.g. root cause fixed differently), also drop and update the comment.

Acceptance

  • Rule encoded in hypatia (file path follows existing rule naming convention — lib/rules/<name>.ex if 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

No one assigned

    Labels

    cicdCI/CD pipeline, GitHub Actions, workflows, rulesets, releasesenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions