Test-only job fails with "couldn't find remote ref refs/heads/11.x" when 11.x branch does not exist in fork

Created on 5 February 2024, 11 months ago
Updated 5 March 2024, 10 months ago

Problem/Motivation

Followup to πŸ› Spell-checking job fails with "couldn't find remote ref refs/heads/11.x" when 11.x branch does not exist in fork Active

When a new branch is pushed to an old fork and the fork existed before the 11.x branch, and an MR is created against 11.x, the test-only job fails

couldn't find remote ref refs/heads/11.x

Steps to reproduce

Find an issue with a fork that existed pre 11.x
Create a new branch on the fork with some changes
Create an MR with that branch against 11.x

Proposed resolution

Use ${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-$CI_MERGE_REQUEST_DIFF_BASE_SHA} to calculate the optimal base SHA for the MR. This avoids fetching any remote and uses the target SHA if available (MRs created by core committers) or the base SHA of the merge (MRs created by non-committers). Either way the change set should only contain the changes in the MR itself.

Merge request link

Remaining tasks

πŸ› Bug report
Status

Fixed

Version

10.2 ✨

Component
OtherΒ  β†’

Last updated 2 days ago

Created by

πŸ‡¬πŸ‡§United Kingdom longwave UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024