Repository navigation
fix(relay): reject GitLab MRs targeting a different base - #1340
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
nightly DS review: pass (nit: comment still mentions looser pool). Complementary qwen still pending (PONG timeout). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5a37f2d413
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // identity-match, matching the GitHub head-repo identity requirement. | ||
| function selectGitlabMr(rows, { branch, baseBranch, localHeadSha = null, recordedCrNumber = null }) { | ||
| const rowsList = Array.isArray(rows) ? rows : []; | ||
| const requestedTarget = rowsList.filter((row) => row?.target_branch === baseBranch); |
There was a problem hiding this comment.
Filter by target branch before the 100-row API cap
When a source branch has more than 100 historical MRs across different targets, the request remains capped at per_page=100 without a target_branch filter, so this client-side filter can miss a valid MR for baseBranch on a later page. The adapter then incorrectly reports a complete empty lookup (lookup_complete: true, matching_mr_count: 0), allowing the consumer to attempt creation even though the matching MR already exists; include the target in the API query or paginate before declaring the lookup complete.
Useful? React with 👍 / 👎.
|
06:00 continuation: qwen lane down (Alibaba Token Plan 0% + PONG timeout). Complementary DS review pass from 23:00. SIMPLE + required CI green. Squash so the issue closes. |
Closes #1339
Summary
Reject GitLab MRs whose target ≠ requested baseBranch before identity-match / exact-head bind. Same-source-branch + different target is not reused. GitHub route regression covered.
Verify
node --test --test-concurrency=1 tests/relay-dispatch/scripts/forge-adapters.test.js→ 19 pass / 0 fail.Nightly grok 4.6. Complementary review: DS (+ qwen if PONG recovers).