-
Bug
-
Resolution: Unresolved
-
Major
-
Jenkins 2.88
Git Plugin 3.6.4
We have "aggregate" repositories which pool a number of remotes into a single repo, allowing them to be tested with a single Jenkins job.
eg.
development ../../development/project.git
upstream ../../mirror/project.git
personal ../../personal/project.git
Using the patches from Jenkins 33445, these appear in Jenkins as <remote>/<branch>
eg.
development/master
development/feature
upstream/master
upstream/release-1
personal/feature
We are trying to migrate away from the non-upstreamed code in Jenkins 33445, but cannot access the referenced repos via the aggregate repository. To do this, I have tried specifying the custom refspec
+refs/remotes/*:refs/remotes/*
> git ls-remote -h -t git://gitlab.ozlabs.ibm.com/aggregate/skiboot.git # timeout=30
Checking branches...
Processed 0 branches
First up, the '-h' switch restricts the list to only
'refs/heads/*'
, while the branches we care about are in
'refs/remotes/*'
. Removing these switches (by setting the args to getRemoteReferences()) get us a little further, but it still shows "Processed 0 branches".
Digging a bit further, it looks like we make the assumption that a branch is prefixed with Constants.R_HEADS in a number of places. We may be better off storing the path as well as the name in SCMHead instead, and not trying to construct path.
We have a partial workaround in that we can specify multiple branch sources, but we do lose the repo prefix, so development/feature and personal/feature collide as 'feature'.
I think that your use case is unique enough (combining multiple repositories into a single repository at the git repo, rather than in the Jenkins job), that you'll need to plan to use the git plugin API's traits facilities to create a custom plugin which supports your use case.
stephenc provided some good guidance for others as they have started creating the tag discovery plugin(s). I've referenced him on this comment in case he can point you to those same suggestions.