fix: invert watchdog op order — mutation before comment strip#53
fix: invert watchdog op order — mutation before comment strip#53samtuckerdavis merged 3 commits intomainfrom
Conversation
…tion-first, failure suppression, drift-repair
Fixes the bug where the pipeline-watchdog posted the strip-announcement comment before attempting the label mutation. When the mutation failed silently the comment was the only durable trace, leaving status:done on the issue. Three changes: 1. Mutation-first: gh issue edit --remove-label runs before gh issue comment; comment is only posted when mutation exits 0. 2. Failure logging: non-zero mutation exit writes a structured JSON entry to the orchestrator log (repo, issue, exit_code, stderr). 3. Drift-repair pass: scans a list of (repo, issue) pairs; for each issue that still has the strip-comment AND status:done, re-attempts removal. Closes #46
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Review rate limit: 0/5 reviews remaining, refill in 10 minutes and 39 seconds. Comment |
AdversarialSecurity review of Input boundaries:
Log file: Append-only JSON lines via json.dumps(). No raw string interpolation. No executable content. Safe. subprocess.run: All calls use argument lists, never shell=True. No shell injection possible. Safe. Comment body: Fixed f-string with only a module constant interpolated. No user-supplied content. Safe. Drift-repair idempotency: No credentials stored. No new third-party dependencies. Only stdlib. Adversarial scenarios:
Verdict: pass No Critical or High findings. |
Summary
scripts/pipeline_watchdog.py: mutation-firststrip_status_done, structured failure logging, anddrift_repair_passfor healing stale comment+label driftscripts/tests/test_pipeline_watchdog.py: 6 tests covering all three fixed behaviour paths, each naming the rule it encodes and the mutation that kills itCloses #46
Plan link
#46 (comment)
Test plan
test_mutation_first_behaviour: assertsgh issue edit --remove-labelcall precedesgh issue commentcall (call-order assertion)test_comment_suppressed_on_mutation_failure: mock returns exit 1; asserts no comment call appearstest_comment_posted_on_mutation_success: mock returns exit 0; asserts comment call appearstest_failure_logged_on_nonzero_exit: mock returns exit 1; asserts structured JSON entry in orchestrator log with repo, issue, exit_codetest_drift_repair_fires_on_stale_comment: issue has strip-comment + status:done; asserts edit call firestest_drift_repair_noop_when_label_absent: issue has strip-comment but status:done gone; asserts no edit callAdversarial considerations
gh_pathparameter accepts caller-supplied binary paths; programmatic callers are internal tooling and trusted. CLI input is not exec'd without argument list construction.