Skip to content

fix(relay): reject GitLab MRs targeting a different base - #1340

Merged
sungjunlee merged 1 commit into
mainfrom
fill/issue-1339
Sep 21, 2026
Merged

sungjunlee merged 1 commit into
mainfrom
fill/issue-1339

Conversation

@sungjunlee

Copy link
Copy Markdown
Owner

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

Reject merge requests whose target is not the requested base before
identity-match or exact-head bind so a same-source-branch MR is never
reused against a different base.

Closes #1339
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 0afa5b30-7d5b-4e91-8029-d9cdb3a19117


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-21T14:38:39.261871Z 5a37f2d PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sungjunlee

Copy link
Copy Markdown
Owner Author

nightly DS review: pass (nit: comment still mentions looser pool). Complementary qwen still pending (PONG timeout).

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@sungjunlee

Copy link
Copy Markdown
Owner Author

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.

@sungjunlee
sungjunlee merged commit 454d845 into main Sep 21, 2026
10 checks passed
@sungjunlee
sungjunlee deleted the fill/issue-1339 branch September 21, 2026 21:10
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.

fix(relay): reject GitLab MRs targeting different base (#1338)

1 participant