[JIRA] (JENKINS-50433) unable to load shared library from gerrit pull request branch

0 views
Skip to first unread message

sorin.sbarnea@gmail.com (JIRA)

unread,
Mar 27, 2018, 9:57:02 AM3/27/18
to jenkinsc...@googlegroups.com
Sorin Sbarnea created an issue
 
Jenkins / Task JENKINS-50433
unable to load shared library from gerrit pull request branch
Issue Type: Task Task
Assignee: Unassigned
Components: workflow-cps-global-lib-plugin
Created: 2018-03-27 13:56
Priority: Minor Minor
Reporter: Sorin Sbarnea

It seems that is not possible to load a shared library from a CRs gerrit branch, mostly because current GitSCMSource plugin fails to see gerrit branches, and tuning the rawRefSpecs parameter seems to have no effect on it.

 

library identifier: 'temp-lib@master', retriever: modernSCM(
[$class: 'GitSCMSource',
    remote: 'https://review.gerrithub.io/rhos-infra/foobar',
    excludes: '',
    includes: '*',
    rawRefSpecs: '+refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/remotes/origin/tags/* +refs/changes/*:refs/remotes/changes/*'
])

Example of using git ls-remote on gerrit repository:

 

 

git ls-remote git ls-remote https://review.gerrithub.io/rhos-infra/foobar
558aca4bf8d2eb357caa72292abb94b3b87cc41f HEAD
a6b8fced01ebdd09930ff75768d3c437567e2f81 refs/changes/78/386678/1
ad71ed9c8a225eb11531322ef928b89ca74eba5e refs/changes/82/386682/1
73969f31bbc57a53b903b3c16ade1b991cbf11f7 refs/changes/82/386682/2
cd404f64f7840bf2d92a830186159c809ff2450e refs/changes/84/386684/1
f05cf74695e6c5731ccbeb5d98de113031ff0c70 refs/changes/84/386684/2
65e65cae35fc55779db0afe56e9bd28554e5c074 refs/changes/85/386685/1
c96845ab149d8f1908f46ad279088e4fb1a77dae refs/changes/85/386685/2
89fbd1f054b2d1f3d0c417235b0e37299a36c078 refs/changes/85/386685/3
558aca4bf8d2eb357caa72292abb94b3b87cc41f refs/heads/master

As you can see, ls-remote is able to detect gerrit branches without problems. Still, I we check the console log of the job, we will find that Jenkins is trying to perform a "git ls-remote -t -h ..." which is filtering out the remote branches that we are interested about.

I was not able to find any option to tell it not to do this.

 

 

 

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

sorin.sbarnea@gmail.com (JIRA)

unread,
Mar 27, 2018, 10:07:02 AM3/27/18
to jenkinsc...@googlegroups.com

sorin.sbarnea@gmail.com (JIRA)

unread,
Mar 27, 2018, 10:08:03 AM3/27/18
to jenkinsc...@googlegroups.com
Sorin Sbarnea updated an issue
It seems that is not possible to load a shared library from a CRs gerrit branch, mostly because current *GitSCMSource* plugin fails to see gerrit branches, and tuning the rawRefSpecs parameter seems to have no effect on it.

 
{code:java}

library identifier: 'temp-lib@master', retriever: modernSCM(
[$class: 'GitSCMSource',
    remote: 'https://review.gerrithub.io/rhos-infra/foobar',
    excludes: '',
    includes: '*',
    rawRefSpecs: '+refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/remotes/origin/tags/* +refs/changes/*:refs/remotes/changes/*'
])
{code}

Example of using git ls-remote on gerrit repository:

 

 
{code:java}
git ls-remote
git ls-remote https://review.gerrithub.io/rhos-infra/foobar

558aca4bf8d2eb357caa72292abb94b3b87cc41f HEAD
a6b8fced01ebdd09930ff75768d3c437567e2f81 refs/changes/78/386678/1
ad71ed9c8a225eb11531322ef928b89ca74eba5e refs/changes/82/386682/1
73969f31bbc57a53b903b3c16ade1b991cbf11f7 refs/changes/82/386682/2
cd404f64f7840bf2d92a830186159c809ff2450e refs/changes/84/386684/1
f05cf74695e6c5731ccbeb5d98de113031ff0c70 refs/changes/84/386684/2
65e65cae35fc55779db0afe56e9bd28554e5c074 refs/changes/85/386685/1
c96845ab149d8f1908f46ad279088e4fb1a77dae refs/changes/85/386685/2
89fbd1f054b2d1f3d0c417235b0e37299a36c078 refs/changes/85/386685/3
558aca4bf8d2eb357caa72292abb94b3b87cc41f refs/heads/master
{code}

As you can see, ls-remote is able to detect gerrit branches without problems. Still, I we check the console log of the job, we will find that Jenkins is trying to perform a "git ls-remote -t -h ..." which is filtering out the remote branches that we are interested about.

I was not able to find any option to tell it not to do this.

 

 

 

sorin.sbarnea@gmail.com (JIRA)

unread,
Mar 27, 2018, 10:15:02 AM3/27/18
to jenkinsc...@googlegroups.com
Sorin Sbarnea updated an issue
Change By: Sorin Sbarnea
Environment: git-3.7.0
jenkins-2.89 (LTS)

myselfasunder@gmail.com (JIRA)

unread,
Jul 23, 2018, 2:24:01 PM7/23/18
to jenkinsc...@googlegroups.com
This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

takomyr@gmail.com (JIRA)

unread,
May 7, 2019, 5:37:02 AM5/7/19
to jenkinsc...@googlegroups.com
Taras Kostyuk updated an issue
 
Change By: Taras Kostyuk
Attachment: Screen Shot 2019-05-07 at 12.35.44.png
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

takomyr@gmail.com (JIRA)

unread,
May 7, 2019, 5:44:02 AM5/7/19
to jenkinsc...@googlegroups.com
Taras Kostyuk commented on Task JENKINS-50433
 
Re: unable to load shared library from gerrit pull request branch

Setting additional cloning behavior in Manage Jenkins -> Configure system for the shared library like

 

allows to get the library loaded by adding

def lib = library("egp-cicd@${LIB_GERRIT_REFSPEC}"

to the pipeline where LIB_GERRIT_REFSPEC is like refs/changes/78/386678/1

sorin.sbarnea@gmail.com (JIRA)

unread,
May 7, 2019, 11:04:03 AM5/7/19
to jenkinsc...@googlegroups.com
Sorin Sbarnea updated Task JENKINS-50433
 

Closing as I am no longer using jenkins so I cannot reproduce it (or the fix)

Change By: Sorin Sbarnea
Status: Open Fixed but Unreleased
Resolution: Cannot Reproduce

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

unread,
Apr 4, 2020, 8:42:04 PM4/4/20
to jenkinsc...@googlegroups.com
Change By: Mark Waite
Status: Fixed but Unreleased Closed
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages