Skip to content

fix: drift detector must skip commented-out uses: lines - #647

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/drift-detector-skip-comments
Aug 26, 2026
Merged

fix: drift detector must skip commented-out uses: lines#647
hyperpolymath merged 1 commit into
mainfrom
fix/drift-detector-skip-comments

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

The detector matched uses: owner/repo@ref anywhere in a workflow, including inside comments.

metadatastician/_pathroot's e2e.yml carries ten commented-out # - uses: actions/checkout@34e11487… lines from a disabled job block. The live line already uses @v7.0.1 correctly — so the tool reported drift on dead code.

That is precisely the false-positive class that gets a detector ignored, which would be worse than not shipping it at all.

Verified both ways

Test Before After
_pathroot 1 false positive clean
hypatia pre-fix fixture finds real drift still finds it

Found in anger

This surfaced while using the detector on metadatastician/metadatastician-governance#24. It correctly identified the four dead workflows in _pathrootts-blocker, guix-nix-policy, npm-bun-blocker, jekyll-gh-pages — with the false positive sitting alongside them. The signal was right; the noise needed removing.

🤖 Generated with Claude Code

The detector matched 'uses: owner/repo@ref' anywhere in a workflow,
including inside comments. metadatastician/_pathroot's e2e.yml carries
ten commented-out '#  - uses: actions/checkout@34e11487...' lines from a
disabled job block; the LIVE line already uses @v7.0.1 correctly.

So the tool reported drift on dead code. That is the false-positive class
that gets a detector ignored, which would be worse than not shipping it.

Strips comment lines before matching. Verified both ways:
  * _pathroot: 1 false positive -> clean
  * hypatia pre-fix fixture: still finds the real drift (regression held)

Found while using the detector in anger on
metadatastician-governance#24 — it correctly identified the four dead
workflows in _pathroot (ts-blocker, guix-nix-policy, npm-bun-blocker,
jekyll-gh-pages) before this false positive surfaced alongside them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@hyperpolymath
hyperpolymath merged commit 685341c into main Aug 26, 2026
@hyperpolymath
hyperpolymath deleted the fix/drift-detector-skip-comments branch August 26, 2026 17:27
@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 920a70d8-6b54-477a-89c3-cd75286ee059

📥 Commits

Reviewing files that changed from the base of the PR and between 9f916c1 and 6027b7d.

📒 Files selected for processing (1)
  • scripts/check-lockfile-drift.sh

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Updated lockfile drift checks to ignore commented-out workflow actions.
    • Prevented inactive action references from being incorrectly reported as drift.

Walkthrough

The lockfile drift check now removes full-line comments before it scans workflow files for uses: references. Commented-out actions no longer affect drift detection.

Changes

Lockfile drift detection

Layer / File(s) Summary
Filter commented workflow actions
scripts/check-lockfile-drift.sh
The action scan removes full-line comments before extracting uses: references. Normalisation and drift comparison remain unchanged.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Suggested reviewers: joshuajewell

Poem

A rabbit checks the workflow lines
And skips the comments, neat and fine
The live actions remain in view
Drift checks now know what is true
The lockfile rests beneath the moon

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@gitar-bot

gitar-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

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