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

Suggestion: When calling the /review/build endpoint (see P4 Swarm), automatically apply a pipeline's default parameter values

XMLWordPrintable

      To trigger a Jenkins pipeline via P4 Swarm (for testing a shelved changelist during a code review, before it's submitted), we have to use the /review/build endpoint, together with the usual arguments:

      http://<credentials>@jenkins:8080/job/MyProject/job/MyJob/review/build&status={status}&review={review}&test={test}&testRunId={testRunId}&change={change}&version={version}&pass={pass}&fail={fail}&update={update}

      Those are already tedious and error-prone to enter (especially since they'll always be the same?), but that's a Swarm issue.

      The problem is that the above is actually incomplete. If the Jenkins pipeline has parameters, then their default values will not be applied, and the run will fail. To make it work, I currently have to append every single pipeline parameter as a name-value pair to the above url in Swarm! Example:

      ..........&JENKINS_CUSTOM_WORKSPACE=../P4Workspaces/MyProject/Main.Build&JENKINS_STREAM_PATH=//[MyProject/Main.Build&JENKINS_WORKSPACE_NAME=Main.Build&UE4_PROJECT_NAME=MyProject&BRANCH_NAME=Main&AGENT_LABEL=MyProject&UE_ROOT_FOLDER_NAME=UE5

      Here are my problems with this:

      • It's tedious. We have pipelines with more parameters than that.
      • It's error-prone.
      • I could easily run into url encoding issues (values that contain '&' or '=', etc).
      • This list, as entered in Swarm, will easily go out of sync with the actual pipeline in Jenkins.

      Could you please implement a way for the p4-plugin to automatically apply the default parameter values from the Jenkins pipeline, when /review/build is called? We should only have to pass any values that are different from the defaults.

      Thanks

            Unassigned Unassigned
            kostas_vlachavas Kostas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: