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

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

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • pipeline

      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.

          [JENKINS-31831] Allow Workflow Snippet Generator to be used outside of a configuration page

          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.

          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.

          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

          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

          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.

          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.

          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.

          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.

          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

          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

          Andrew Melo added a comment -

          I hit the same issue as squalou. 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?

          Andrew Melo added a comment - I hit the same issue as squalou . 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?

          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?

          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?

          Mike Kobit added a comment -

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

          Mike Kobit added a comment - gregcovertsmith It looks like you go to `/pipeline-syntax` - that is the only place I found it. ` http://jenkins/job/job-name/pipeline-syntax `

          squalou jenkins added a comment - - edited

          gregcovertsmith : 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'.

          squalou jenkins added a comment - - edited gregcovertsmith : 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'.

          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

          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

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

              Created:
              Updated:
              Resolved: