-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
gerrit-plugin-1.1.0
jenkins-2.89.4
-
-
gerrit-code-review-0.2
It seems that by default multibranch-pipeline and git-review setup does not discover any branches in gerrit projects, even after adding "Filter by name (with wildcards)" with defaults settings (include *, exclude: <empty string>) — which seems to have no effect.
Once we add "Discover open changes" to the config, Jenkins starts to discover open branches on gerrit....but detection seems to be buggy because I see some failures in the logs:
Started [Thu Feb 22 12:15:18 GMT 2018] Starting branch indexing... > git rev-parse --is-inside-work-tree # timeout=10 Setting origin to https://review.gerrithub.io/pycontribs/powertape > git config remote.origin.url https://review.gerrithub.io/pycontribs/powertape # timeout=10 Fetching origin... Fetching upstream changes from origin > git --version # timeout=10 > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* > git rev-parse --is-inside-work-tree # timeout=10 Setting origin to https://review.gerrithub.io/pycontribs/powertape > git config remote.origin.url https://review.gerrithub.io/pycontribs/powertape # timeout=10 Fetching & pruning origin... Fetching upstream changes from origin > git --version # timeout=10 > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune Listing remote references... > git config --get remote.origin.url # timeout=10 > git ls-remote https://review.gerrithub.io/pycontribs/powertape # timeout=10 Checking branches ... {HEAD=AnyObjectId[781eddd780bf4fcb9099f6e650052ea2da059e3b], refs/heads/bad-change=AnyObjectId[8219cfefc52a55204adf7171bce188ebfa686b7b], refs/changes/12/391412/1=AnyObjectId[f6756e7b468955fbdbcd3b804457ab4497e27ac1], refs/heads/master=AnyObjectId[781eddd780bf4fcb9099f6e650052ea2da059e3b], refs/notes/review=AnyObjectId[5d428360fcd2fbc04d7deb36a2e473c24ad0a04b], refs/changes/82/391282/1=AnyObjectId[9f94b2b72cfd8e81716719f406daede9938b1f1f]} Filtered branches ... {HEAD=AnyObjectId[781eddd780bf4fcb9099f6e650052ea2da059e3b], refs/heads/bad-change=AnyObjectId[8219cfefc52a55204adf7171bce188ebfa686b7b], refs/changes/12/391412/1=AnyObjectId[f6756e7b468955fbdbcd3b804457ab4497e27ac1], refs/heads/master=AnyObjectId[781eddd780bf4fcb9099f6e650052ea2da059e3b], refs/notes/review=AnyObjectId[5d428360fcd2fbc04d7deb36a2e473c24ad0a04b], refs/changes/82/391282/1=AnyObjectId[9f94b2b72cfd8e81716719f406daede9938b1f1f]} Skipping branches HEAD Checking branch bad-change ‘Jenkinsfile’ found Met criteria Scheduled build for branch: bad-change Checking branch master ‘Jenkinsfile’ found Met criteria Scheduled build for branch: master Skipping branches refs/notes/review Checking change 82/391282/1 ERROR: [Thu Feb 22 12:15:21 GMT 2018] Could not fetch branches from source 35cf7e56-e8f8-4fe5-8016-e5fd4bce0575 org.eclipse.jgit.errors.MissingObjectException: Missing unknown 9f94b2b72cfd8e81716719f406daede9938b1f1f at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:158) at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:227) at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:859) at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:772) at jenkins.plugins.gerrit.AbstractGerritSCMSource$8.create(AbstractGerritSCMSource.java:343) at jenkins.plugins.gerrit.AbstractGerritSCMSource$8.create(AbstractGerritSCMSource.java:337) at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:341) at jenkins.plugins.gerrit.AbstractGerritSCMSource.processChangeRequest(AbstractGerritSCMSource.java:327) at jenkins.plugins.gerrit.AbstractGerritSCMSource.access$300(AbstractGerritSCMSource.java:59) at jenkins.plugins.gerrit.AbstractGerritSCMSource$1.discoverBranches(AbstractGerritSCMSource.java:136) at jenkins.plugins.gerrit.AbstractGerritSCMSource$1.run(AbstractGerritSCMSource.java:98) at jenkins.plugins.gerrit.AbstractGerritSCMSource$1.run(AbstractGerritSCMSource.java:82) at jenkins.plugins.gerrit.AbstractGerritSCMSource.doRetrieve(AbstractGerritSCMSource.java:497) at jenkins.plugins.gerrit.AbstractGerritSCMSource.retrieve(AbstractGerritSCMSource.java:81) at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:355) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:265) at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:631) at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:276) at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165) at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1022) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) [Thu Feb 22 12:15:21 GMT 2018] Finished branch indexing. Indexing took 3 sec FATAL: Failed to recompute children of test-jjb-multibranch-gerrit-http-ano org.eclipse.jgit.errors.MissingObjectException: Missing unknown 9f94b2b72cfd8e81716719f406daede9938b1f1f at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:158) at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:227) at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:859) at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:772) at jenkins.plugins.gerrit.AbstractGerritSCMSource$8.create(AbstractGerritSCMSource.java:343) at jenkins.plugins.gerrit.AbstractGerritSCMSource$8.create(AbstractGerritSCMSource.java:337) at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:341) at jenkins.plugins.gerrit.AbstractGerritSCMSource.processChangeRequest(AbstractGerritSCMSource.java:327) at jenkins.plugins.gerrit.AbstractGerritSCMSource.access$300(AbstractGerritSCMSource.java:59) at jenkins.plugins.gerrit.AbstractGerritSCMSource$1.discoverBranches(AbstractGerritSCMSource.java:136) at jenkins.plugins.gerrit.AbstractGerritSCMSource$1.run(AbstractGerritSCMSource.java:98) at jenkins.plugins.gerrit.AbstractGerritSCMSource$1.run(AbstractGerritSCMSource.java:82) at jenkins.plugins.gerrit.AbstractGerritSCMSource.doRetrieve(AbstractGerritSCMSource.java:497) at jenkins.plugins.gerrit.AbstractGerritSCMSource.retrieve(AbstractGerritSCMSource.java:81) at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:355) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:265) at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:631) at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:276) at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165) at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1022) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Finished: FAILURE
The sample project I used for testing is https://review.gerrithub.io/pycontribs/powertape (configured with the same URL.).
A Jenkins instance with test jobs already configured is accessible at https://j.sbarnea.com/job/test-jjb-multibranch-gerrit-http-ano/configure – If you need access to it just mention your github login in a comment.