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

Log / document the plugin usage in the flow nodes

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Jenkins adds the plugin names and versions to the XML configuration, e.g. like plugin="groovy@1.27". Analyzing config.xml files it is possible to see what pluins are used by a job.

      With workflow this is not possible, since the information what plugin is used, is in the script file. It is probably difficult to analyze the script statically and extract plugin information.

      However, when a script is executed, workflow has the needed information. The steps are already logged to builds/<job-id>/workflow/<step-id>.xml.

      For a git checkout, via the generic SCM API it logs:

      <?xml version='1.0' encoding='UTF-8'?>
      <org.jenkinsci.plugins.workflow.support.storage.SimpleXStreamFlowNodeStorage_-Tag plugin="workflow-support@1.11">
        <node class="org.jenkinsci.plugins.workflow.cps.nodes.StepAtomNode" plugin="workflow-cps@1.11">
          <parents class="com.google.common.collect.ImmutableList">
            <org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode>5</org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode>
          </parents>
          <id>6</id>
          <descriptorId>org.jenkinsci.plugins.workflow.steps.scm.GenericSCMStep</descriptorId>
        </node>
      ...
      

      Improvement:

      Each step node contains also the used plugin(s) and version. In the above case it needs to log workflow-scm-step and git.

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            pom.xml
            src/main/java/org/jenkinsci/plugins/workflow/actions/ArgumentsAction.java
            http://jenkins-ci.org/commit/workflow-api-plugin/f105670fc62c365da3fc4ea0fda21a80253d511f
            Log:
            Merge pull request #44 from jglick/ArgumentsAction.getResolvedArguments-JENKINS-31582

            JENKINS-31582 ArgumentsAction.getResolvedArguments

            Compare: https://github.com/jenkinsci/workflow-api-plugin/compare/78744ae7045c...f105670fc62c

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/org/jenkinsci/plugins/workflow/actions/ArgumentsAction.java http://jenkins-ci.org/commit/workflow-api-plugin/f105670fc62c365da3fc4ea0fda21a80253d511f Log: Merge pull request #44 from jglick/ArgumentsAction.getResolvedArguments- JENKINS-31582 JENKINS-31582 ArgumentsAction.getResolvedArguments Compare: https://github.com/jenkinsci/workflow-api-plugin/compare/78744ae7045c...f105670fc62c
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            pom.xml
            src/main/java/org/jenkinsci/plugins/workflow/cps/actions/ArgumentsActionImpl.java
            src/main/java/org/jenkinsci/plugins/workflow/cps/nodes/StepAtomNode.java
            src/test/java/org/jenkinsci/plugins/workflow/cps/actions/ArgumentsActionImplTest.java
            src/test/java/org/jenkinsci/plugins/workflow/cps/nodes/StepNodeTest.java
            http://jenkins-ci.org/commit/workflow-cps-plugin/0a0e05093fecc8adcf8ba1eaf541d655ba7a7464
            Log:
            JENKINS-31582 Using ArgumentsAction.getResolvedArguments to better handle JENKINS-45109.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/org/jenkinsci/plugins/workflow/cps/actions/ArgumentsActionImpl.java src/main/java/org/jenkinsci/plugins/workflow/cps/nodes/StepAtomNode.java src/test/java/org/jenkinsci/plugins/workflow/cps/actions/ArgumentsActionImplTest.java src/test/java/org/jenkinsci/plugins/workflow/cps/nodes/StepNodeTest.java http://jenkins-ci.org/commit/workflow-cps-plugin/0a0e05093fecc8adcf8ba1eaf541d655ba7a7464 Log: JENKINS-31582 Using ArgumentsAction.getResolvedArguments to better handle JENKINS-45109 .
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            pom.xml
            src/main/java/org/jenkinsci/plugins/workflow/cps/actions/ArgumentsActionImpl.java
            src/main/java/org/jenkinsci/plugins/workflow/cps/nodes/StepAtomNode.java
            src/test/java/org/jenkinsci/plugins/workflow/cps/actions/ArgumentsActionImplTest.java
            src/test/java/org/jenkinsci/plugins/workflow/cps/nodes/StepNodeTest.java
            http://jenkins-ci.org/commit/workflow-cps-plugin/b78991523e2ff0868610b770bd3719452452fb2d
            Log:
            Merge pull request #151 from jglick/ArgumentsAction.getResolvedArguments-JENKINS-31582

            JENKINS-31582 Using ArgumentsAction.getResolvedArguments to better handle JENKINS-45109

            Compare: https://github.com/jenkinsci/workflow-cps-plugin/compare/4f703cf1b2c6...b78991523e2f

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/org/jenkinsci/plugins/workflow/cps/actions/ArgumentsActionImpl.java src/main/java/org/jenkinsci/plugins/workflow/cps/nodes/StepAtomNode.java src/test/java/org/jenkinsci/plugins/workflow/cps/actions/ArgumentsActionImplTest.java src/test/java/org/jenkinsci/plugins/workflow/cps/nodes/StepNodeTest.java http://jenkins-ci.org/commit/workflow-cps-plugin/b78991523e2ff0868610b770bd3719452452fb2d Log: Merge pull request #151 from jglick/ArgumentsAction.getResolvedArguments- JENKINS-31582 JENKINS-31582 Using ArgumentsAction.getResolvedArguments to better handle JENKINS-45109 Compare: https://github.com/jenkinsci/workflow-cps-plugin/compare/4f703cf1b2c6...b78991523e2f
            Hide
            jglick Jesse Glick added a comment -

            API committed which gives you access to plugin names used in step configurations. No version numbers available. That would require a complete redesign of the API; too late now.

            Show
            jglick Jesse Glick added a comment - API committed which gives you access to plugin names used in step configurations. No version numbers available. That would require a complete redesign of the API; too late now.
            Hide
            batmat Baptiste Mathus added a comment -

            It would have a bit better possibly, but I don't think it's such a big issue. It's easier to get the plugin version, than the plugin's artifactId from the pluginManager's UI anyway.

            Show
            batmat Baptiste Mathus added a comment - It would have a bit better possibly, but I don't think it's such a big issue. It's easier to get the plugin version, than the plugin's artifactId from the pluginManager's UI anyway.

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                cruftex Jens Wilke
              • Votes:
                4 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: