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

gerrit trigger git summary show refspec instead of branch

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When you have multiple git projects in a pipeline build, multiple git summary bits appear in the build information when you highlight the build. These currently show something like

      <git image> Revision: <sha1id of checked out source>

      • a built branch
      • another built branch

      When using the gerrit trigger plugin, the "built branches" only show the name of the branch from $GERRIT_BRANCH, instead of showing a refspec. Ideally when using these together, we should see the refspec instead of the branch because this is really what was built by the job.

        Attachments

          Activity

          Hide
          jekeller Jacob Keller added a comment -

          I disagree with the removal of git-plugin and git-client-plugin as I believe that it probably requires a change in more than just the gerrit-trigger-plugin..

          Show
          jekeller Jacob Keller added a comment - I disagree with the removal of git-plugin and git-client-plugin as I believe that it probably requires a change in more than just the gerrit-trigger-plugin..
          Hide
          jekeller Jacob Keller added a comment -

          https://github.com/jenkinsci/gerrit-trigger-plugin/pull/299

          It turns out this is a relatively simple change in the GerritTriggerBuildChooser. I proposed a pull request with this change to gerrit-trigger-plugin.

          Show
          jekeller Jacob Keller added a comment - https://github.com/jenkinsci/gerrit-trigger-plugin/pull/299 It turns out this is a relatively simple change in the GerritTriggerBuildChooser. I proposed a pull request with this change to gerrit-trigger-plugin.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jacob Keller
          Path:
          src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritTriggerBuildChooser.java
          src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritTriggerBuildChooserTest.java
          http://jenkins-ci.org/commit/gerrit-trigger-plugin/89eca5e009a302ffa76889583e9f9a39b39a69d1
          Log:
          JENKINS-38675 use refspec instead of branch name for the revision

          Add support to the GerritTriggerBuildChooser enabling it to report the
          gerrit change refspec instead of simply reporting the branch this change
          is destined to. This improves readability of the resulting changelog
          entry on the Jenkins build page, as the user can see exactly which ref
          was built.

          To do so, we need to not only ask for the revision, but the refname. Add
          a context callback in order to determine in a similar way as we do the
          revision. Although it might be possible to replace the revision handling
          to use git.revParse() on the refname instead, this may not be as
          accurate as the change event, so we leave this in place.

          The result of this change is that we should see something like:

          Revision: <sha1id>
          refs/changes/x/xxxx/x

          Instead of

          Revision: <sha1id>
          master

          The resulting display is easier to understand and more accurately
          points out the refname that got built.

          Add a test to ensure that this behaves as expected. The current test can
          probably be improved as it relies heavily on mock objects and does not
          actually generate a trigger event or anything of that sort.

          Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jacob Keller Path: src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritTriggerBuildChooser.java src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritTriggerBuildChooserTest.java http://jenkins-ci.org/commit/gerrit-trigger-plugin/89eca5e009a302ffa76889583e9f9a39b39a69d1 Log: JENKINS-38675 use refspec instead of branch name for the revision Add support to the GerritTriggerBuildChooser enabling it to report the gerrit change refspec instead of simply reporting the branch this change is destined to. This improves readability of the resulting changelog entry on the Jenkins build page, as the user can see exactly which ref was built. To do so, we need to not only ask for the revision, but the refname. Add a context callback in order to determine in a similar way as we do the revision. Although it might be possible to replace the revision handling to use git.revParse() on the refname instead, this may not be as accurate as the change event, so we leave this in place. The result of this change is that we should see something like: Revision: <sha1id> refs/changes/x/xxxx/x Instead of Revision: <sha1id> master The resulting display is easier to understand and more accurately points out the refname that got built. Add a test to ensure that this behaves as expected. The current test can probably be improved as it relies heavily on mock objects and does not actually generate a trigger event or anything of that sort. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Robert Sandell
          Path:
          src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritTriggerBuildChooser.java
          src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritTriggerBuildChooserTest.java
          http://jenkins-ci.org/commit/gerrit-trigger-plugin/670fbe2cadd7c9596d3b023db4a61d0fc982a08a
          Log:
          Merge pull request #299 from jacob-keller/jk/gerrit-revision-show-refspec

          JENKINS-38675 use refspec instead of branch name for the revision

          Compare: https://github.com/jenkinsci/gerrit-trigger-plugin/compare/2cb758a4c2bd...670fbe2cadd7

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Robert Sandell Path: src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritTriggerBuildChooser.java src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritTriggerBuildChooserTest.java http://jenkins-ci.org/commit/gerrit-trigger-plugin/670fbe2cadd7c9596d3b023db4a61d0fc982a08a Log: Merge pull request #299 from jacob-keller/jk/gerrit-revision-show-refspec JENKINS-38675 use refspec instead of branch name for the revision Compare: https://github.com/jenkinsci/gerrit-trigger-plugin/compare/2cb758a4c2bd...670fbe2cadd7

            People

            • Assignee:
              rsandell rsandell
              Reporter:
              jekeller Jacob Keller
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: