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

2 views
Skip to first unread message

barnish@gmail.com (JIRA)

unread,
Feb 25, 2016, 5:13:01 PM2/25/16
to jenkinsc...@googlegroups.com
Andrew Barnish created an issue
 
Jenkins / New Feature JENKINS-33163
Add option "Use Upstream Project revision" similar to that on the legacy perforce plugin
Issue Type: New Feature New Feature
Assignee: Paul Allen
Components: p4-plugin
Created: 25/Feb/16 10:12 PM
Labels: perforce
Priority: Minor Minor
Reporter: Andrew Barnish

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.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

poje@adobe.com (JIRA)

unread,
Oct 7, 2016, 10:20:05 AM10/7/16
to jenkinsc...@googlegroups.com
Jim Poje commented on New Feature JENKINS-33163
 
Re: Add option "Use Upstream Project revision" similar to that on the legacy perforce plugin

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.

This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

kwirth@perforce.com (JIRA)

unread,
Oct 10, 2016, 1:05:02 PM10/10/16
to jenkinsc...@googlegroups.com

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}

'

scm_issue_link@java.net (JIRA)

unread,
Oct 13, 2016, 9:00:06 AM10/13/16
to jenkinsc...@googlegroups.com

barnish@gmail.com (JIRA)

unread,
Oct 13, 2016, 1:37:01 PM10/13/16
to jenkinsc...@googlegroups.com

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)

pallen@perforce.com (JIRA)

unread,
Nov 15, 2016, 8:23:03 AM11/15/16
to jenkinsc...@googlegroups.com
Paul Allen resolved as Fixed
 

1.4.9 (documentation)

Change By: Paul Allen
Status: Open Resolved
Resolution: Fixed

pallen@perforce.com (JIRA)

unread,
Nov 15, 2016, 8:27:07 AM11/15/16
to jenkinsc...@googlegroups.com

philipa@mail.com (JIRA)

unread,
Feb 19, 2020, 5:17:02 PM2/19/20
to jenkinsc...@googlegroups.com
Philip Aston commented on New Feature JENKINS-33163
 
Re: Add option "Use Upstream Project revision" similar to that on the legacy perforce plugin

I'm seeing behaviour similar to that reported by Jim Poje above.

I'm following the documented pattern, but the change list reported by $P4_CHANGELIST (when captured by the parent job and passed to as a parameter to trigger the child job) reflects more recent commits.

I suspect there may have been a regression in the plugin. I'm going to downgrade (1.10.10 -> 1.9.6) and monitor over the next few days.

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

kwirth@perforce.com (JIRA)

unread,
Feb 20, 2020, 4:55:03 AM2/20/20
to jenkinsc...@googlegroups.com

Hi Philip Aston - Has this ever worked for you? From this thread, it looks like we didnt put in a code fix and only provided a workaround where you avoided using P4_CHANGELIST.

philipa@mail.com (JIRA)

unread,
Feb 20, 2020, 5:15:03 AM2/20/20
to jenkinsc...@googlegroups.com

I've only noticed it since upgrading 1.9.6 -> 1.10.10 recently. But yes, I could have missed it before. I'll pay close attention over the next few days and let you know.

Which workaround are you referring to? The one you mentioned in comment-27034 was documented under this issue and is what I'm using.

 

philipa@mail.com (JIRA)

unread,
Feb 20, 2020, 5:16:01 AM2/20/20
to jenkinsc...@googlegroups.com
Philip Aston edited a comment on New Feature JENKINS-33163
I've only noticed it since upgrading 1.9.6 -> 1.10.10 recently. But yes, I could have missed it before. I'll pay close attention over the next few days and let you know.

Which workaround are you referring to? The one you mentioned in [#comment- 27034 273024 ] was documented under this issue and is what I'm using.

 

philipa@mail.com (JIRA)

unread,
Feb 20, 2020, 5:17:02 AM2/20/20
to jenkinsc...@googlegroups.com
Philip Aston edited a comment on New Feature JENKINS-33163
I've only noticed it since upgrading 1.9.6 -> 1.10.10 recently. But yes, I could have missed it before. I'll pay close attention over the next few days and let you know.

Which workaround are you referring to? The one you mentioned in [ # comment-273024 |https://issues.jenkins-ci.org/browse/JENKINS-33163?focusedCommentId=273024 ] was documented under this issue and is what I'm using.

 

kwirth@perforce.com (JIRA)

unread,
Feb 20, 2020, 5:17:03 AM2/20/20
to jenkinsc...@googlegroups.com

Hi Philip Aston - Yes that's the one. I'll do some basic tests here to see if I can repro this.

kwirth@perforce.com (JIRA)

unread,
Feb 20, 2020, 12:50:02 PM2/20/20
to jenkinsc...@googlegroups.com

kwirth@perforce.com (JIRA)

unread,
Feb 20, 2020, 12:51:02 PM2/20/20
to jenkinsc...@googlegroups.com

kwirth@perforce.com (JIRA)

unread,
Feb 20, 2020, 12:51:03 PM2/20/20
to jenkinsc...@googlegroups.com

kwirth@perforce.com (JIRA)

unread,
Feb 20, 2020, 12:54:03 PM2/20/20
to jenkinsc...@googlegroups.com
 
Re: Add option "Use Upstream Project revision" similar to that on the legacy perforce plugin

Hi Philip Aston - I just tried the following test with 1.10.10 and it seemed to work:

(1) Add CL 123 to downstream job directory.

(2) Add CL 124 to upstream job directory.

(3) Trigger upstream job that has a 20 second sleep as a build step.

(4) Add 2 more CLs to each directory.

(5) Downstream job is triggered with CL124 as the paramater and jobs is pinned to that CL. P4-Plugin looks for most recent CL in downstream depot path and syncs CL 123.

 

My setup is - Upstream job...

 

Downstream job...

and:

philipa@mail.com (JIRA)

unread,
Feb 20, 2020, 2:35:04 PM2/20/20
to jenkinsc...@googlegroups.com

Thanks for investigating Karl. Yes, that configuration corresponds to mine. I guess the one difference might be that my jobs run on nodes on different machines, with different workspaces. Also, the later commit will trigger another run of the upstream job (on a different machine).

Its not recurred since I've downgraded, so I'm going to run with this for 1.9.6 for next week, then I'll try upgrading again.

kwirth@perforce.com (JIRA)

unread,
Feb 21, 2020, 4:42:03 AM2/21/20
to jenkinsc...@googlegroups.com

philipa@mail.com (JIRA)

unread,
Mar 3, 2020, 5:59:03 AM3/3/20
to jenkinsc...@googlegroups.com

I ran for a week 1.9.6 with no issues.

I switched back to 1.10.10, and saw the problem again. It's a production config, so I've reverted back to 1.9.6.

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

kwirth@perforce.com (JIRA)

unread,
Mar 10, 2020, 8:16:03 AM3/10/20
to jenkinsc...@googlegroups.com

Hi Philip Aston - Thanks. I'll test on WIndows and Linux build slaves and get back to you.

kwirth@perforce.com (JIRA)

unread,
Mar 19, 2020, 7:54:03 AM3/19/20
to jenkinsc...@googlegroups.com

Hi Philip Aston

Finally got a chance to test this properly and still no luck in reproducing it. Can you please send an email to 'sup...@perforce.com' for my attention and send the full console logs for the two jobs when th. I'll try and figure out what I'm missing.

Thanks in advance,

Karl

philipa@mail.com (JIRA)

unread,
Mar 25, 2020, 4:22:03 AM3/25/20
to jenkinsc...@googlegroups.com

Thanks Karl Wirth. I've upgraded the plugin again; I'll send you the logs when I see the next failure.

kwirth@perforce.com (JIRA)

unread,
Mar 27, 2020, 7:20:03 AM3/27/20
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages