Does Jenkins Webhook work with forked repositories?

We have a stash repo "myrepo" and a fork "myrepofork" with a pull request of changes to be brought back to "myrepo".  The change in "myrepofork" has changeset 328a334d194 and as far as I can tell Jenkins is told to build that changeset, but not that the changeset is to be found in "myrepofork".

Is this supposed to work? Do I need to configure things differently? Or do I need to give my teams access to write branches into the official repository and create pull requests from there?

Jenkins job console snippet:

00:00:01.089  > git rev-parse 328a334d19468ee9bf569de72fdf8a14abc5dcd4^{commit} # timeout=10
00:00:01.099 FATAL: Command "git rev-parse 328a334d19468ee9bf569de72fdf8a14abc5dcd4^{commit}" returned status code 128:
00:00:01.099 stdout: 328a334d19468ee9bf569de72fdf8a14abc5dcd4^{commit}
00:00:01.099 
00:00:01.099 stderr: fatal: ambiguous argument '328a334d19468ee9bf569de72fdf8a14abc5dcd4^{commit}': unknown revision or path not in the working tree.
00:00:01.099 Use '--' to separate paths from revisions
00:00:01.099 
00:00:01.099 hudson.plugins.git.GitException: Command "git rev-parse 328a334d19468ee9bf569de72fdf8a14abc5dcd4^{commit}" returned status code 128:
00:00:01.099 stdout: 328a334d19468ee9bf569de72fdf8a14abc5dcd4^{commit}
00:00:01.099 
00:00:01.099 stderr: fatal: ambiguous argument '328a334d19468ee9bf569de72fdf8a14abc5dcd4^{commit}': unknown revision or path not in the working tree.
00:00:01.099 Use '--' to separate paths from revisions

 

 

1 answer

No it is not suppose to work. You will need a Jenkins job for repo "myrepofork".

You could poll the REST API:s of Stash to find new pull requests. Then you can have a parameterized build job in Jenkins that builds pull requests. So that you dont need to create new build jobs for every new fork, just one job that builds pull requests from any repo.

Find all repos: http://stash/rest/api/1.0/projects/EXP/repos/

Find all pull requests: http://stash/rest/api/1.0/projects/EXP/repos/REPOSLUG/pull-requests?base&details&filterText&orderBy


 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

197 views 3 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you