-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Powered by SuggestiMate -
Blue Ocean - Candidates
Problem
Non-multibranch pipelines do not have any changeset information
Steps to reproduce
- Create a Pipeline using the Jenkinsfile below
- Run the Pipeline
- There is no revision information
Jenkinsfile
node { stage('checkout') { checkout([$class: 'SubversionSCM', locations: [[local: '.', remote: 'http://svn.apache.org/repos/asf/poi/trunk/sonar/']], workspaceUpdater: [$class: 'UpdateUpdater'] ]) } }
Original request
(See https://groups.google.com/forum/?utm_source=footer#!topic/jenkinsci-users/FwBdR0UB6Qc)
In BlueOcean (v1.2.0) pipeline activity view the column 'COMMIT' always only shows a '-' (dash):
- Is that okay or what should be shown there?
- Side note: it is a "Pipeline from SCM" using SVN.
Please note that in the 'Changes' tab the SVN commit is nicely listed with SVN commit ID and message though:
[JENKINS-46521] Non-multibranch pipelines do not have any changeset information
Sure. It is sufficient to create a Pipeline Job like this:
node { stage('checkout') { checkout([$class: 'SubversionSCM', locations: [[credentialsId: 'svn-server', local: '.', remote: 'http://svn.ACME.com/svn/<ANY FOLDER IN SVN>']], workspaceUpdater: [$class: 'UpdateUpdater'] ]) } }
Ad "what plugins are in use":
- Jenkins PluginManager API returns this XML:
<plugins> <shortName>metrics</shortName><version>3.1.2.10</version> <shortName>pipeline-model-api</shortName><version>1.1.9</version> <shortName>branch-api</shortName><version>2.0.11</version> <shortName>github-organization-folder</shortName><version>1.6</version> <shortName>pipeline-graph-analysis</shortName><version>1.5</version> <shortName>pipeline-stage-view</shortName><version>2.8</version> <shortName>icon-shim</shortName><version>2.0.3</version> <shortName>jquery-detached</shortName><version>1.2.1</version> <shortName>cloudbees-folder</shortName><version>6.1.2</version> <shortName>blueocean-jwt</shortName><version>1.2.0</version> <shortName>pipeline-build-step</shortName><version>2.5.1</version> <shortName>mapdb-api</shortName><version>1.0.9.0</version> <shortName>pipeline-stage-tags-metadata</shortName><version>1.1.9</version> <shortName>ssh-credentials</shortName><version>1.13</version> <shortName>structs</shortName><version>1.10</version> <shortName>xunit</shortName><version>1.102</version> <shortName>pipeline-github-lib</shortName><version>1.0</version> <shortName>resource-disposer</shortName><version>0.7</version> <shortName>display-url-api</shortName><version>2.0</version> <shortName>build-timeout</shortName><version>1.18</version> <shortName>blueocean-i18n</shortName><version>1.2.0</version> <shortName>blueocean-git-pipeline</shortName><version>1.2.0</version> <shortName>ant</shortName><version>1.7</version> <shortName>script-security</shortName><version>1.33</version> <shortName>blueocean-commons</shortName><version>1.2.0</version> <shortName>pubsub-light</shortName><version>1.12</version> <shortName>blueocean-config</shortName><version>1.2.0</version> <shortName>blueocean-display-url</shortName><version>2.1.0</version> <shortName>token-macro</shortName><version>2.2</version> <shortName>git</shortName><version>3.5.1</version> <shortName>ssh-slaves</shortName><version>1.21</version> <shortName>docker-workflow</shortName><version>1.12</version> <shortName>blueocean-pipeline-api-impl</shortName><version>1.2.0</version> <shortName>github-branch-source</shortName><version>2.2.3</version> <shortName>windows-slaves</shortName><version>1.3.1</version> <shortName>docker-commons</shortName><version>1.8</version> <shortName>email-ext</shortName><version>2.58</version> <shortName>pipeline-model-definition</shortName><version>1.1.9</version> <shortName>workflow-aggregator</shortName><version>2.5</version> <shortName>WebSVN2</shortName><version>0.9</version> <shortName>workflow-api</shortName><version>2.20</version> <shortName>workflow-multibranch</shortName><version>2.16</version> <shortName>workflow-job</shortName><version>2.14.1</version> <shortName>handlebars</shortName><version>1.1.1</version> <shortName>matrix-project</shortName><version>1.11</version> <shortName>git-client</shortName><version>2.5.0</version> <shortName>scm-api</shortName><version>2.2.1</version> <shortName>blueocean-personalization</shortName><version>1.2.0</version> <shortName>variant</shortName><version>1.1</version> <shortName>durable-task</shortName><version>1.14</version> <shortName>junit</shortName><version>1.21</version> <shortName>workflow-support</shortName><version>2.14</version> <shortName>credentials</shortName><version>2.1.14</version> <shortName>pipeline-rest-api</shortName><version>2.8</version> <shortName>plain-credentials</shortName><version>1.4</version> <shortName>blueocean-bitbucket-pipeline</shortName><version>1.2.0</version> <shortName>workflow-scm-step</shortName><version>2.6</version> <shortName>cloudbees-bitbucket-branch-source</shortName><version>2.2.3</version> <shortName>blueocean-events</shortName><version>1.2.0</version> <shortName>external-monitor-job</shortName><version>1.7</version> <shortName>blueocean-autofavorite</shortName><version>1.0.0</version> <shortName>jira</shortName><version>2.4.2</version> <shortName>workflow-step-api</shortName><version>2.12</version> <shortName>timestamper</shortName><version>1.8.8</version> <shortName>git-server</shortName><version>1.7</version> <shortName>antisamy-markup-formatter</shortName><version>1.5</version> <shortName>ws-cleanup</shortName><version>0.34</version> <shortName>htmlpublisher</shortName><version>1.14</version> <shortName>blueocean-dashboard</shortName><version>1.2.0</version> <shortName>blueocean-rest-impl</shortName><version>1.2.0</version> <shortName>ldap</shortName><version>1.16</version> <shortName>bouncycastle-api</shortName><version>2.16.2</version> <shortName>lockable-resources</shortName><version>2.0</version> <shortName>workflow-basic-steps</shortName><version>2.6</version> <shortName>workflow-cps-global-lib</shortName><version>2.8</version> <shortName>matrix-auth</shortName><version>1.7</version> <shortName>blueocean-github-pipeline</shortName><version>1.2.0</version> <shortName>github</shortName><version>1.28.0</version> <shortName>favorite</shortName><version>2.3.0</version> <shortName>pipeline-milestone-step</shortName><version>1.3.1</version> <shortName>ace-editor</shortName><version>1.1</version> <shortName>github-api</shortName><version>1.86</version> <shortName>blueocean-web</shortName><version>1.2.0</version> <shortName>credentials-binding</shortName><version>1.13</version> <shortName>workflow-cps</shortName><version>2.39</version> <shortName>ansicolor</shortName><version>0.5.2</version> <shortName>mailer</shortName><version>1.20</version> <shortName>pipeline-model-declarative-agent</shortName><version>1.1.1</version> <shortName>blueocean-pipeline-editor</shortName><version>1.2.0</version> <shortName>blueocean-pipeline-scm-api</shortName><version>1.2.0</version> <shortName>pam-auth</shortName><version>1.3</version> <shortName>pipeline-input-step</shortName><version>2.8</version> <shortName>authentication-tokens</shortName><version>1.3</version> <shortName>jackson2-api</shortName><version>2.7.3</version> <shortName>momentjs</shortName><version>1.1.1</version> <shortName>workflow-durable-task-step</shortName><version>2.14</version> <shortName>blueocean-rest</shortName><version>1.2.0</version> <shortName>blueocean</shortName><version>1.2.0</version> <shortName>mercurial</shortName><version>2.1</version> <shortName>pipeline-stage-step</shortName><version>2.2</version> <shortName>sse-gateway</shortName><version>1.15</version> <shortName>subversion</shortName><version>2.9</version> <shortName>pipeline-model-extensions</shortName><version>1.1.9</version> <shortName>gradle</shortName><version>1.27.1</version> <shortName>javadoc</shortName><version>1.4</version> </plugins>
+1, We're seeing the same issue in our Jenkins instance. Standard views show commit information, but Blue Ocean shows a hyphen for commit and branch being built.
reinholdfuereder thanks for bringing this to my attention. Unfortunately this seems to be an issue with other SCMs too (I'm using p4-plugin).
Blueocean just renders whatever the other scm providers ... provide
So If, and I mean if, i'm reading p4 correctly, it should have it set https://github.com/jenkinsci/p4-plugin/blob/d9a96a4c4d1d72de188e9470ebaad68202a7aa72/src/main/java/org/jenkinsci/plugins/p4/changes/P4ChangeEntry.java#L343-L346
Feel free to zip up a job (only probably need 1 builds), or give me a sample scm url i can try it with, and I'll try to run it through the debugger to look more into it, but I'm 90% certain its the scm provider not blueocean.
Looks like blueocean pulls the commit id from the run, using the SCMRevisionAction, which at least svn doesn't seem to populate.
stephenconnolly jglick looks like you worked on SCMRevisionAction, is that the right way to pull commit info for a run? it looks like its only implemented in workflow-multibranch-plugin, literate-plugin and yaml-project-plugin. Are other scm providers supposed to implement this?
SCMRevisionAction is specific to multibranch builds and represents the one commit which the multibranch folder is tracking and from which Jenkinsfile etc. are taken—what checkout scm would check out. If you have a non-multibranch project, including freestyle as well as Pipeline, or even want to account for SCM information from other checkout (incl. git) steps used in a multibranch build, you can use RunWithSCM.getChangeSets and ChangeLogSet.Entry.getCommitId.
To be clear, RunWithSCM.getChangeSets should represent the complete changelog for this build, including whatever commits might be included in the diff of SCMRevisionAction from the previous build to this one, assuming checkout scm was run at least once. From a technical perspective, this issue is not a bug at all—the changelog is displayed if there is any (which there would not be for e.g. build #1 or if you just retriggered a build manually); and the unique commit ID is displayed if there is any (which there would not be for a non-multibranch build, since these may check out zero or more repositories in various revisions according to whim). It is just a design decision what sorts of metadata you wish to display in builds under various circumstances that you think would best match user expectations.
Hrm. And that that brings up another point, pipelines can have multiple scms hooked up to it (multiple git repos, git and svn, what have you)....
Maybe its better just to hide the column if its not a multi branch pipeline.
Thanks for the insider/background information (and the hint in JENKINS-44869):
- well, yes, actually I (therefore) have the commit ID (SVN revision or shortened GIT commit hash) as suffix of my therefore quite long build display number, e.g. "20170613-161100-rev134098" (i.e. "<date>-<time>-rev<SVN revision>")
- and thus hiding the "Commit" column for a non-multi branch pipeline in favour of showing the full build display number in the BO's activity tab "Run" id column (see JENKINS-44869) would be ideal/fine for me
reinholdfuereder would you be able to create a test job that demonstrates this problem, zip it up and attach here?
It would be also good to get a support core bundle so we know what plugins you are using.