fix(gate): refresh PR files before policy evaluation - #866
Conversation
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 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. |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
gittensory · advisory review Reviewed 4 changed file(s) — two independent AI reviewers. Changed files: Suggested action: ✅ Safe to merge — both reviewers found no blocking issues. Reviewer A · Suggestions
Worth double-checking
Reviewer B · Suggestions
Worth double-checking
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #866 +/- ##
==========================================
- Coverage 96.72% 96.71% -0.01%
==========================================
Files 109 109
Lines 14750 14769 +19
Branches 5340 5344 +4
==========================================
+ Hits 14267 14284 +17
- Misses 95 96 +1
- Partials 388 389 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
9f26870 to
4b971d4
Compare
…ty-in-manifest-policy-gate # Conflicts: # src/queue/processors.ts
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | bd31b88 | Commit Preview URL Branch Preview URL |
Jun 19 2026, 05:55 AM |
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>
Motivation
Description
deletePullRequestFilesinsrc/db/repositories.tsand clear cached file rows for a PR before inserting fresh file metadata.refreshPullRequestDetails(env, repoFullName, pullNumber)tosrc/github/backfill.tswhich fetches the current PR files/reviews/checks, replaces cached rows viadeletePullRequestFiles, and updates thepull_request_detail_sync_staterow.refreshPullRequestDetailsfrom the PR webhook path insrc/queue/processors.tsbeforemaybePublishPrPublicSurfacewhenslopGateModeormanifestPolicyGateModeis enabled so gates evaluate up-to-date files.test/unit/backfill.test.tsthat seeds a stale cached file row, stubs GitHub responses for the current head, callsrefreshPullRequestDetails, and asserts the stale row is replaced by the fetched file list.Testing
npx tsc --noEmitand it succeeded.npx vitest run test/unit/backfill.test.tsand the new regression test passed.npx vitest run test/unit/gate-check-policy.test.tsand all tests passed.Codex Task