Skip to content

fix(queue): honor paused autoreview markers#4091

Merged
JSONbored merged 1 commit into
mainfrom
codex/fix-pause-command-not-stopping-reviews
Jul 8, 2026
Merged

fix(queue): honor paused autoreview markers#4091
JSONbored merged 1 commit into
mainfrom
codex/fix-pause-command-not-stopping-reviews

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • The @gittensory pause command records a per-PR github_app.autoreview_paused audit marker but the scheduled/webhook re-review paths continued to run the auto-review publication step, undermining the pause intent.
  • This could cause maintainers to receive a confirmation that auto-review was paused while later jobs still invoked AI and posted public surface output.

Description

  • Stop re-review early by returning from reReviewStoredPullRequest when a completed github_app.autoreview_paused marker exists by calling a new hasAutoreviewPausedMarker helper.
  • Add hasAutoreviewPausedMarker(env, repoFullName, prNumber) which reads the latest github_app.autoreview_paused completed audit row and fail-opens on DB lookup errors.
  • Add a regression test in test/unit/queue.test.ts that seeds a pause audit event and asserts that an agent-regate-pr run does not call the AI, post a PR comment, or write a check run.

Testing

  • Ran the targeted unit test with npx vitest run test/unit/queue.test.ts -t "autoreview pause marker", and the test passed (the regression test succeeded and other tests were skipped as expected).
  • Ran static type checks with npm run typecheck, which completed successfully.
  • Performed basic validation with git diff --check during the change cycle with no issues reported.

Codex Task

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@gittensory-orb gittensory-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.5x multiplier. label Jul 8, 2026
@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.63%. Comparing base (cd1d0a1) to head (20ce618).
⚠️ Report is 5 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4091   +/-   ##
=======================================
  Coverage   93.63%   93.63%           
=======================================
  Files         384      384           
  Lines       35827    35831    +4     
  Branches    13150    13151    +1     
=======================================
+ Hits        33548    33552    +4     
  Misses       1618     1618           
  Partials      661      661           
Files with missing lines Coverage Δ
src/queue/processors.ts 95.07% <100.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gittensory-orb

gittensory-orb Bot commented Jul 8, 2026

Copy link
Copy Markdown

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-08 00:14:43 UTC

2 files · 1 AI reviewer · 2 blockers · readiness 93/100 · CI green · clean

⏸️ Suggested Action - Manual Review

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.

Review summary
This closes a real gap: the pause command wrote an audit marker but the scheduled/webhook re-review path never checked it, so AI review, comments, and check-runs still fired after a maintainer was told review was paused. The fix adds a single early-return guard in reReviewStoredPullRequest backed by a fail-open DB lookup, and the regression test seeds a completed pause marker and asserts zero AI calls, zero comment POSTs, and zero check-run writes via processJob("agent-regate-pr") — that's a real end-to-end exercise of the path, not a fabricated payload. The guard is placed before the live-facts resync and AI invocation, so it also saves the wasted resync work, which is correct.

Nits — 5 non-blocking
  • hasAutoreviewPausedMarker (src/queue/processors.ts) only checks whether *any* completed 'github_app.autoreview_paused' marker exists for the PR, ordered by its own event_type — if there's a corresponding resume/unpause command elsewhere in the codebase that writes a different event_type, this query never compares timestamps against it and a pause would silently become permanent for that PR; worth confirming there's no unpause path, or if there is, that the lookup should pick the latest of both event types rather than just the latest paused one.
  • The catch block's fail-open return is excluded from coverage via a `/* v8 ignore next */` comment rather than a real DB-error test — reasonable given the audit table is core infrastructure, but flag it explicitly since ~97% branch coverage is the bar here.
  • No migration is needed since audit_events is reused as-is, but worth double-checking target_key format (`${repoFullName}#${prNumber}`) matches exactly what recordAutoreviewPausedSkip/the pause command writes elsewhere, since a format mismatch would make the guard a silent no-op.
  • Confirm (and ideally state in the PR description) whether pause is meant to be permanent per-PR or whether a resume path exists; if resume exists, the query needs to compare against the latest event across both marker types.
  • Consider adding a short comment above the new guard line in reReviewStoredPullRequest noting why it must run before the live-facts resync (avoids wasted work once paused), matching the style of the adjacent #sweep-resync comment.

Concerns raised — review before merging

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
Signal Result Evidence
Code review ❌ 2 blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 51 registered-repo PR(s), 43 merged, 496 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 51 PR(s), 496 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, JavaScript, Ruby, Go, Kotlin, MDX, Shell
  • Official Gittensor activity: 51 PR(s), 496 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@gittensory-orb gittensory-orb Bot added the manual-review Gittensor contributor context label Jul 8, 2026
@JSONbored JSONbored merged commit fdda0a2 into main Jul 8, 2026
10 checks passed
@JSONbored JSONbored deleted the codex/fix-pause-command-not-stopping-reviews branch July 8, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark codex gittensor:bug Gittensor-scored bug fix — scores a 0.5x multiplier. manual-review Gittensor contributor context

Development

Successfully merging this pull request may close these issues.

1 participant