[JIRA] (JENKINS-48295) Cannot load a pipeline shared library from Bitbucket PR with cloudbees-bitbucket-branch-source 2.2.7

287 views
Skip to first unread message

robin.smith@forgerock.com (JIRA)

unread,
Feb 26, 2018, 7:59:02 AM2/26/18
to jenkinsc...@googlegroups.com
Robin Smith updated an issue
 
Jenkins / Bug JENKINS-48295
Cannot load a pipeline shared library from Bitbucket PR with cloudbees-bitbucket-branch-source 2.2.7
Change By: Robin Smith
After upgrading the the cloudbees-bitbucket-branch-source plugin from 2.1.2 to 2.2.7, loading a pipeline shared library from a pull request no longer works

Before the upgrade, it was possible to access and test code in a PR by appending the following refspec to the global shared library configuration:
{code:java}
+refs/pull-requests/*/from:refs/remotes/origin/pr/*
{code}
(as suggested in this guide to [fetching Bitbucket pull requests|https://www.atlassian.com/blog/archives/how-to-fetch-pull-requests]). Using this refspec would allow a developer's PR to be tested using a syntax such as:
{code:java}
@Library('pipeline-libs@pr/28')   // '28' is the PR ID
{code}

Since updating the plugin to 2.2.7, this approach is no longer possible, so it is not possible to access a developer's shared library changes from Jenkins before merging the PR.

This is the output from Jenkins:
{code
:java }
Loading library pipeline-libs@pr/28
Attempting to resolve pr/28 from remote references...
> git --version # timeout=10
using GIT_SSH to set credentials Jenkins public key
> git ls-remote -h -t ssh://g...@stash.forgerock.org:7999/re/jenkins-pipeline-libs.git # timeout=10
Could not find pr/28 in remote references. Pulling heads to local for deep search...
> git rev-parse --is-inside-work-tree # timeout=10
Setting origin to ssh://g...@stash.forgerock.org:7999/re/jenkins-pipeline-libs.git
> git config remote.origin.url ssh://g...@stash.forgerock.org:7999/re/jenkins-pipeline-libs.git # timeout=10
Fetching origin...
Fetching upstream changes from origin
> git --version # timeout=10
using GIT_SSH to set credentials Jenkins public key
> git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* +refs/pull-requests/*/from:refs/remotes/origin/pr/*
> git rev-parse pr/28^{commit} # timeout=10
> git branch -v --no-abbrev --contains 36750e665cd8155d02b73d339e41ee5cd374599a # timeout=10
Could not find a branch containing commit 36750e665cd8155d02b73d339e41ee5cd374599a
ERROR: No version pr/28 found for library pipeline-libs
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 0s
[Bitbucket] Notifying commit build result
[Bitbucket] Build result notified
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: Loading libraries failed
{code}

It seems the commit I wish to test (36750e665cd8155d02b73d339e41ee5cd374599a) is correctly identified from the refspec, but no branch exists for this commit (since it is in a PR only) so the job is failing.

Similar issues exist have been resolved for the GitHub branch source plugin - JENKINS-45953 and JENKINS-45830
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

takomyr@gmail.com (JIRA)

unread,
May 10, 2019, 4:22:03 AM5/10/19
to jenkinsc...@googlegroups.com
Change By: Taras Kostyuk
Resolution: Not A Defect
Status: Closed Reopened
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

takomyr@gmail.com (JIRA)

unread,
May 10, 2019, 4:26:03 AM5/10/19
to jenkinsc...@googlegroups.com
Taras Kostyuk edited a comment on Bug JENKINS-48295
 
Re: Cannot load a pipeline shared library from Bitbucket PR with cloudbees-bitbucket-branch-source 2.2.7
[3.9.1 and 3.10.0 are affected by the issue.
|https://jenkins2.unifieddeliverynetwork.net/pluginManager/plugin/git/thirdPartyLicenses]
{noformat}
[Pipeline] Start of Pipeline
[Pipeline] timestamps
[Pipeline] {
[Pipeline] library
04:21:04  Loading library pipeline-demo@refs/changes/06/24906/2
04:21:04  Attempting to resolve refs/changes/06/24906/2 from remote references...
04:21:04   > git --version # timeout=10
04:21:04  using GIT_SSH to set credentials
04:21:04   > git ls-remote -h ssh://jenk...@review.unifieddeliverynetwork.net:29418/pipeline-demo # timeout=10
04:21:04  Could not find refs/changes/06/24906/2 in remote references. Pulling heads to local for deep search...
04:21:04   > git rev-parse --is-inside-work-tree # timeout=10
04:21:04  Setting origin to ssh://jenk...@review.unifieddeliverynetwork.net:29418/pipeline-demo
04:21:04   > git config remote.origin.url ssh://jenk...@review.unifieddeliverynetwork.net:29418/pipeline-demo # timeout=10
04:21:04  Fetching origin...
04:21:04  Fetching upstream changes from origin
04:21:04   > git --version # timeout=10
04:21:04   > git config --get remote.origin.url # timeout=10
04:21:04  using GIT_SSH to set credentials
04:21:04   > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* +refs/changes/*:refs/changes/* # timeout=10
04:21:04   > git rev-parse refs/changes/06/24906/2^{commit} # timeout=10
04:21:04   > git branch -a -v --no-abbrev --contains 3e06cc6f676b664ec907cf926bed44e37710f133 # timeout=10
04:21:04  Could not find a branch containing commit 3e06cc6f676b664ec907cf926bed44e37710f133 {noformat}
[|https://jenkins2.unifieddeliverynetwork.net/pluginManager/plugin/git/thirdPartyLicenses]

takomyr@gmail.com (JIRA)

unread,
May 10, 2019, 4:26:04 AM5/10/19
to jenkinsc...@googlegroups.com

takomyr@gmail.com (JIRA)

unread,
May 10, 2019, 5:46:02 AM5/10/19
to jenkinsc...@googlegroups.com

takomyr@gmail.com (JIRA)

unread,
May 10, 2019, 5:46:03 AM5/10/19
to jenkinsc...@googlegroups.com
Taras Kostyuk commented on Bug JENKINS-48295
 
Re: Cannot load a pipeline shared library from Bitbucket PR with cloudbees-bitbucket-branch-source 2.2.7

The following configuration in Mange Jenkins ->Configure system fixed the issue

takomyr@gmail.com (JIRA)

unread,
May 10, 2019, 5:48:02 AM5/10/19
to jenkinsc...@googlegroups.com
Taras Kostyuk closed an issue as Fixed
 

the shared library was't properly configured

Change By: Taras Kostyuk
Status: Reopened Closed
Resolution: Fixed
Reply all
Reply to author
Forward
0 new messages