jenkinsci / jenkinsci/gitlab-branch-source-plugin

[JENKINS-62343] Jenkinsfile on change request is not consistent with console log

Open
#676 6 comments 0 reactions 0 assignees View on GitHub
component:gitlab-branch-source-plugin imported-jira-issue priority:blocker resolution:unresolved
Dominant language
Java
Stars
134
Forks
113
PR merge metrics
No merged PRs in 30d

Description

At the top of the console log for a build running on a Gitlab merge request, I see output similar to the following:

16:12:10 Querying the current revision of merge request #1...

16:12:10 Current revision of merge request #1 is 30c945266d014280630074dafbe6ba31991adc90*

16:12:11* Obtained Jenkinsfile from 56e3895c10f6163a93e025647e8e0dfcfa88ca9d+30c945266d014280630074dafbe6ba31991adc90

i.e. it should be the Jenkinsfile as if the two commits identified are merged together.

However, that does not seem to be the case - it seems that the Jenkinsfile it uses is that from the source branch head only (and this is how it looks if I examine the Jenkinsfile in Replay)

I have replicated this using a simple test repository as follows:

1) Create a new repo

2) Commit the following Jenkinsfile to master:

echo "one"


3) Branch off master

4) Add the following to Jenkinsfile on the branch:

echo "two"


5) Add the following to Jenkinsfile on master:

echo "three"


6) Raise a merge request

When the build runs, it will echo one and two, but not three.

I have conducted the same test against a Bitbucket branch source, and that seems to work correctly, which suggests the issue is with the plugin rather than Jenkins core.

 

 

 

---
Originally reported by mosaic_nick, imported from: Jenkinsfile on change request is not consistent with console log


  • assignee: baymac
  • status: Open
  • priority: Blocker
  • component(s): gitlab-branch-source-plugin
  • resolution: Unresolved
  • votes: 2
  • watchers: 4
  • imported: 20251216-182730

Raw content of original issue

At the top of the console log for a build running on a Gitlab merge request, I see output similar to the following:
16:12:10 Querying the current revision of merge request #1...

16:12:10 Current revision of merge request #1 is 30c945266d014280630074dafbe6ba31991adc90*

16:12:11* Obtained Jenkinsfile from 56e3895c10f6163a93e025647e8e0dfcfa88ca9d+30c945266d014280630074dafbe6ba31991adc90

i.e. it should be the Jenkinsfile as if the two commits identified are merged together.

However, that does not seem to be the case - it seems that the Jenkinsfile it uses is that from the source branch head only (and this is how it looks if I examine the Jenkinsfile in Replay)

I have replicated this using a simple test repository as follows:

1) Create a new repo
2) Commit the following Jenkinsfile to master:



echo "one"



3) Branch off master
4) Add the following to Jenkinsfile on the branch:



echo "two"



5) Add the following to Jenkinsfile on master:



echo "three"



6) Raise a merge request

When the build runs, it will echo one and two, but not three.

I have conducted the same test against a Bitbucket branch source, and that seems to work correctly, which suggests the issue is with the plugin rather than Jenkins core.

 

 

 

environment

```
Jenkins 2.222.3

Gitlab Branch Source Plugin 1.5.1
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.