[JIRA] (JENKINS-57089) Tag fails with merge before build triggered by GitLab

2 views
Skip to first unread message

ken.overly@gmail.com (JIRA)

unread,
Apr 17, 2019, 11:58:03 AM4/17/19
to jenkinsc...@googlegroups.com
Ken Overly created an issue
 
Jenkins / Bug JENKINS-57089
Tag fails with merge before build triggered by GitLab
Issue Type: Bug Bug
Assignee: Mark Waite
Attachments: image-2019-04-17-11-57-04-847.png
Components: git-plugin, gitlab-plugin
Created: 2019-04-17 15:57
Environment: Jenkins 2.164.1
Git client 2.7.6
Git plugin 3.9.3
GitLab Plugin 1.5.11
Priority: Critical Critical
Reporter: Ken Overly

Building a tag fails when 'merge before build' is configured.  Build is triggered by a push to GitLab.  The console output indicates merge is attempted, however I believe it should be the same as when a new branch is pushed which just checks out the revision.

Here's what a see when a new branch is pushed:

[EnvInject] - Loading node environment variables.
[EnvInject] - Preparing an environment for the build.
[EnvInject] - Keeping Jenkins system variables.
[EnvInject] - Keeping Jenkins build variables.
[EnvInject] - Evaluating the Groovy script content
[EnvInject] - Injecting contributions.
Building on master in workspace C:\jenkins\workspace\merge_test
[EnvInject] - Unset unresolved 'USERNAME' variable.
[WS-CLEANUP] Deleting project workspace...
[WS-CLEANUP] Deferred wipeout is used...
[WS-CLEANUP] Done
using credential f8a5a716-639d-4483-af01-f054e9ccbcc5
Cloning the remote Git repository
Cloning repository g...@st-gitlab.apsautobag.com:APS/test_jenkins.git
 > git.exe init C:\jenkins\workspace\merge_test # timeout=10
Fetching upstream changes from g...@st-gitlab.apsautobag.com:APS/test_jenkins.git
 > git.exe --version # timeout=10
using GIT_SSH to set credentials Repository authentication for GitLab
 > git.exe fetch --tags --force --progress g...@st-gitlab.apsautobag.com:APS/test_jenkins.git +refs/heads/*:refs/remotes/origin/*
 > git.exe config remote.origin.url g...@st-gitlab.apsautobag.com:APS/test_jenkins.git # timeout=10
 > git.exe config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git.exe config remote.origin.url g...@st-gitlab.apsautobag.com:APS/test_jenkins.git # timeout=10
Fetching upstream changes from g...@st-gitlab.apsautobag.com:APS/test_jenkins.git
using GIT_SSH to set credentials Repository authentication for GitLab
 > git.exe fetch --tags --force --progress g...@st-gitlab.apsautobag.com:APS/test_jenkins.git +refs/heads/*:refs/remotes/origin/* +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/* +refs/tags/*:refs/remotes/origin/tags/*
 > git.exe rev-parse "remotes/origin/develop^{commit}" # timeout=10
 > git.exe branch -a -v --no-abbrev --contains e41c8438b086f1aded8dc8e6f94227915fe846ed # timeout=10
Checking out Revision e41c8438b086f1aded8dc8e6f94227915fe846ed (origin/develop)
 > git.exe config core.sparsecheckout # timeout=10
 > git.exe checkout -f e41c8438b086f1aded8dc8e6f94227915fe846ed
Commit message: "Test change"
First time build. Skipping changelog.
[merge_test] $ cmd /c call C:\Windows\TEMP\jenkins8458950606275891551.bat

Here's what happens when a tag is pushed:

[EnvInject] - Loading node environment variables.
[EnvInject] - Preparing an environment for the build.
[EnvInject] - Keeping Jenkins system variables.
[EnvInject] - Keeping Jenkins build variables.
[EnvInject] - Evaluating the Groovy script content
[EnvInject] - Injecting contributions.
Building on master in workspace C:\jenkins\workspace\merge_test
[EnvInject] - Unset unresolved 'USERNAME' variable.
[WS-CLEANUP] Deleting project workspace...
[WS-CLEANUP] Deferred wipeout is used...
[WS-CLEANUP] Done
using credential f8a5a716-639d-4483-af01-f054e9ccbcc5
Cloning the remote Git repository
Cloning repository g...@st-gitlab.apsautobag.com:APS/test_jenkins.git
 > git.exe init C:\jenkins\workspace\merge_test # timeout=10
Fetching upstream changes from g...@st-gitlab.apsautobag.com:APS/test_jenkins.git
 > git.exe --version # timeout=10
using GIT_SSH to set credentials Repository authentication for GitLab
 > git.exe fetch --tags --force --progress g...@st-gitlab.apsautobag.com:APS/test_jenkins.git +refs/heads/*:refs/remotes/origin/*
 > git.exe config remote.origin.url g...@st-gitlab.apsautobag.com:APS/test_jenkins.git # timeout=10
 > git.exe config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git.exe config remote.origin.url g...@st-gitlab.apsautobag.com:APS/test_jenkins.git # timeout=10
Fetching upstream changes from g...@st-gitlab.apsautobag.com:APS/test_jenkins.git
using GIT_SSH to set credentials Repository authentication for GitLab
 > git.exe fetch --tags --force --progress g...@st-gitlab.apsautobag.com:APS/test_jenkins.git +refs/heads/*:refs/remotes/origin/* +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/* +refs/tags/*:refs/remotes/origin/tags/*
 > git.exe rev-parse "refs/tags/0.1^{commit}" # timeout=10
 > git.exe branch -a -v --no-abbrev --contains 9971f7545e9729f215a3ad02b27e8b375252c2d0 # timeout=10
Merging Revision 9971f7545e9729f215a3ad02b27e8b375252c2d0 (origin/tags/0.1, origin/master, origin/develop) to origin/refs/tags/0.1, UserMergeOptions{mergeRemote='origin', mergeTarget='refs/tags/0.1', mergeStrategy='default', fastForwardMode='--ff'}
 > git.exe rev-parse "origin/refs/tags/0.1^{commit}" # timeout=10
FATAL: Command "git.exe rev-parse "origin/refs/tags/0.1^{commit}"" returned status code 128:
stdout: origin/refs/tags/0.1^{commit}stderr: fatal: ambiguous argument 'origin/refs/tags/0.1^{commit}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'hudson.plugins.git.GitException: Command "git.exe rev-parse "origin/refs/tags/0.1^{commit}"" returned status code 128:
stdout: origin/refs/tags/0.1^{commit}stderr: fatal: ambiguous argument 'origin/refs/tags/0.1^{commit}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2042)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2010)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2006)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1638)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1650)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.revParse(CliGitAPIImpl.java:835)
	at hudson.plugins.git.GitAPI.revParse(GitAPI.java:316)
	at hudson.plugins.git.extensions.impl.PreBuildMerge.decorateRevisionToBuild(PreBuildMerge.java:66)
	at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:1100)
	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1193)
	at hudson.scm.SCM.checkout(SCM.java:504)
	at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)
	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
	at hudson.model.Run.execute(Run.java:1816)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
[Slack Notifications] found #2 as previous completed, non-aborted build
[Slack Notifications] will send OnSingleFailureNotification because build matches and user preferences allow it
Finished: FAILURE

With a tag I think PreBuildMerge() should determine there is no branch to merge and just check out the revision - same as what happens for a new branch.

Here's my job configuration:

refspec is: +refs/heads/:refs/remotes/origin/ +refs/merge-requests//head:refs/remotes/origin/merge-requests/ +refs/tags/:refs/remotes/origin/tags/ 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

ken.overly@gmail.com (JIRA)

unread,
Apr 17, 2019, 11:59:02 AM4/17/19
to jenkinsc...@googlegroups.com
Ken Overly updated an issue
Change By: Ken Overly
Building a tag fails when 'merge before build' is configured.  Build is triggered by a push to GitLab.  The console output indicates merge is attempted, however I believe it should be the same as when a new branch is pushed which just checks out the revision.

Here's what a I see when a new branch is pushed:
{noformat}
{noformat}

Here's what happens when a tag is pushed:
{noformat}
Finished: FAILURE{noformat}

With a tag I think PreBuildMerge() should determine there is no branch to merge and just check out the revision - same as what happens for a new branch.

Here's my job configuration:

!image-2019-04-17-11-57-04-847.png|width=867,height=625!

refspec is: +refs/heads/*:refs/remotes/origin/* +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/* +refs/tags/*:refs/remotes/origin/tags/* 

ken.overly@gmail.com (JIRA)

unread,
Apr 17, 2019, 12:00:09 PM4/17/19
to jenkinsc...@googlegroups.com
Ken Overly updated an issue
Building a tag fails when 'merge before build' is configured.  Build is triggered by a push to GitLab.  The console output indicates merge is attempted, however I believe it should be the same as when a new branch is pushed which just checks out the revision.

Here's what I see when a new branch is pushed:
` PreBuildMerge() ` should determine there is no branch to merge and just check out the revision - same as what happens for a new branch.

ken.overly@gmail.com (JIRA)

unread,
Apr 17, 2019, 12:00:10 PM4/17/19
to jenkinsc...@googlegroups.com

ken.overly@gmail.com (JIRA)

unread,
Apr 17, 2019, 12:56:02 PM4/17/19
to jenkinsc...@googlegroups.com
Ken Overly updated an issue
Building a tag fails when 'merge before build' is configured.  Build is triggered by a push to GitLab.  The console output indicates a merge is attempted, however I believe it should be the same as when a new branch is pushed which just checks out the revision.

ken.overly@gmail.com (JIRA)

unread,
Apr 17, 2019, 12:56:02 PM4/17/19
to jenkinsc...@googlegroups.com
Ken Overly updated an issue
Building a tag fails when 'merge before build' is configured.  Build is triggered by a push to GitLab.  The console output indicates a merge is attempted, however I believe it should be the same as when a new branch is pushed - which just checks out the revision.

ken.overly@gmail.com (JIRA)

unread,
Apr 17, 2019, 2:06:03 PM4/17/19
to jenkinsc...@googlegroups.com

{noformat}
+refs/heads/ * :refs/remotes/origin/ * +refs/merge-requests/ * /head:refs/remotes/origin/merge-requests/ * +refs/tags/ * :refs/remotes/origin/tags/ *   {noformat}
 

ken.overly@gmail.com (JIRA)

unread,
Apr 17, 2019, 2:06:04 PM4/17/19
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Aug 24, 2019, 12:48:02 PM8/24/19
to jenkinsc...@googlegroups.com
Mark Waite assigned an issue to Unassigned
Change By: Mark Waite
Assignee: Mark Waite
Reply all
Reply to author
Forward
0 new messages