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

Promote delegates of metasteps to top-level functions, deprecate $class

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Currently you must write e.g.

      step([$class: 'JUnitResultArchiver', testResults: 'target/surefire-reports/*.xml'])
      

      which is awkward. Also in Snippet Generator you need to look under General Build Step for what to a user is logically a distinct step.

      Metasteps (step, wrap, checkout) should have an API by which they can declare that their delegate (scm in the last case) ought to be treated as a top-level step as far as DSL and Snippetizer are concerned, via some kind of syntactic sugar. In the absence of any Jenkins core API which would allow a Descriptor to specify a short name (yaml-project tries to define one of its own), this would have to be constructed somehow from the $class, perhaps simply:

      JUnitResultArchiver testResults: 'target/surefire-reports/*.xml'
      

      or with just one mandatory parameter even

      JUnitResultArchiver 'target/surefire-reports/*.xml'
      

      The follow-up question is what to do with nested Describable objects used in the configuration. So

      GitSCM ..., extensions: [[$class: 'PruneStaleBranch']]
      

      still looks unnatural. The Groovy builder idiom might suggest

      GitSCM ..., extensions: [PruneStaleBranch {}]
      

      though closure handling in JENKINS-26135 would need to be addressed first. Requires study to make a PoC.

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            I filed JENKINS-37227 for the follow-up task of updating checkout.

            Show
            jglick Jesse Glick added a comment - I filed JENKINS-37227 for the follow-up task of updating checkout .
            Hide
            jglick Jesse Glick added a comment -

            Everything now addressed other than the filed follow-up tasks.

            Show
            jglick Jesse Glick added a comment - Everything now addressed other than the filed follow-up tasks.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Christian Pönisch
            Path:
            pom.xml
            src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/atx/ATXPublisher.java
            src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/generator/ReportGeneratorPublisher.java
            src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/junit/JUnitPublisher.java
            src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/log/ETLogPublisher.java
            src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/trf/TRFPublisher.java
            src/main/java/de/tracetronic/jenkins/plugins/ecutest/test/TestFolderBuilder.java
            src/main/java/de/tracetronic/jenkins/plugins/ecutest/test/TestPackageBuilder.java
            src/main/java/de/tracetronic/jenkins/plugins/ecutest/test/TestProjectBuilder.java
            src/main/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartETBuilder.java
            src/main/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartTSBuilder.java
            src/main/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopETBuilder.java
            src/main/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopTSBuilder.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/SystemTestBase.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/atx/ATXPublisherST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/generator/ReportGeneratorPublisherST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/junit/JUnitPublisherST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/log/ETLogPublisherST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/trf/TRFPublisherST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestFolderBuilderST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestPackageBuilderST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestProjectBuilderST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartETBuilderST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartTSBuilderST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopETBuilderST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopTSBuilderST.java
            http://jenkins-ci.org/commit/ecutest-plugin/a106a4bde217c6b907bfee4ba14c6569ebf333ae
            Log:
            added @Symbol annotation to simplify pipeline syntax

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christian Pönisch Path: pom.xml src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/atx/ATXPublisher.java src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/generator/ReportGeneratorPublisher.java src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/junit/JUnitPublisher.java src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/log/ETLogPublisher.java src/main/java/de/tracetronic/jenkins/plugins/ecutest/report/trf/TRFPublisher.java src/main/java/de/tracetronic/jenkins/plugins/ecutest/test/TestFolderBuilder.java src/main/java/de/tracetronic/jenkins/plugins/ecutest/test/TestPackageBuilder.java src/main/java/de/tracetronic/jenkins/plugins/ecutest/test/TestProjectBuilder.java src/main/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartETBuilder.java src/main/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartTSBuilder.java src/main/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopETBuilder.java src/main/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopTSBuilder.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/SystemTestBase.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/atx/ATXPublisherST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/generator/ReportGeneratorPublisherST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/junit/JUnitPublisherST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/log/ETLogPublisherST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/trf/TRFPublisherST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestFolderBuilderST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestPackageBuilderST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestProjectBuilderST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartETBuilderST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartTSBuilderST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopETBuilderST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopTSBuilderST.java http://jenkins-ci.org/commit/ecutest-plugin/a106a4bde217c6b907bfee4ba14c6569ebf333ae Log: added @Symbol annotation to simplify pipeline syntax regarding to https://github.com/jenkinsci/pipeline-plugin/blob/master/DEVGUIDE.md#defining-symbols can be first used starting with workflow-cps 2.10 and structs 1.3 ( JENKINS-29922 ) identically named like the Job DSL extensions
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Suresh Kumar P
            Path:
            pom.xml
            src/main/java/com/spcow/winrmclient/InvokeCommandWinRMOperation.java
            src/main/java/com/spcow/winrmclient/SendFileWinRMOperation.java
            src/main/java/com/spcow/winrmclient/WinRMClientBuilder.java
            http://jenkins-ci.org/commit/winrm-client-plugin/2b0caa5f52e3ed4f57b0a82c78507b15c4251867
            Log:
            Added Symbols for Jenkins Pipeline support

            JENKINS-29922 $class must die

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Suresh Kumar P Path: pom.xml src/main/java/com/spcow/winrmclient/InvokeCommandWinRMOperation.java src/main/java/com/spcow/winrmclient/SendFileWinRMOperation.java src/main/java/com/spcow/winrmclient/WinRMClientBuilder.java http://jenkins-ci.org/commit/winrm-client-plugin/2b0caa5f52e3ed4f57b0a82c78507b15c4251867 Log: Added Symbols for Jenkins Pipeline support JENKINS-29922 $class must die
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Suresh Kumar P
            Path:
            pom.xml
            src/main/java/sp/sd/fileoperations/FileCopyOperation.java
            src/main/java/sp/sd/fileoperations/FileCreateOperation.java
            src/main/java/sp/sd/fileoperations/FileDeleteOperation.java
            src/main/java/sp/sd/fileoperations/FileDownloadOperation.java
            src/main/java/sp/sd/fileoperations/FileJoinOperation.java
            src/main/java/sp/sd/fileoperations/FileOperationsBuilder.java
            src/main/java/sp/sd/fileoperations/FilePropertiesToJsonOperation.java
            src/main/java/sp/sd/fileoperations/FileTransformOperation.java
            src/main/java/sp/sd/fileoperations/FileUnTarOperation.java
            src/main/java/sp/sd/fileoperations/FileUnZipOperation.java
            src/main/java/sp/sd/fileoperations/FolderCopyOperation.java
            src/main/java/sp/sd/fileoperations/FolderCreateOperation.java
            src/main/java/sp/sd/fileoperations/FolderDeleteOperation.java
            http://jenkins-ci.org/commit/file-operations-plugin/e0b44fcd8484372deef5a22e4daa048b4b5e8f46
            Log:
            Added Symbols for Jenkins Pipeline support

            JENKINS-29922 $class must die

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Suresh Kumar P Path: pom.xml src/main/java/sp/sd/fileoperations/FileCopyOperation.java src/main/java/sp/sd/fileoperations/FileCreateOperation.java src/main/java/sp/sd/fileoperations/FileDeleteOperation.java src/main/java/sp/sd/fileoperations/FileDownloadOperation.java src/main/java/sp/sd/fileoperations/FileJoinOperation.java src/main/java/sp/sd/fileoperations/FileOperationsBuilder.java src/main/java/sp/sd/fileoperations/FilePropertiesToJsonOperation.java src/main/java/sp/sd/fileoperations/FileTransformOperation.java src/main/java/sp/sd/fileoperations/FileUnTarOperation.java src/main/java/sp/sd/fileoperations/FileUnZipOperation.java src/main/java/sp/sd/fileoperations/FolderCopyOperation.java src/main/java/sp/sd/fileoperations/FolderCreateOperation.java src/main/java/sp/sd/fileoperations/FolderDeleteOperation.java http://jenkins-ci.org/commit/file-operations-plugin/e0b44fcd8484372deef5a22e4daa048b4b5e8f46 Log: Added Symbols for Jenkins Pipeline support JENKINS-29922 $class must die

              People

              • Assignee:
                kohsuke Kohsuke Kawaguchi
                Reporter:
                jglick Jesse Glick
              • Votes:
                7 Vote for this issue
                Watchers:
                20 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: