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

Allow Workflow Snippet Generator to be used outside of a configuration page

    Details

    • Type: Improvement
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: pipeline
    • Labels:
    • Similar Issues:

      Description

      A user should have a way of accessing the Workflow Snippet Generator without having to create a job. At least, it would be useful to be able to link to a functional Workflow Snippet Generator. Since the available snippets may vary depending on the plugins installed, this is something that needs an active Jenkins instance. Perhaps the scripts could be stored in a shared location that could later be accessed by jobs.

        Attachments

          Issue Links

            Activity

            kzantow Keith Zantow created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Priority Trivial [ 5 ] Minor [ 4 ]
            Hide
            jglick Jesse Glick added a comment -

            I do not think it is unreasonable to ask the user to create something Workflow-related to get a GUI link to the page where the tool may be found, but it need not be configure of a WorkflowJob; could also offer it from the configuration screens of multibranch workflows and organization folders using the Jenkinsfile recognizer.

            I would propose just having a top-level page, with a link exposed in various places that opens it in another browser tab, rather than displaying inline in the job configuration screen as is done today. (CJE users also get it in Workflow template transformers.)

            Show
            jglick Jesse Glick added a comment - I do not think it is unreasonable to ask the user to create something Workflow-related to get a GUI link to the page where the tool may be found, but it need not be configure of a WorkflowJob ; could also offer it from the configuration screens of multibranch workflows and organization folders using the Jenkinsfile recognizer. I would propose just having a top-level page, with a link exposed in various places that opens it in another browser tab, rather than displaying inline in the job configuration screen as is done today. (CJE users also get it in Workflow template transformers.)
            jglick Jesse Glick made changes -
            Labels ux
            jglick Jesse Glick made changes -
            Link This issue is duplicated by JENKINS-34147 [ JENKINS-34147 ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            Hide
            hrmpw Patrick Wolf added a comment -

            Would this also include links to the DSL Reference and .gdsl file? Jesse Glick

            Show
            hrmpw Patrick Wolf added a comment - Would this also include links to the DSL Reference and .gdsl file? Jesse Glick
            jglick Jesse Glick made changes -
            Remote Link This issue links to "PR 12 (Web Link)" [ 14327 ]
            Hide
            jglick Jesse Glick added a comment -

            Patrick Wolf yes this keeps all that functionality in one place.

            Show
            jglick Jesse Glick added a comment - Patrick Wolf yes this keeps all that functionality in one place.
            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/cps/CpsFlowDefinition.java
            src/main/java/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition.java
            src/main/java/org/jenkinsci/plugins/workflow/cps/Snippetizer.java
            src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/config.jelly
            src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/help-script.html
            src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition/config.jelly
            src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/SidepanelAction/action.jelly
            src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/block.jelly
            src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslHelp.groovy
            src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslReference.groovy
            src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslReferenceContent.groovy
            src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/help.html
            src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/html.groovy
            src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/index.jelly
            src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/sidepanel.jelly
            src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java
            http://jenkins-ci.org/commit/workflow-cps-plugin/f3958997d201d39a952c6572eb623a8730b822d7
            Log:
            JENKINS-31831 Make Snippetizer UI be displayed in a top-level page.

            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/cps/CpsFlowDefinition.java src/main/java/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition.java src/main/java/org/jenkinsci/plugins/workflow/cps/Snippetizer.java src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/config.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/help-script.html src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition/config.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/SidepanelAction/action.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/block.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslHelp.groovy src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslReference.groovy src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslReferenceContent.groovy src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/help.html src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/html.groovy src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/index.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/sidepanel.jelly src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java http://jenkins-ci.org/commit/workflow-cps-plugin/f3958997d201d39a952c6572eb623a8730b822d7 Log: JENKINS-31831 Make Snippetizer UI be displayed in a top-level page.
            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/cps/Snippetizer.java
            src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/SidepanelAction/action.jelly
            src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/sidepanel.jelly
            http://jenkins-ci.org/commit/workflow-cps-plugin/d08694dba1b3317298f9879aa67f8228f6120495
            Log:
            JENKINS-31831 Rendering content from PerJobAction so we get the correct ancestors in our path.

            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/cps/Snippetizer.java src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/SidepanelAction/action.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/sidepanel.jelly http://jenkins-ci.org/commit/workflow-cps-plugin/d08694dba1b3317298f9879aa67f8228f6120495 Log: JENKINS-31831 Rendering content from PerJobAction so we get the correct ancestors in our path.
            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/CpsFlowDefinition.java
            src/main/java/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition.java
            src/main/java/org/jenkinsci/plugins/workflow/cps/Snippetizer.java
            src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/config.jelly
            src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/help-script.html
            src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition/config.jelly
            src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/block.jelly
            src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslHelp.groovy
            src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslReference.groovy
            src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslReferenceContent.groovy
            src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/help.html
            src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/help.jelly
            src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/html.groovy
            src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/index.jelly
            src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/sidepanel.jelly
            src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java
            http://jenkins-ci.org/commit/workflow-cps-plugin/55f8ca739f1941215af95db585682b7cdb3dd236
            Log:
            Merge pull request #12 from jglick/Snippetizer-JENKINS-31831

            [FIXED JENKINS-31831] Make Snippetizer UI be displayed in a top-level page

            Compare: https://github.com/jenkinsci/workflow-cps-plugin/compare/891a1bd99a42...55f8ca739f19

            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/CpsFlowDefinition.java src/main/java/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition.java src/main/java/org/jenkinsci/plugins/workflow/cps/Snippetizer.java src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/config.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/help-script.html src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition/config.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/block.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslHelp.groovy src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslReference.groovy src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslReferenceContent.groovy src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/help.html src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/help.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/html.groovy src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/index.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/sidepanel.jelly src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java http://jenkins-ci.org/commit/workflow-cps-plugin/55f8ca739f1941215af95db585682b7cdb3dd236 Log: Merge pull request #12 from jglick/Snippetizer- JENKINS-31831 [FIXED JENKINS-31831] Make Snippetizer UI be displayed in a top-level page Compare: https://github.com/jenkinsci/workflow-cps-plugin/compare/891a1bd99a42...55f8ca739f19
            jglick Jesse Glick made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            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/multibranch/SCMBinder.java
            src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProject.java
            src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectFactory.java
            src/main/resources/org/jenkinsci/plugins/workflow/multibranch/SCMBinder/config.jelly
            http://jenkins-ci.org/commit/workflow-multibranch-plugin/6dd84f615efda6ccf826f328e553d16ccf4d260f
            Log:
            JENKINS-31831 Show Pipeline Groovy link on Pipeline multibranch projects and organization folders.

            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/multibranch/SCMBinder.java src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProject.java src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectFactory.java src/main/resources/org/jenkinsci/plugins/workflow/multibranch/SCMBinder/config.jelly http://jenkins-ci.org/commit/workflow-multibranch-plugin/6dd84f615efda6ccf826f328e553d16ccf4d260f Log: JENKINS-31831 Show Pipeline Groovy link on Pipeline multibranch projects and organization folders.
            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/multibranch/SCMBinder.java
            src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProject.java
            src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectFactory.java
            src/main/resources/org/jenkinsci/plugins/workflow/multibranch/SCMBinder/config.jelly
            http://jenkins-ci.org/commit/workflow-multibranch-plugin/4524135f0a935f454eaffb3374b7b7d7d19d2674
            Log:
            Merge pull request #9 from jglick/Snippetizer-JENKINS-31831

            JENKINS-31831 Show Pipeline Groovy link on multibranch projects

            Compare: https://github.com/jenkinsci/workflow-multibranch-plugin/compare/651b56627a5e...4524135f0a93

            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/multibranch/SCMBinder.java src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProject.java src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectFactory.java src/main/resources/org/jenkinsci/plugins/workflow/multibranch/SCMBinder/config.jelly http://jenkins-ci.org/commit/workflow-multibranch-plugin/4524135f0a935f454eaffb3374b7b7d7d19d2674 Log: Merge pull request #9 from jglick/Snippetizer- JENKINS-31831 JENKINS-31831 Show Pipeline Groovy link on multibranch projects Compare: https://github.com/jenkinsci/workflow-multibranch-plugin/compare/651b56627a5e...4524135f0a93
            Hide
            squalou squalou jenkins added a comment - - edited

            Guys, seriously, now when actually writing a job, we can't access the snippet generator in the same place ?
            and this is supposed ti be better ?

            Come on, switching tab/windows for copy / paste, are you kidding ?

            now, to access it, I need to have a pipeline job all the same (go wonder why), but I can't properly use it when editing the job. Well done.
            (sorry but I'm a bit furious here).

            I have 2 usecases to expose you :

            • : edit scripts inside the job. Then, the snippet generator as before was just perfect. Now it's a pain to use.
            • : edit a .groovy file stored on a scm, outside jenkins. For this, a snippet generator outside any job would be helpful. It's slightly better now (no need to edit an actual job), but still requires a job to exist (which is not the case when you build your jobs from DSL for instance)

            I hesitate to reopen this one / open another ticket, because I can't see any situation for which it's better now than it was.

            Show
            squalou squalou jenkins added a comment - - edited Guys, seriously, now when actually writing a job, we can't access the snippet generator in the same place ? and this is supposed ti be better ? Come on, switching tab/windows for copy / paste, are you kidding ? now, to access it, I need to have a pipeline job all the same (go wonder why), but I can't properly use it when editing the job. Well done. (sorry but I'm a bit furious here). I have 2 usecases to expose you : : edit scripts inside the job. Then, the snippet generator as before was just perfect. Now it's a pain to use. : edit a .groovy file stored on a scm, outside jenkins. For this, a snippet generator outside any job would be helpful. It's slightly better now (no need to edit an actual job), but still requires a job to exist (which is not the case when you build your jobs from DSL for instance) I hesitate to reopen this one / open another ticket, because I can't see any situation for which it's better now than it was.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/config.jelly
            src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition/config.jelly
            http://jenkins-ci.org/commit/workflow-cps-plugin/c8319cede23d31fc09e467f7b22e7836b273634f
            Log:
            JENKINS-31831 Amendment to display a link in the config form, since Jenkins 2 suppresses the sidepanel on configure.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/config.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition/config.jelly http://jenkins-ci.org/commit/workflow-cps-plugin/c8319cede23d31fc09e467f7b22e7836b273634f Log: JENKINS-31831 Amendment to display a link in the config form, since Jenkins 2 suppresses the sidepanel on configure.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/config.jelly
            src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition/config.jelly
            http://jenkins-ci.org/commit/workflow-cps-plugin/bf459ff0487f86d2e581e2ac15ee6bca5a2c9637
            Log:
            Merge pull request #13 from jglick/Snippetizer-link-JENKINS-31831

            JENKINS-31831 Amendment to display a link in the config form

            Compare: https://github.com/jenkinsci/workflow-cps-plugin/compare/7d9e3b2024b9...bf459ff0487f

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/config.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition/config.jelly http://jenkins-ci.org/commit/workflow-cps-plugin/bf459ff0487f86d2e581e2ac15ee6bca5a2c9637 Log: Merge pull request #13 from jglick/Snippetizer-link- JENKINS-31831 JENKINS-31831 Amendment to display a link in the config form Compare: https://github.com/jenkinsci/workflow-cps-plugin/compare/7d9e3b2024b9...bf459ff0487f
            Hide
            perilousapricot Andrew Melo added a comment -

            I hit the same issue as squalou jenkins. It's nice to have the snippet generator outside of a configuration page, but having it next to the actual configuration box was much more convenient to use. Is there any reason it can't be at both locations?

            Show
            perilousapricot Andrew Melo added a comment - I hit the same issue as squalou jenkins . It's nice to have the snippet generator outside of a configuration page, but having it next to the actual configuration box was much more convenient to use. Is there any reason it can't be at both locations?
            Hide
            gregcovertsmith Greg Smith added a comment -

            Could someone associated with this bug give the new url path to get to the snippet generator? Or path through the front page UI to get there?

            With this change in, I can't seem to find the snippet generator anywhere – now that its been removed from the new job page, should it be somewhere else now?

            Show
            gregcovertsmith Greg Smith added a comment - Could someone associated with this bug give the new url path to get to the snippet generator? Or path through the front page UI to get there? With this change in, I can't seem to find the snippet generator anywhere – now that its been removed from the new job page, should it be somewhere else now?
            Hide
            mkobit Mike Kobit added a comment -

            Greg Smith It looks like you go to `/pipeline-syntax` - that is the only place I found it. `http://jenkins/job/job-name/pipeline-syntax`

            Show
            mkobit Mike Kobit added a comment - Greg Smith It looks like you go to `/pipeline-syntax` - that is the only place I found it. ` http://jenkins/job/job-name/pipeline-syntax `
            Hide
            squalou squalou jenkins added a comment - - edited

            Greg Smith : other path to access it, from a 'pipeline job', there's a new item on the 'menu' on the top left (under new item, people,build history etc.) called 'Pipeline Syntax'.

            Show
            squalou squalou jenkins added a comment - - edited Greg Smith : other path to access it, from a 'pipeline job', there's a new item on the 'menu' on the top left (under new item, people,build history etc.) called 'Pipeline Syntax'.
            Hide
            gregcovertsmith Greg Smith added a comment -

            Thanks guys - I was able to find the new link.

            I did open a new related bug to this one, as the links are only shown to users who have permissions to edit the configuration of the project. I believe as they are doc references, they should be available to read users of the project.

            https://issues.jenkins-ci.org/browse/JENKINS-36047

            Show
            gregcovertsmith Greg Smith added a comment - Thanks guys - I was able to find the new link. I did open a new related bug to this one, as the links are only shown to users who have permissions to edit the configuration of the project. I believe as they are doc references, they should be available to read users of the project. https://issues.jenkins-ci.org/browse/JENKINS-36047
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 167281 ] JNJira + In-Review [ 198150 ]
            abayer Andrew Bayer made changes -
            Component/s pipeline-general [ 21692 ]
            abayer Andrew Bayer made changes -
            Component/s workflow-plugin [ 18820 ]

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                kzantow Keith Zantow
              • Votes:
                1 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: