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

Add option "Use Upstream Project revision" similar to that on the legacy perforce plugin

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • p4-plugin

      Please could you consider adding a "Use Upstream Project revision" checkbox to the p4-plugin similar to that available in the legacy "perforce-plugin".

      It is a useful feature when jobs are setup to run after an upstream job with artifacts being copied. In many circumstances like this it is important that the downstream job uses the same file revisions as the upstream job that created the artifacts.

      I think it may be already possible to do this with "Parameterized Trigger Plugin" in the upstream job setting "change" parameter on the downstream job, but then all the downstream jobs have to be listed in the upstream job which is more complex to configure.

          [JENKINS-33163] Add option "Use Upstream Project revision" similar to that on the legacy perforce plugin

          Andrew Barnish created issue -
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 169036 ] New: JNJira + In-Review [ 183334 ]

          Jim Poje added a comment -

          We are facing the issue with the p4 software plugin in the case where we have parent/child jobs running. When we triggered the parent's job it captures the P4_CHANGELIST to pass down to the child job. However, in between running the parent job and the child job, if there are changelists submitted to perforce, then the value for P4_CHANGELIST is changed for the child job. This is not good for us since we need to make sure that both the parent and child jobs are syncing down to the same P4_CHANGELIST. Is there anyway that the p4 plugin will allow us to set the P4_CHANGELIST and not use the latest changelist in order for us to ensure that the same P4_CHANGELIST are used by both parent and child jobs?

          The "Use the upstream project revision" appears to be a solution to resolve, and ask this be prioritized.

          Jim Poje added a comment - We are facing the issue with the p4 software plugin in the case where we have parent/child jobs running. When we triggered the parent's job it captures the P4_CHANGELIST to pass down to the child job. However, in between running the parent job and the child job, if there are changelists submitted to perforce, then the value for P4_CHANGELIST is changed for the child job. This is not good for us since we need to make sure that both the parent and child jobs are syncing down to the same P4_CHANGELIST. Is there anyway that the p4 plugin will allow us to set the P4_CHANGELIST and not use the latest changelist in order for us to ensure that the same P4_CHANGELIST are used by both parent and child jobs? The "Use the upstream project revision" appears to be a solution to resolve, and ask this be prioritized.

          Karl Wirth added a comment -

          One workaround is to use parameterized jobs and the following plugin:

          https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin

          Create a downstream job with a string parameter 'P4CL' then pin the downstream job at the Perforce label '${P4CL}'. When the upstream job calls the downstream job set 'P4CL= ${P4_CHANGELIST)'.

          In this was the downstream jobs runs with the same changelist number that was used by the upstream job. In testing this also sets 'P4_CHANGELIST' to '${P4CL}'

          Karl Wirth added a comment - One workaround is to use parameterized jobs and the following plugin: https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin Create a downstream job with a string parameter 'P4CL' then pin the downstream job at the Perforce label '${P4CL}'. When the upstream job calls the downstream job set 'P4CL= ${P4_CHANGELIST)'. In this was the downstream jobs runs with the same changelist number that was used by the upstream job. In testing this also sets 'P4_CHANGELIST' to '${P4CL}'

          Code changed in jenkins
          User: Paul Allen
          Path:
          SETUP.md
          http://jenkins-ci.org/commit/p4-plugin/0a667176ad6dfb38ac755cc8e556875562dcd9ce
          Log:
          Document downstream changelists.

          Workaround for JENKINS-33163.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Paul Allen Path: SETUP.md http://jenkins-ci.org/commit/p4-plugin/0a667176ad6dfb38ac755cc8e556875562dcd9ce Log: Document downstream changelists. Workaround for JENKINS-33163 .

          Yes, we are already using that workaround using the pinned downstream build.
          However, as I said in the description of the issue that this is not good as you then have to list all downsteam jobs in parameterized trigger section of the upstream job, rather than in the downstream job (which is the usual method to link jobs in jenkins)

          Andrew Barnish added a comment - Yes, we are already using that workaround using the pinned downstream build. However, as I said in the description of the issue that this is not good as you then have to list all downsteam jobs in parameterized trigger section of the upstream job, rather than in the downstream job (which is the usual method to link jobs in jenkins)

          Paul Allen added a comment -

          1.4.9 (documentation)

          Paul Allen added a comment - 1.4.9 (documentation)
          Paul Allen made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          Paul Allen added a comment -

          Fixed in 1.4.9

          Paul Allen added a comment - Fixed in 1.4.9
          Paul Allen made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]

            p4paul Paul Allen
            barnish Andrew Barnish
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: