[JIRA] (JENKINS-61760) Setting CloneOption trait on SCMSource with shallow depth causes MR builds to fail

17 views
Skip to first unread message

timothy.bell@liferay.com (JIRA)

unread,
Mar 31, 2020, 3:43:03 PM3/31/20
to jenkinsc...@googlegroups.com
Timothy Bell created an issue
 
Jenkins / Bug JENKINS-61760
Setting CloneOption trait on SCMSource with shallow depth causes MR builds to fail
Issue Type: Bug Bug
Assignee: Parichay Barpanda
Components: gitlab-branch-source-plugin
Created: 2020-03-31 19:42
Environment: Plugin version 1.4.4
Priority: Minor Minor
Reporter: Timothy Bell

Steps to reproduce:

On multibranch pipeline job, configure GitlabSCMSource with a clone option trait that has the shallow flag turned on.

CloneOption cloneOption = new CloneOption(true, true, "", 30);

Trigger a build of a merge request. 

 

Expected result:

Merge request should succeed.

 

Actual result:

Merge requests fails with error: 

stderr: fatal: refusing to merge unrelated histories

I believe this problem could be resolved by using MergeWithGitSCMExtension from the git-plugin class. The Github branch source plugin and the Bitbucket branch source plugin have both deprecated the instances of their class and use the one in the Git plugin. See https://github.com/jenkinsci/git-plugin/blob/5b3300dfb225927551b8b9b86efed7aa74100884/src/main/java/jenkins/plugins/git/MergeWithGitSCMExtension.java#L88

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

timothy.bell@liferay.com (JIRA)

unread,
Mar 31, 2020, 3:45:02 PM3/31/20
to jenkinsc...@googlegroups.com
Timothy Bell updated an issue
Change By: Timothy Bell
Steps to reproduce:

On multibranch pipeline job, configure GitlabSCMSource with a clone option trait that has the shallow flag turned on.
{code:java}

CloneOption cloneOption = new CloneOption(true, true, "", 30);
{code}

Trigger a build of a merge request. 

 

Expected result:

Merge request should succeed.

 

Actual result:

Merge requests fails with error: 
{code:java}
stderr: fatal: refusing to merge unrelated histories{code}
I believe this problem could be resolved by using
  {code} MergeWithGitSCMExtension {code} from the git-plugin class. The Github github- branch - source - plugin and the Bitbucket bitbucket- branch - source - plugin have both deprecated the their instances of their this class and in order to use the one in the Git plugin. See  [ https://github.com/jenkinsci/git-plugin/blob/5b3300dfb225927551b8b9b86efed7aa74100884/src/main/java/jenkins/plugins/git/MergeWithGitSCMExtension.java#L88 ]

timothy.bell@liferay.com (JIRA)

unread,
Mar 31, 2020, 3:46:02 PM3/31/20
to jenkinsc...@googlegroups.com
Timothy Bell updated an issue
Steps to reproduce:

On multibranch pipeline job, configure GitlabSCMSource with a clone option trait that has the shallow flag turned on.
{code:java}
CloneOption cloneOption = new CloneOption(true, true, "", 30);
{code}
Trigger a build of a merge request. 

 

Expected result:

Merge request should succeed.

 

Actual result:

Merge requests fails with error: 
{code:java}
stderr: fatal: refusing to merge unrelated histories{code}
I believe this problem could be resolved by using {code}MergeWithGitSCMExtension{code} from the git-plugin class. The github-branch-source-plugin and the bitbucket-branch-source-plugin have both deprecated their instances of this class in order to use the one in the Git plugin. See [https://github.com/jenkinsci/git-plugin/blob/5b3300dfb225927551b8b9b86efed7aa74100884/src/main/java/jenkins/plugins/git/MergeWithGitSCMExtension.java#L88]

For now, our workaround is to set the shallow flag to false, which impacts all builds with Gitlab. We'd like to only set shallow to false when building MRs.

parichay.barpanda@gmail.com (JIRA)

unread,
Apr 3, 2020, 6:00:02 PM4/3/20
to jenkinsc...@googlegroups.com
Parichay Barpanda started work on Bug JENKINS-61760
 
Change By: Parichay Barpanda
Status: Open In Progress

parichay.barpanda@gmail.com (JIRA)

unread,
Apr 4, 2020, 6:08:03 AM4/4/20
to jenkinsc...@googlegroups.com

parichay.barpanda@gmail.com (JIRA)

unread,
Apr 4, 2020, 6:08:03 AM4/4/20
to jenkinsc...@googlegroups.com

parichay.barpanda@gmail.com (JIRA)

unread,
Apr 25, 2020, 1:05:02 AM4/25/20
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages