fix(workflows): error_classifier.js in root sparse-checkouts (+ green up the two pre-existing CI failures) - #2402
Conversation
…rkflows
github-api-with-retry.js does a top-level `require('./error_classifier')`,
but ~20 root workflows sparse-checkout the retry client WITHOUT
error_classifier.js. Any step that loads the client (require) throws
`Cannot find module './error_classifier'`.
Adds `.github/scripts/error_classifier.js` to every sparse-checkout block
that pulls github-api-with-retry.js (28 insertions across 20 files,
including all three multi-block files). Mirrors the consumer-template fix
in PR #2398.
Prioritized reusables consumers call: reusable-10-ci-python,
reusable-16-agents, reusable-70-orchestrator-{init,main},
reusable-agents-pr-health, reusable-bot-comment-handler.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughAcross 20 GitHub Actions workflow files, ChangesError classifier sparse-checkout propagation
Manifest generation safeguard
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Workflow source neededPR #2402 needs either a linked GitHub issue or one valid non-issue Workflow Source before PR metadata automation can manage it safely. Please do one of:
Once a valid source is present, this warning will not be reposted. |
Automated Status SummaryHead SHA: 8b24d58
Coverage Overview
Coverage Trend
Top Coverage Hotspots (lowest coverage)
Low Coverage Files (<50.0%)
Updated automatically; will refresh on subsequent CI/Docker completions. Keepalive checklistScopeNo scope information available Tasks
Acceptance criteria
|
) #2401 intentionally removed templates/consumer-repo/.github/dependabot.yml and its sync-manifest entry (create_only sync would otherwise resurrect Dependabot on consumers). test_consumer_create_only_files_are_manifested still asserted .github/dependabot.yml was manifested, turning Python Tests and every scenario python-3.12 job (+ the Aggregate/Publish roll-ups) red on every PR. Drops the stale expectation and adds a guard that the entry is NOT re-added. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The allowlist already covers all 8 drifting pairs, but their fingerprints went stale (renovate bumps, #2398 template edits, and this PR's error_classifier sparse-checkout additions), so Health-74 reported them as unallowlisted drift and failed. Recomputed every entry's normalized SHA in place via scripts/check_template_drift.py: the 7 still-valid entries are unchanged; the 8 stale entries (pair.1,5,6,7,8,9,11,15) are refreshed. Checker now reports 0 unallowlisted drift (exit 0). Divergence is the intentional health-74 baseline (root floating tags + concurrency vs. template SHA-pins); re-baselined, not aligned. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/workflows/test_consumer_sync_create_only_evidence.py`:
- Around line 24-27: Consolidate the two duplicate Dependabot exclusion comments
in the test function. Move the detailed explanation about `#2401` and the
create_only resurrection risk to a single comprehensive comment block at the top
of the test function, then replace the second comment block at lines 41-42 with
a brief inline reference like "# Regression guard: ensure dependabot.yml stays
out of manifest" that points back to the main explanation. This eliminates
redundancy while preserving the full context and maintains the regression guard
at the assertion point.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: a2e7f996-c4a1-4a06-97fa-ac087865da7a
📒 Files selected for processing (2)
config/template-drift-allowlist.txttests/workflows/test_consumer_sync_create_only_evidence.py
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
stranske/Template(auto-detected)
| # .github/dependabot.yml was intentionally dropped from the template and the | ||
| # manifest in #2401 (P3b of the Renovate fleet migration): create_only sync | ||
| # would otherwise resurrect Dependabot on every re-sync. It must no longer be | ||
| # manifested. |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial | 💤 Low value
Consider consolidating the two Dependabot exclusion comments.
Both comment blocks explain the same #2401 context and create_only resurrection risk. You could consolidate them into a single, more detailed comment at the top of the test function, then add a brief inline reference before the assertion (e.g., # Regression guard: ensure dependabot.yml stays out of manifest).
Also applies to: 41-42
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/workflows/test_consumer_sync_create_only_evidence.py` around lines 24 -
27, Consolidate the two duplicate Dependabot exclusion comments in the test
function. Move the detailed explanation about `#2401` and the create_only
resurrection risk to a single comprehensive comment block at the top of the test
function, then replace the second comment block at lines 41-42 with a brief
inline reference like "# Regression guard: ensure dependabot.yml stays out of
manifest" that points back to the main explanation. This eliminates redundancy
while preserving the full context and maintains the regression guard at the
assertion point.
Problem
.github/scripts/github-api-with-retry.jsdoes a top-levelrequire('./error_classifier')(line 20). ~20 root workflows sparse-checkout the retry client without.github/scripts/error_classifier.js, so any step that loads the client throwsCannot find module './error_classifier'. This is the root-repo equivalent of the consumer-template bug fixed in #2398.Fix (3 commits)
1.
error_classifier.jsin root sparse-checkouts (the actual bug)Added
.github/scripts/error_classifier.jsto every sparse-checkout block that pullsgithub-api-with-retry.js— 28 insertions across 20 files, 0 deletions. Six files have multiple sparse-checkout blocks (agents-autofix-loop×3,reusable-agents-pr-health×3, etc.); each block was fixed.Prioritized reusables:
reusable-10-ci-python,reusable-16-agents,reusable-70-orchestrator-{init,main},reusable-agents-pr-health,reusable-bot-comment-handler. Plus:agents-63-issue-intake,agents-autofix-dispatcher,agents-autofix-loop,agents-bot-comment-handler,agents-capability-check,agents-decompose,agents-dedup,agents-moderate-connector,agents-weekly-metrics,health-codex-auth-check,maint-46-post-ci,maint-62-integration-consumer,maint-72-fix-pr-body-conflicts,maint-coverage-guard.2. Stale dependabot manifest test (pre-existing red on every PR)
test_consumer_create_only_files_are_manifestedstill asserted.github/dependabot.ymlis manifested, but #2401 intentionally removed it from the template + manifest. This failedPython Tests, all sixScenario - */python 3.12jobs, and theAggregate & Verify/Publish Resultsroll-ups. Dropped the stale expectation; added a guard that it is not re-added.3. Stale Health-74 template-drift fingerprints (pre-existing red on every PR)
The drift allowlist already covers all 8 drifting pairs, but their SHA fingerprints went stale (renovate bumps, #2398's template edits, and this PR's sparse-checkout additions). Recomputed every entry's normalized SHA in place: 7 still-valid entries unchanged, 8 stale ones refreshed. Divergence is the intentional health-74 baseline (root floating tags + concurrency vs. template SHA-pins) — re-baselined, not aligned.
Verification (local)
.github/scripts/*.jsentries (norequire/run:adjacency); all 20 YAML-parse.scripts/check_template_drift.py→ 0 unallowlisted drift, exit 0.tests/workflows+tests/scripts: 2252 passed, 3 skipped (needs-human), including the previously-failing manifest test andtest_template_drift_workflow.py.🤖 Generated with Claude Code
Summary by CodeRabbit