Skip to content

fix(ci): drift detector — real repo slugs, no banner pollution, error≠drift - #826

Merged
hyperpolymath merged 2 commits into
mainfrom
fix/708-drift-detector-report
Sep 17, 2026
Merged

hyperpolymath merged 2 commits into
mainfrom
fix/708-drift-detector-report

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Refs #708 (residual defects — schedule and issue-updating halves were fixed earlier; this PR completes the standards-side remainder).

Residual defects re-measured today (2026-09-17)

Evidence: downloaded the run's own drift-report.tsv artifact (2026-09-15):

Defect (from #708) Measured in the artifact
1. Repos anonymised as _w 351 of 351 data rows say _w (script writes $(basename "$REPO_DIR"); workflow clones into _w)
2. Banners counted as entries 419 lines = header + 351 rows + 67 [drift] clean banner lines — the summary's "drifted entries 418" counts banners because the clean-banner echo goes to stdout
3. Script errors counted as drift workflow: if ! script …; then drifted++ — exit 2 (usage/env error) and exit 1 (drift) folded together

Fix

  1. Slug identity: check-lockfile-drift.sh takes optional REPO_SLUG (arg 2, documented in the header, stdout-vs-stderr contract stated); the workflow passes the real repo slug for every clone.
  2. Banner out of the data plane: the clean-banner echo moves to stderr; the row count now counts tab-bearing lines minus the header, so even a future banner cannot inflate drifted entries.
  3. Error ≠ drift: exit codes split — rc=1 → drifted, anything else → a new errors counter, surfaced in both the step summary and the tracking-issue table (check errors (rc≠0,1) row).

Validation

  • bash -n on the script AND on the extracted sweep step block; PyYAML parse of the workflow
  • Fixture test: drifted fixture emits owner/myrepo<TAB>ci.yml<TAB>… and exits 1; clean fixture emits empty stdout (banner on stderr) and exits 0
  • Diff: 2 files, +32/−8

Not closing #708 on merge: its last acceptance piece is an estate re-run under the repaired detector — that happens automatically next Tuesday cron, and the resulting artifact should then show real slugs and truthful counts.

…≠drift (refs #708 residuals)

Three residual defects from #708, re-measured at HEAD and in the
2026-09-15 artifact (351/351 rows said _w; 67 of 418 'drifted entries'
were [drift] clean banner lines):

1. Anonymised rows: the script wrote $(basename "$REPO_DIR") = _w.
   It now takes an optional REPO_SLUG arg 2 (documented in the header,
   stdout-versus-stderr contract included), and the workflow passes it
   the real repo slug.

2. Banner pollution: the trailing '[drift] clean' echo went to STDOUT,
   landing in drift-report.tsv and inflating the row count. It now goes
   to stderr (stdout is data-only by contract), and the workflow's rows
   count counts tab-bearing lines minus the header, so a future banner
   can never inflate the number again.

3. Error-as-drift: exit 2 (usage/env error) was counted identically to
   exit 1 (drift). Now split: rc=1 → drifted, anything else → errors,
   with the count surfaced in the step summary AND the tracking-issue
   table ('check errors (rc≠0,1)' row).

Validation: bash -n on script + extracted sweep block; PyYAML parse;
fixture test — drifted fixture emits 'owner/myrepo<TAB>ci.yml…' and
exits 1; clean fixture emits empty stdout with banner on stderr and
exits 0. Does NOT close #708 (estate re-run pending) but completes its
standards-side remainder.
@coderabbitai

coderabbitai Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 46 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 771f546a-fe3b-4d60-aac7-73f3bb1c7ed7

📥 Commits

Reviewing files that changed from the base of the PR and between cf7d262 and 1e71c94.

📒 Files selected for processing (2)
  • .github/workflows/lockfile-drift-detect.yml
  • scripts/check-lockfile-drift.sh

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.

@hyperpolymath
hyperpolymath merged commit d7cf0ba into main Sep 17, 2026
1 check passed
@hyperpolymath
hyperpolymath deleted the fix/708-drift-detector-report branch September 17, 2026 20:05
@sonarqubecloud

Copy link
Copy Markdown

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