[JIRA] (JENKINS-57534) P4_CHANGELIST entry in map returned by checkout step is sometimes wrong

24 views
Skip to first unread message

stuartr@ea.com (JIRA)

unread,
May 17, 2019, 2:45:02 PM5/17/19
to jenkinsc...@googlegroups.com
Stuart Rowe created an issue
 
Jenkins / Bug JENKINS-57534
P4_CHANGELIST entry in map returned by checkout step is sometimes wrong
Issue Type: Bug Bug
Assignee: Unassigned
Components: p4-plugin
Created: 2019-05-17 18:44
Environment: p4-plugin 1.9.7
Priority: Minor Minor
Reporter: Stuart Rowe

The value of P4_CHANGELIST always reflects the requested sync changelist. The actual synced changelist value is less than or equal to the requested sync changelist, depending on the client view. The value of P4_CHANGELIST should always reflect the actual synced changelist value.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

kwirth@perforce.com (JIRA)

unread,
May 20, 2019, 4:47:02 AM5/20/19
to jenkinsc...@googlegroups.com
Karl Wirth commented on Bug JENKINS-57534
 
Re: P4_CHANGELIST entry in map returned by checkout step is sometimes wrong

Hi Stuart Rowe. Thanks for highlighting this. I could understand why this happens. The system does a `p4 changes -m1 //WORKSPACE/...` which retrurns the highest changelist synced to the workspace view.

Can you please let me know how the job is being triggered and how the workspace map is being restricted so I can repro this here.

kwirth@perforce.com (JIRA)

unread,
May 20, 2019, 4:47:02 AM5/20/19
to jenkinsc...@googlegroups.com

kwirth@perforce.com (JIRA)

unread,
May 20, 2019, 4:48:01 AM5/20/19
to jenkinsc...@googlegroups.com

stuartr@ea.com (JIRA)

unread,
May 21, 2019, 2:40:01 PM5/21/19
to jenkinsc...@googlegroups.com
Stuart Rowe commented on Bug JENKINS-57534
 
Re: P4_CHANGELIST entry in map returned by checkout step is sometimes wrong

Hi Karl Wirth,

I can repro the issue by triggering a job manually with a specific changelist number provided as a parameter. The workspace map is be being restricted through a virtual stream. The requested changelist contains only files excluded by the virtual stream.

Looking through the code, I believe the issue is in CheckoutTask#getBuildChange(Workspace workspace) which is called by CheckoutTask#initialise().

In my case, the populate label is set to {'{${Changelist}}'} which references a String parameter to specify the changelist number to sync. The Expand replaces this token and parses an integer from the String parameter value. This integer is used to create a new P4ChangeRef which is then returned as the build change. I believe this function needs to run a second 'p4 changes -m1 //WORKSPACE/...@${build.getChange()}' to determine the correct build change value for the workspace's view.

If I have time this week, I can put together a PR with a new test case and fix.

stuartr@ea.com (JIRA)

unread,
May 21, 2019, 2:40:02 PM5/21/19
to jenkinsc...@googlegroups.com
Stuart Rowe edited a comment on Bug JENKINS-57534
Hi [~p4karl],


I can repro the issue by triggering a job manually with a specific changelist number provided as a parameter. The workspace map is be being restricted through a virtual stream. The requested changelist contains only files excluded by the virtual stream.



In my case, the populate label is set to \ { ' { ' $ \ {Changelist} } '} } which references a String parameter to specify the changelist number to sync. The {{Expand}} replaces this token and parses an integer from the String parameter value. This integer is used to create a new {{P4ChangeRef}} which is then returned as the build change. I believe this function needs to run a second {{'p4 changes -m1 //WORKSPACE/...@${build.getChange()}'}} to determine the correct build change value for the workspace's view.

If I have time this week, I can put together a PR with a new test case and fix.

kwirth@perforce.com (JIRA)

unread,
May 22, 2019, 12:10:02 PM5/22/19
to jenkinsc...@googlegroups.com

Hi Stuart Rowe - Thanks for the confirmation. I'll add some repro steps.

stuartr@ea.com (JIRA)

unread,
May 22, 2019, 7:47:02 PM5/22/19
to jenkinsc...@googlegroups.com
Stuart Rowe started work on Bug JENKINS-57534
 
Change By: Stuart Rowe
Status: Open In Progress

stuartr@ea.com (JIRA)

unread,
May 22, 2019, 7:47:02 PM5/22/19
to jenkinsc...@googlegroups.com

stuartr@ea.com (JIRA)

unread,
May 22, 2019, 7:47:02 PM5/22/19
to jenkinsc...@googlegroups.com

stuartr@ea.com (JIRA)

unread,
May 22, 2019, 7:48:01 PM5/22/19
to jenkinsc...@googlegroups.com

stuartr@ea.com (JIRA)

unread,
May 22, 2019, 7:48:02 PM5/22/19
to jenkinsc...@googlegroups.com

kwirth@perforce.com (JIRA)

unread,
May 23, 2019, 10:28:03 AM5/23/19
to jenkinsc...@googlegroups.com

kwirth@perforce.com (JIRA)

unread,
May 23, 2019, 10:28:04 AM5/23/19
to jenkinsc...@googlegroups.com
Karl Wirth commented on Bug JENKINS-57534
 
Re: P4_CHANGELIST entry in map returned by checkout step is sometimes wrong

Hi Stuart Rowe, That's create thank you very much. I'll make sure Dev know about it.

pallen@perforce.com (JIRA)

unread,
May 29, 2019, 10:20:03 AM5/29/19
to jenkinsc...@googlegroups.com
Paul Allen updated Bug JENKINS-57534
 

Release in 1.10.0

Change By: Paul Allen
Status: In Review Closed
Resolution: Fixed
Reply all
Reply to author
Forward
0 new messages