Skip to content

fix(gate): refresh PR files for merge readiness - #925

Merged
JSONbored merged 1 commit into
mainfrom
codex/fix-merge-readiness-gate-stale-pr-file-issue
Jun 19, 2026
Merged

fix(gate): refresh PR files for merge readiness#925
JSONbored merged 1 commit into
mainfrom
codex/fix-merge-readiness-gate-stale-pr-file-issue

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • The pre-gate PR-detail refresh only ran when slopGateMode or manifestPolicyGateMode were enabled, but mergeReadinessGateMode also consumes slop/file evidence so stale cached file lists could let a merge-readiness gate pass incorrectly.

Description

  • Replace the explicit settings.slopGateMode !== "off" check with shouldCollectSlopEvidence(settings) so PR details are refreshed whenever slop evidence is needed (including merge-readiness-only configs) while preserving manifest refresh behavior.
  • Add test instrumentation in test/unit/queue.test.ts to assert that the PR files endpoint is hit during the slop-off + merge-readiness scenario and verify the refresh occurs.
  • Files changed: src/queue/processors.ts and test/unit/queue.test.ts.

Testing

  • Ran the targeted unit test with npm test -- --run test/unit/queue.test.ts -t "clears the persisted dashboard slop score" and it passed.
  • Ran the project's typecheck with npm run typecheck (TS tsc --noEmit) and it succeeded.

Codex Task

@ghost

ghost commented Jun 19, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #925 is no longer open. No action.

💰 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.

@ghost ghost added the gittensory:reviewed label Jun 19, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

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

@ghost

ghost commented Jun 19, 2026

Copy link
Copy Markdown

gittensory · advisory review

Reviewed 2 changed file(s) — two independent AI reviewers.

Changed files: src/queue/processors.ts, test/unit/queue.test.ts

Suggested action:Safe to merge — both reviewers found no blocking issues.

Reviewer A · gpt-oss-120b — recommends ✅ merge
The PR replaces a direct settings check with a helper function shouldCollectSlopEvidence and adds a test to verify that PR file refresh is triggered, capturing the fetch call for /pulls/91/files.

Suggestions

  • Confirm that shouldCollectSlopEvidence is imported in processors.ts to avoid a compile error.
  • Consider adding a complementary test case where the condition is false to ensure no unnecessary file fetch occurs.
  • If shouldCollectSlopEvidence adds extra gating logic, document the intended behavior change for future maintainers.

Worth double-checking

  • If the helper function's logic differs from the original settings.slopGateMode !== "off" check, it could unintentionally skip required refreshes.
  • Missing import of the helper could break the build.

Reviewer B · nemotron-3-120b-a12b — recommends ✅ merge
The PR modifies the condition for triggering PR file refreshes in the GitHub webhook processor, replacing a direct slopGateMode check with a shouldCollectSlopEvidence(settings) call. It also updates a unit test to verify the refresh occurs when expected. The change appears to be a targeted fix for merge readiness logic, and the test addition provides appropriate coverage for the new behavior.

Worth double-checking

  • Verify that shouldCollectSlopEvidence(settings) correctly captures the intended slop gate activation logic (not visible in diff).
  • Ensure the test modification doesn't inadvertently override existing test assertions in the same test block.

@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.60%. Comparing base (cf5cc6d) to head (126b7d1).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #925   +/-   ##
=======================================
  Coverage   96.60%   96.60%           
=======================================
  Files         109      109           
  Lines       14894    14894           
  Branches     5383     5383           
=======================================
  Hits        14389    14389           
  Misses        104      104           
  Partials      401      401           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored
JSONbored merged commit 22e4583 into main Jun 19, 2026
20 checks passed
@JSONbored
JSONbored deleted the codex/fix-merge-readiness-gate-stale-pr-file-issue branch June 19, 2026 07:07
JSONbored added a commit that referenced this pull request Jun 20, 2026
The webhook gate path refreshes the PR's files before evaluating the slop and
manifest-policy gates (#866/#925), but the manual 'Re-run Gittensory review'
retrigger called the same publish path without refreshing. A user re-running
after pushing commits got the slop/manifest gate evaluated against stale (or
empty) cached files, so the re-published Gate check reflected the wrong diff.

Mirror the webhook guard: refresh the PR files before publishing on the
retrigger path too. refreshPullRequestDetails is fail-safe (preserves the
cache on a fetch error).

Closes #927

Co-authored-by: ghost <49853598+JSONbored@users.noreply.github.com>
Co-authored-by: reviewwed[bot] <292611012+reviewwed[bot]@users.noreply.github.com>
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