Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-65433

Gerrit Multibranch Pipeline fails branch indexing when an change has an unpublished revision

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • gerrit 2.13.12,
      Jenkins 2.277.2
      Gerrit Code Review Plugin 0.4.4

      In my project on gerrit I have a change that I started editing with the online interface but which I didn't publish yet (see [1]). In Jenkins I configured a "Multi-branch Pipeline" project that uses Gerrit as Branch source.

      When the Jenkins project starts scanning it fails with an exception that hits [2]. The exception is caused by the fact that there is no revision in the list of revisions. Indeed if I query the gerrit REST endpoint with curl I see that for the specific change the "revisions" property is an empty dictionary, while for all the other changes it is a dictionary with exactly one entry.

      When I hit "publish" in the Gerrit web interface the problem goes away.

      I think the code in AbstractGerritSCMSource.java should be adapted to handle the case in which no revision is present and just skip the change because otherwise the Jenkins project will not detect new branches until all the unpublished changes are published.

      [1] https://gerrit-review.googlesource.com/Documentation/user-inline-edit.html#editing-change

      [2] https://github.com/jenkinsci/gerrit-code-review-plugin/blob/master/src/main/java/jenkins/plugins/gerrit/AbstractGerritSCMSource.java#L685

            lucamilanesio Luca Domenico Milanesio
            lokeller Lorenzo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: