Skip to content

hypatia: detect stale issue references in workflow/source comments (from #333 cohort, pattern 7) #366

@hyperpolymath

Description

@hyperpolymath

Detector spec (from hypatia#333 Pattern 7)

Pattern 7 — Stale issue references in workflow / source comments

Severity: low (documentation rot)

Detection (Hypatia.Rules.HonestCompletion):

  • Scan workflow comments + source comments for #N issue/PR references with phrasing patterns like:
    • until #N, pending #N, gated on #N, awaits #N, blocked by #N, remove when #N
  • For each, query the GitHub API: is #N closed/merged?
  • If yes, flag the comment as stale.

Worked example (this session):

Remediation guidance to emit:

The referenced issue (#N) is closed/merged. Update or delete this comment so the next reader doesn't waste time looking it up.

Implementation pointers

  • Detection algorithm: Scan workflow + source comments for #N refs with phrasing like until #N/pending #N/gated on #N/awaits #N/blocked by #N/remove when #N; query GitHub API; flag if closed/merged.
  • Real-world example: affinescript/.github/workflows/ci.yml vscode-smoke 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." (chore(deps): bump bb8 from 0.8.6 to 0.9.1 #104 still open at the time, but illustrative).
  • Landed fix (reference): (no landed fix referenced)
  • Rule statement: The referenced issue (#N) is closed/merged. Update or delete this comment so the next reader doesn't waste time looking it up.

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