ci: Pass merge request flag to downstream pipeline
1. Issue:
When the downstream pipeline OAI-FLEXRIC-RAN-Integration-Test is triggered via OAI-FLEXRIC, the downstream job did not know it was triggered by a merge request (MR). The downstream parameter params.eNB_mergeRequest thus used the default value set in the Jenkins configuration (i.e., False). As a result, the downstream pipeline always followed the else condition:
1.1 Script Snippet
In the Jenkinsfile
def is_MR = params.eNB_mergeRequest ?: false
if (allParametersPresent) {
echo '\u2705 \u001B[94m All parameters are present\u001B[0m'
if (is_MR) {
sh "git fetch"
sh "./ci-scripts/doGitLabMerge.sh --src-branch ${sourceBranch} --src-commit ${commitID} --target-branch ${targetBranch} --target-commit latest"
} else {
sh "git fetch"
sh "git checkout -f ${commitID}"
}
} else {
echo "\u274C Some parameters are missing"
sh "./ci-scripts/fail.sh"
}
}
1.2 Jenkins Console
In a failed Jenkins Run
The pipeline first checks-out at latest develop commit:
Checking out Revision 9cb79027e4b06ae608a83c741a0c967be26c4243 (refs/remotes/origin/develop)
Commit message: "Merge branch 'integration_2026_w05' into 'develop'"
> git rev-parse --resolve-git-dir /home/oaicicd/jenkins/workspace/OAI-FLEXRIC-RAN-Integration-Test/.git # timeout=10
> git config remote.origin.url https://gitlab.eurecom.fr/oai/openairinterface5g.git # timeout=10
> git rev-parse --verify HEAD # timeout=10
Resetting working tree
> git reset --hard # timeout=10
> git clean -fdx # timeout=10
Fetching upstream changes from https://gitlab.eurecom.fr/oai/openairinterface5g.git
> git --version # timeout=10
> git --version # 'git version 2.34.1'
> git fetch --tags --force --progress -- https://gitlab.eurecom.fr/oai/openairinterface5g.git +refs/heads/*:refs/remotes/origin/* # timeout=10
> git rev-parse refs/remotes/origin/develop^{commit} # timeout=10
> git config core.sparsecheckout # timeout=10
> git checkout -f 9cb79027e4b06ae608a83c741a0c967be26c4243 # timeout=10
> git rev-list --no-walk 9cb79027e4b06ae608a83c741a0c967be26c4243 # timeout=10
However, in Verify Parameter stage, it again does a force checkout on commitID:
def commitID = params.eNB_CommitID ?: env.GIT_COMMIT
This value by default is set to develop in Jenkins configuration.
As a result, we see:
10:49:48 + git checkout -f develop
10:49:48 Previous HEAD position was 9cb79027e4 Merge branch 'integration_2026_w05' into 'develop'
10:49:48 Switched to branch 'develop'
10:49:48 Your branch is behind 'origin/develop' by 526 commits, and can be fast-forwarded.
10:49:48 (use "git pull" to update your local branch)
1.3 Push Events Failures
For push events, we have:
sh "git fetch"
sh "git checkout -f ${commitID}"
We need to do a reset hard so that the run is executed on synchronized develop branch.
2. Fix
For the downstream pipeline triggered by Merge Requests, we pass the value of eNB_mergeRequest as True if it is triggered by a merge request.
Below are the runs for pipeline triggered by a merge request event:
In the console, we can see:
10:46:34 + ./ci-scripts/doGitLabMerge.sh --src-branch develop --src-commit develop --target-branch develop --target-commit latest
10:46:34 Source Branch is : develop
10:46:34 Source Commit ID is : develop
10:46:34 Target Branch is : develop
10:46:34 Target Commit ID is : 9cb79027e4b06ae608a83c741a0c967be26c4243
10:46:34 Already up to date.
Now, for Push Events:
In the OAI-FLEXRIC-RAN-Integration-Test pipeline, which is executed by Build with Parameters from OAI-FLEXRIC
We see the pipeline took the latest develop:
11:26:02 + git reset --hard origin/develop
11:26:02 HEAD is now at 9cb79027e4 Merge branch 'integration_2026_w05' into 'develop'
This fix is applied in the openairinterface5g repository, in this commit