Skip to content

fix(review): refresh PR files when pre-merge checks are path-gated#1402

Open
JSONbored wants to merge 1 commit into
mainfrom
codex/fix-path-gated-pre-merge-check-vulnerability
Open

fix(review): refresh PR files when pre-merge checks are path-gated#1402
JSONbored wants to merge 1 commit into
mainfrom
codex/fix-path-gated-pre-merge-check-vulnerability

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • Path-scoped review.pre_merge_checks (entries with when_paths) rely on accurate PR file lists to decide whether an enforced check applies, and stale cached pull_request_files could let an enforced check be incorrectly ignored.

Description

  • Add shouldRefreshFilesForPreMergeChecks(env, repoFullName) to detect whether the repo manifest contains any pre_merge_checks with when_paths.
  • Wire that predicate into stored re-review, pull_request webhook synchronize/processing, and manual re-run paths so refreshPullRequestDetails runs when path-gated checks are configured.
  • Add a unit test for the refresh predicate in test/unit/gate-check-policy.test.ts and a synchronize regression test that seeds stale cached files and verifies a live files fetch replaces them in test/unit/queue.test.ts.

Testing

  • Ran git diff --check and npm run typecheck, both succeeded.
  • Ran targeted unit tests with npx vitest run test/unit/gate-check-policy.test.ts test/unit/queue.test.ts -t "refreshes files when pre-merge checks|refreshes pull request files for path-gated pre-merge checks" and the new/affected tests passed.
  • Attempted full npm run test:ci; the run progressed but could not be completed in this environment (coverage phase / long-running CI step was stopped).
  • npm audit --audit-level=moderate could not complete due to the registry audit endpoint returning 403 Forbidden in this environment.

Codex Task

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jun 26, 2026
@superagent-security

Copy link
Copy Markdown

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

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.34%. Comparing base (6138b9e) to head (b455de9).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/queue/processors.ts 80.00% 0 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (80.00%) is below the target coverage (97.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1402   +/-   ##
=======================================
  Coverage   95.33%   95.34%           
=======================================
  Files         192      192           
  Lines       20750    20752    +2     
  Branches     7500     7500           
=======================================
+ Hits        19783    19785    +2     
  Misses        383      383           
  Partials      584      584           
Files with missing lines Coverage Δ
src/queue/processors.ts 87.63% <80.00%> (+0.02%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark codex size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant