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

Workflow step to send approval "vote" to a change

      Ability to send an intermediate review in the flow. To a specific change or the change/patchset that triggered the flow.

          [JENKINS-26103] Workflow step to send approval "vote" to a change

          Teemu Murtola added a comment -

          In principle, this can already be done with a shell script step from a workflow (using, e.g., the ssh interface to gerrit), but that can be a bit tedious. But a feature that is not currently possible is to influence how the voting happens after the build finishes. See JENKINS-32692 for some background.

          One solution on the Gerrit Trigger side, which would probably provide a better integration in the long run, would be to provide a workflow step that can be used to influence the final vote: e.g., to set the Url to Post option, or the message to write (this could also replace the ability to pass Unsuccessful Message File, which is not possible from a workflow).

          I can create a separate issue for this if you prefer.

          Teemu Murtola added a comment - In principle, this can already be done with a shell script step from a workflow (using, e.g., the ssh interface to gerrit), but that can be a bit tedious. But a feature that is not currently possible is to influence how the voting happens after the build finishes. See JENKINS-32692 for some background. One solution on the Gerrit Trigger side, which would probably provide a better integration in the long run, would be to provide a workflow step that can be used to influence the final vote: e.g., to set the Url to Post option, or the message to write (this could also replace the ability to pass Unsuccessful Message File, which is not possible from a workflow). I can create a separate issue for this if you prefer.

          Teemu Murtola added a comment -

          I have drafted an initial implementation for setting a custom URL or a custom unsuccessful message from a workflow step for the final vote. I don't have any prior experience from developing for Jenkins, so I might have missed some things, but at least existing tests pass, as does my one new test. I haven't tested whether the workflow snippetizer works. I'll push it to GitHub once I have a bit more time.

          For now, I used this DSL syntax:

          gerritReview customUrl: 'myUrl', unsuccessfulMessage: 'message'
          

          This could possibly be extended to also post immediately without much confusion to cover more of this feature request, but alternative suggestions are welcome.

          Teemu Murtola added a comment - I have drafted an initial implementation for setting a custom URL or a custom unsuccessful message from a workflow step for the final vote. I don't have any prior experience from developing for Jenkins, so I might have missed some things, but at least existing tests pass, as does my one new test. I haven't tested whether the workflow snippetizer works. I'll push it to GitHub once I have a bit more time. For now, I used this DSL syntax: gerritReview customUrl: 'myUrl', unsuccessfulMessage: 'message' This could possibly be extended to also post immediately without much confusion to cover more of this feature request, but alternative suggestions are welcome.

          Code changed in jenkins
          User: Teemu Murtola
          Path:
          pom.xml
          src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/gerritnotifier/ToGerritRunListener.java
          src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/GerritReviewStep.java
          src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/GerritReviewStep/config.jelly
          src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/GerritReviewStep/help-unsuccessfulMessage.html
          src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/GerritReviewStep/help.html
          src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/WorkflowTest.java
          http://jenkins-ci.org/commit/gerrit-trigger-plugin/427d422b5c1ed7c3d69bfb0d6db4c89b6f760d8f
          Log:
          Workflow step for setting unsuccessful message

          Add a workflow step that allows setting the unsuccessful message from a
          workflow build. config.jelly is currently missing.

          Dependency to the workflow plugin is optional.

          Implements a limited part of JENKINS-26103.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Teemu Murtola Path: pom.xml src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/gerritnotifier/ToGerritRunListener.java src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/GerritReviewStep.java src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/GerritReviewStep/config.jelly src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/GerritReviewStep/help-unsuccessfulMessage.html src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/GerritReviewStep/help.html src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/WorkflowTest.java http://jenkins-ci.org/commit/gerrit-trigger-plugin/427d422b5c1ed7c3d69bfb0d6db4c89b6f760d8f Log: Workflow step for setting unsuccessful message Add a workflow step that allows setting the unsuccessful message from a workflow build. config.jelly is currently missing. Dependency to the workflow plugin is optional. Implements a limited part of JENKINS-26103 .

          Code changed in jenkins
          User: Teemu Murtola
          Path:
          src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/gerritnotifier/ParameterExpander.java
          src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/gerritnotifier/ToGerritRunListener.java
          src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/gerritnotifier/model/BuildMemory.java
          src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/GerritReviewStep.java
          src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/GerritReviewStep/config.jelly
          src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/GerritReviewStep/help-customUrl.html
          src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/WorkflowTest.java
          http://jenkins-ci.org/commit/gerrit-trigger-plugin/3e31f724712d5a6f43605f18f601ca0d18d63423
          Log:
          Allow setting custom url in workflow

          Extend the gerritReview workflow step to also allow setting the URL to
          post. Use the existing mechanism (BuildMemory) for storing the value
          while the build is running.

          Implements a limited part of JENKINS-26103.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Teemu Murtola Path: src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/gerritnotifier/ParameterExpander.java src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/gerritnotifier/ToGerritRunListener.java src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/gerritnotifier/model/BuildMemory.java src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/GerritReviewStep.java src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/GerritReviewStep/config.jelly src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/GerritReviewStep/help-customUrl.html src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/WorkflowTest.java http://jenkins-ci.org/commit/gerrit-trigger-plugin/3e31f724712d5a6f43605f18f601ca0d18d63423 Log: Allow setting custom url in workflow Extend the gerritReview workflow step to also allow setting the URL to post. Use the existing mechanism (BuildMemory) for storing the value while the build is running. Implements a limited part of JENKINS-26103 .

          Code changed in jenkins
          User: Robert Sandell
          Path:
          pom.xml
          src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/gerritnotifier/ParameterExpander.java
          src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/gerritnotifier/ToGerritRunListener.java
          src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/gerritnotifier/model/BuildMemory.java
          src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/SetGerritReviewStep.java
          src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/SetGerritReviewStep/config.jelly
          src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/SetGerritReviewStep/help-customUrl.html
          src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/SetGerritReviewStep/help-unsuccessfulMessage.html
          src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/SetGerritReviewStep/help.html
          src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/gerritnotifier/ParameterExpanderTest.java
          src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/gerritnotifier/ToGerritRunListenerTest.java
          src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/WorkflowTest.java
          http://jenkins-ci.org/commit/gerrit-trigger-plugin/b7ab5892c183e6ca91ce00325f009d9f1571a8b8
          Log:
          Merge pull request #274 from teemumurtola/workflow-steps

          Partial implementation for JENKINS-26103

          Compare: https://github.com/jenkinsci/gerrit-trigger-plugin/compare/64d7d8aa16c1...b7ab5892c183

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Robert Sandell Path: pom.xml src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/gerritnotifier/ParameterExpander.java src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/gerritnotifier/ToGerritRunListener.java src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/gerritnotifier/model/BuildMemory.java src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/SetGerritReviewStep.java src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/SetGerritReviewStep/config.jelly src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/SetGerritReviewStep/help-customUrl.html src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/SetGerritReviewStep/help-unsuccessfulMessage.html src/main/resources/com/sonyericsson/hudson/plugins/gerrit/trigger/workflow/SetGerritReviewStep/help.html src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/gerritnotifier/ParameterExpanderTest.java src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/gerritnotifier/ToGerritRunListenerTest.java src/test/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/WorkflowTest.java http://jenkins-ci.org/commit/gerrit-trigger-plugin/b7ab5892c183e6ca91ce00325f009d9f1571a8b8 Log: Merge pull request #274 from teemumurtola/workflow-steps Partial implementation for JENKINS-26103 Compare: https://github.com/jenkinsci/gerrit-trigger-plugin/compare/64d7d8aa16c1...b7ab5892c183

            rsandell rsandell
            jglick Jesse Glick
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: