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

Display meaningful summaries for metasteps

    Details

    • Similar Issues:

      Description

      JENKINS-37324 provided some of the infrastructure for displaying useful summaries of steps in visualizations like Blue Ocean, but mainly focused on sh steps and the like, and stopped short of providing useful summaries for some other commonly used steps. For example, you will still see General SCM or General Build Step, which are not helpful.

      Problems include:

      • Blue Ocean apparently does not check StepDescriptor.isMetaStep so as to display, for example, Fingerprinter.DescriptorImpl.displayName Record fingerprints of files to track usage in place of CoreStep.DescriptorImpl.displayName General Build Step when given fingerprint '*.jar'. Compare Snippetizer.QuasiDescriptor.
      • CoreStep, CoreWrapperStep, and GenericSCMStep should override argumentsToString to pass their delegate. (Originally automatic handling of metasteps was planned, but then dropped. Anyway pending JENKINS-37227 this would not yet work for GenericSCMStep.)
      • The default argumentsToString only handles steps passed a single argument, so even after handling metastep delegation, a call like archiveArtifacts artifacts: 'x.txt', fingerprint: true would not be described. It would be more sensible to check DescribableModel.getSoleRequiredParameter. Thus that step would be described as x.txt as a user would probably expect given a quasi-step description of Archive the artifacts.
      • Some build steps like JavadocArchiver still lack a @Symbol and @DataBoundSetter hygiene, but these are solvable on a case-by-case basis in plugins.

        Attachments

          Issue Links

            Activity

            jglick Jesse Glick created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Summary Display meaningful summaries for compound steps Display meaningful summaries for metasteps
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-37324 [ JENKINS-37324 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-37227 [ JENKINS-37227 ]
            Hide
            jglick Jesse Glick added a comment -

            Fixing the default argumentsToString to consider soleRequiredParameter of the model for the Step would probably make sense, even if that implementation needs to be copied in metastep overrides, since pwd tmp: true nonsensically returns true whereas it should return null like pwd() would. Similarly for sh script: 'git rev-parse HEAD', returnStdout: true. Then again, perhaps every step just needs to override this implementation and the default is more or less useless; certainly for writeFile we know we want to return the file parameter but this could not be inferred mechanically.

            Show
            jglick Jesse Glick added a comment - Fixing the default argumentsToString to consider soleRequiredParameter of the model for the Step would probably make sense, even if that implementation needs to be copied in metastep overrides, since pwd tmp: true nonsensically returns true whereas it should return null like pwd() would. Similarly for sh script: 'git rev-parse HEAD', returnStdout: true . Then again, perhaps every step just needs to override this implementation and the default is more or less useless; certainly for writeFile we know we want to return the file parameter but this could not be inferred mechanically.
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-45109 [ JENKINS-45109 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "workflow-cps PR 149 (Web Link)" [ 17175 ]
            jglick Jesse Glick made changes -
            Component/s workflow-cps-plugin [ 21713 ]
            Component/s blueocean-plugin [ 21481 ]
            jglick Jesse Glick made changes -
            Assignee Jesse Glick [ jglick ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            Hide
            jamesdumay James Dumay added a comment -

            Good catch Jesse Glick

            Show
            jamesdumay James Dumay added a comment - Good catch Jesse Glick
            jglick Jesse Glick made changes -
            Remote Link This issue links to "workflow-basic-steps PR 47 (Web Link)" [ 17193 ]
            jglick Jesse Glick made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            Hide
            jglick Jesse Glick added a comment -

            Implemented enough for now. Leaving some more difficult corner cases untouched, and in particular not trying to do anything with checkout prior to JENKINS-37227.

            Show
            jglick Jesse Glick added a comment - Implemented enough for now. Leaving some more difficult corner cases untouched, and in particular not trying to do anything with checkout prior to  JENKINS-37227 .
            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/steps/CoreStep.java
            src/main/java/org/jenkinsci/plugins/workflow/steps/CoreWrapperStep.java
            src/test/java/org/jenkinsci/plugins/workflow/steps/CoreStepTest.java
            src/test/java/org/jenkinsci/plugins/workflow/steps/CoreWrapperStepTest.java
            http://jenkins-ci.org/commit/workflow-basic-steps-plugin/b5b30ec451e2b9b7865c3e40cf8decd084cacc72
            Log:
            JENKINS-45101 Implement argumentsToString for step & wrap to look for a delegate configured with exactly one argument.

            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/steps/CoreStep.java src/main/java/org/jenkinsci/plugins/workflow/steps/CoreWrapperStep.java src/test/java/org/jenkinsci/plugins/workflow/steps/CoreStepTest.java src/test/java/org/jenkinsci/plugins/workflow/steps/CoreWrapperStepTest.java http://jenkins-ci.org/commit/workflow-basic-steps-plugin/b5b30ec451e2b9b7865c3e40cf8decd084cacc72 Log: JENKINS-45101 Implement argumentsToString for step & wrap to look for a delegate configured with exactly one argument.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/java/org/jenkinsci/plugins/workflow/steps/EnvStep.java
            src/main/java/org/jenkinsci/plugins/workflow/steps/MailStep.java
            src/main/java/org/jenkinsci/plugins/workflow/steps/PwdStep.java
            src/main/java/org/jenkinsci/plugins/workflow/steps/SleepStep.java
            src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStep.java
            src/main/java/org/jenkinsci/plugins/workflow/steps/ToolStep.java
            src/main/java/org/jenkinsci/plugins/workflow/steps/WriteFileStep.java
            src/main/java/org/jenkinsci/plugins/workflow/support/steps/stash/StashStep.java
            src/test/java/org/jenkinsci/plugins/workflow/steps/EnvStepTest.java
            src/test/java/org/jenkinsci/plugins/workflow/steps/MailStepTest.java
            src/test/java/org/jenkinsci/plugins/workflow/steps/PwdStepTest.java
            src/test/java/org/jenkinsci/plugins/workflow/steps/ReadWriteFileStepTest.java
            src/test/java/org/jenkinsci/plugins/workflow/steps/ToolStepTest.java
            src/test/java/org/jenkinsci/plugins/workflow/support/steps/stash/StashTest.java
            http://jenkins-ci.org/commit/workflow-basic-steps-plugin/c77b341459e9ae2803ec7df00fc3732a3965d2ee
            Log:
            JENKINS-45101 More argumentsToString implementations.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/workflow/steps/EnvStep.java src/main/java/org/jenkinsci/plugins/workflow/steps/MailStep.java src/main/java/org/jenkinsci/plugins/workflow/steps/PwdStep.java src/main/java/org/jenkinsci/plugins/workflow/steps/SleepStep.java src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStep.java src/main/java/org/jenkinsci/plugins/workflow/steps/ToolStep.java src/main/java/org/jenkinsci/plugins/workflow/steps/WriteFileStep.java src/main/java/org/jenkinsci/plugins/workflow/support/steps/stash/StashStep.java src/test/java/org/jenkinsci/plugins/workflow/steps/EnvStepTest.java src/test/java/org/jenkinsci/plugins/workflow/steps/MailStepTest.java src/test/java/org/jenkinsci/plugins/workflow/steps/PwdStepTest.java src/test/java/org/jenkinsci/plugins/workflow/steps/ReadWriteFileStepTest.java src/test/java/org/jenkinsci/plugins/workflow/steps/ToolStepTest.java src/test/java/org/jenkinsci/plugins/workflow/support/steps/stash/StashTest.java http://jenkins-ci.org/commit/workflow-basic-steps-plugin/c77b341459e9ae2803ec7df00fc3732a3965d2ee Log: JENKINS-45101 More argumentsToString implementations.
            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/steps/CoreStep.java
            src/main/java/org/jenkinsci/plugins/workflow/steps/CoreWrapperStep.java
            src/main/java/org/jenkinsci/plugins/workflow/steps/EnvStep.java
            src/main/java/org/jenkinsci/plugins/workflow/steps/MailStep.java
            src/main/java/org/jenkinsci/plugins/workflow/steps/PwdStep.java
            src/main/java/org/jenkinsci/plugins/workflow/steps/SleepStep.java
            src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStep.java
            src/main/java/org/jenkinsci/plugins/workflow/steps/ToolStep.java
            src/main/java/org/jenkinsci/plugins/workflow/steps/WriteFileStep.java
            src/main/java/org/jenkinsci/plugins/workflow/support/steps/stash/StashStep.java
            src/test/java/org/jenkinsci/plugins/workflow/steps/CoreStepTest.java
            src/test/java/org/jenkinsci/plugins/workflow/steps/CoreWrapperStepTest.java
            src/test/java/org/jenkinsci/plugins/workflow/steps/EnvStepTest.java
            src/test/java/org/jenkinsci/plugins/workflow/steps/MailStepTest.java
            src/test/java/org/jenkinsci/plugins/workflow/steps/PwdStepTest.java
            src/test/java/org/jenkinsci/plugins/workflow/steps/ReadWriteFileStepTest.java
            src/test/java/org/jenkinsci/plugins/workflow/steps/ToolStepTest.java
            src/test/java/org/jenkinsci/plugins/workflow/support/steps/stash/StashTest.java
            http://jenkins-ci.org/commit/workflow-basic-steps-plugin/c5468bf465def5c2e4bc86e6e9faafa36c538eb4
            Log:
            Merge pull request #47 from jglick/argumentsToString-JENKINS-45101

            JENKINS-45101 argumentsToString implementations

            Compare: https://github.com/jenkinsci/workflow-basic-steps-plugin/compare/1cd4d63fb731...c5468bf465de

            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/steps/CoreStep.java src/main/java/org/jenkinsci/plugins/workflow/steps/CoreWrapperStep.java src/main/java/org/jenkinsci/plugins/workflow/steps/EnvStep.java src/main/java/org/jenkinsci/plugins/workflow/steps/MailStep.java src/main/java/org/jenkinsci/plugins/workflow/steps/PwdStep.java src/main/java/org/jenkinsci/plugins/workflow/steps/SleepStep.java src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStep.java src/main/java/org/jenkinsci/plugins/workflow/steps/ToolStep.java src/main/java/org/jenkinsci/plugins/workflow/steps/WriteFileStep.java src/main/java/org/jenkinsci/plugins/workflow/support/steps/stash/StashStep.java src/test/java/org/jenkinsci/plugins/workflow/steps/CoreStepTest.java src/test/java/org/jenkinsci/plugins/workflow/steps/CoreWrapperStepTest.java src/test/java/org/jenkinsci/plugins/workflow/steps/EnvStepTest.java src/test/java/org/jenkinsci/plugins/workflow/steps/MailStepTest.java src/test/java/org/jenkinsci/plugins/workflow/steps/PwdStepTest.java src/test/java/org/jenkinsci/plugins/workflow/steps/ReadWriteFileStepTest.java src/test/java/org/jenkinsci/plugins/workflow/steps/ToolStepTest.java src/test/java/org/jenkinsci/plugins/workflow/support/steps/stash/StashTest.java http://jenkins-ci.org/commit/workflow-basic-steps-plugin/c5468bf465def5c2e4bc86e6e9faafa36c538eb4 Log: Merge pull request #47 from jglick/argumentsToString- JENKINS-45101 JENKINS-45101 argumentsToString implementations Compare: https://github.com/jenkinsci/workflow-basic-steps-plugin/compare/1cd4d63fb731...c5468bf465de
            jglick Jesse Glick made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            Hide
            svanoort Sam Van Oort added a comment - - edited

            Jesse Glick This was not provided out-of-box because Blue Ocean had agreed to provide the impls for the custom cases FYI.

            CoreWrapperStep/Metastep pretty output was broken by changes you requested, although initially supplied fully.

            Show
            svanoort Sam Van Oort added a comment - - edited Jesse Glick This was not provided out-of-box because Blue Ocean had agreed to provide the impls for the custom cases FYI. CoreWrapperStep/Metastep pretty output was broken by changes you requested, although initially supplied fully.
            Hide
            jglick Jesse Glick added a comment -

            Actually I had requested that the impl for metasteps be moved, not deleted. At any rate, it is in the metasteps now; at some future date we could introduce a convenience API allowing metasteps to share this implementation (particularly after JENKINS-37227).

            Show
            jglick Jesse Glick added a comment - Actually I had requested that the impl for metasteps be moved , not deleted. At any rate, it is in the metasteps now; at some future date we could introduce a convenience API allowing metasteps to share this implementation (particularly after  JENKINS-37227 ).

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                jglick Jesse Glick
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: