[JIRA] (JENKINS-38781) p4 unshelve not updating changes (pipeline)

33 views
Skip to first unread message

morne.joubert@u-blox.com (JIRA)

unread,
Oct 7, 2016, 3:40:01 AM10/7/16
to jenkinsc...@googlegroups.com
Morne Joubert updated an issue
 
Jenkins / Bug JENKINS-38781
p4 unshelve not updating changes (pipeline)

Releated to JENKINS-37584

Change By: Morne Joubert
Summary: p4 unshelve not updating changes (pipeline)
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

morne.joubert@u-blox.com (JIRA)

unread,
Oct 7, 2016, 3:41:01 AM10/7/16
to jenkinsc...@googlegroups.com

pallen@perforce.com (JIRA)

unread,
Oct 13, 2016, 6:18:01 AM10/13/16
to jenkinsc...@googlegroups.com
Paul Allen started work on Bug JENKINS-38781
 
Change By: Paul Allen
Status: Open In Progress

kwirth@perforce.com (JIRA)

unread,
Oct 13, 2016, 6:53:01 AM10/13/16
to jenkinsc...@googlegroups.com
Karl Wirth assigned an issue to Karl Wirth
Change By: Karl Wirth
Assignee: Karl Wirth

kwirth@perforce.com (JIRA)

unread,
Oct 13, 2016, 6:53:03 AM10/13/16
to jenkinsc...@googlegroups.com

morne.joubert@u-blox.com (JIRA)

unread,
Feb 22, 2017, 9:46:05 AM2/22/17
to jenkinsc...@googlegroups.com

what is the progress on this ?
Been 4 months since the last update.

Is is critical for a SCM plugin to display the changes that a build are using.

I am willing to help implement this fix, i just need to know where to add it

pallen@perforce.com (JIRA)

unread,
Dec 20, 2018, 10:03:02 AM12/20/18
to jenkinsc...@googlegroups.com
Paul Allen updated an issue
 
Change By: Paul Allen
Labels: P4_SUPPORT
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

kwirth@perforce.com (JIRA)

unread,
Jun 20, 2019, 11:55:03 AM6/20/19
to jenkinsc...@googlegroups.com
Karl Wirth commented on Bug JENKINS-38781
 
Re: p4 unshelve not updating changes (pipeline)

Hi Morne Joubert - I've just been going through the jobs and saw this was still open. Is this still a problem?

mjou@u-blox.com (JIRA)

unread,
Jul 5, 2019, 3:25:03 AM7/5/19
to jenkinsc...@googlegroups.com

Sorry for the delayed reply, i had to get a new Jira username

 

Yes, this is still an issue.

Pretty easy to test

kwirth@perforce.com (JIRA)

unread,
Dec 4, 2019, 10:42:03 AM12/4/19
to jenkinsc...@googlegroups.com
Karl Wirth updated an issue
 
Change By: Karl Wirth
Attachment: image-2019-12-04-15-41-26-079.png
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

kwirth@perforce.com (JIRA)

unread,
Dec 4, 2019, 10:42:03 AM12/4/19
to jenkinsc...@googlegroups.com

Hi Morne Joubert - I'd like to review this one with the developers so I did the following test.

 

P4_CHANGELIST is reported but it matches the latest changelist the workspace was synced to. For example unshelving changelist 2254:

pipeline {
  agent { label 'master' }
  stages {
    stage("Repro") {
      steps {
        script {
        def p4env = p4unshelve credential: 'JenkinsMaster', ignoreEmpty: false, resolve: 'at', shelf: '2254', tidy: false, workspace: manualSpec(charset: 'none', cleanup: false, name: 'jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}', pinHost: false, spec: clientSpec(allwrite: false, backup: true, changeView: '', clobber: true, compress: false, line: 'LOCAL', locked: false, modtime: false, rmdir: false, serverID: '', streamName: '', type: 'WRITABLE', view: '//depot/JENKINS-38781-UnsyncChangelist/... //jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}/... '))
        echo "P4_CHANGELIST is:"
        echo env.P4_CHANGELIST
        echo sh(script: 'env|sort', returnStdout: true)
       }
      }
    }
  }
}

In the output:

...cut...
P4 Task: unshelve review: 2254
... p4 unshelve -f -s2254 -cdefault +//depot/JENKINS-38781-UnsyncChangelist/f1
... duration: (2ms)
P4 Task: resolve: -at
... p4 resolve -at /var/lib/jenkins/workspace/JENKINS-38781-ChangelistOnUnshelve/... +... duration: (1ms)
[Pipeline] echo
P4_CHANGELIST is:
[Pipeline] echo
2268
...cut...

What do you want P4_CHANGELIST to be set to? Note the changes are also seen in Jenkins:

 

 

kwirth@perforce.com (JIRA)

unread,
Dec 12, 2019, 9:25:02 AM12/12/19
to jenkinsc...@googlegroups.com
Karl Wirth stopped work on Bug JENKINS-38781
 
Change By: Karl Wirth
Status: In Progress Open

mjou@u-blox.com (JIRA)

unread,
Dec 13, 2019, 10:20:02 AM12/13/19
to jenkinsc...@googlegroups.com

i currently set the P4_CHANGELIST to the CL the code was synced to , and totally ignore ENV for the shelved CLs since you can unshelve 10 different change lists

mjou@u-blox.com (JIRA)

unread,
Dec 13, 2019, 10:22:04 AM12/13/19
to jenkinsc...@googlegroups.com

What i do in my pipeline wrappers is to have

P4_CHANGELIST = cl/label

P4_UNSHELVESET= a,b,c

 

kwirth@perforce.com (JIRA)

unread,
Dec 13, 2019, 10:50:02 AM12/13/19
to jenkinsc...@googlegroups.com

Hi Morne Joubert - Sorry I'm missing the point here. I've read the job you mention but can you describe for me exactly what you want to do and what is not working.

mjou@u-blox.com (JIRA)

unread,
Dec 13, 2019, 11:19:02 AM12/13/19
to jenkinsc...@googlegroups.com

the ticket was created 3 years ago  let me check

 

mjou@u-blox.com (JIRA)

unread,
Dec 13, 2019, 11:25:03 AM12/13/19
to jenkinsc...@googlegroups.com
Morne Joubert updated an issue
 
Change By: Morne Joubert
Attachment: p4_shelve.png

mjou@u-blox.com (JIRA)

unread,
Dec 13, 2019, 11:25:04 AM12/13/19
to jenkinsc...@googlegroups.com

mjou@u-blox.com (JIRA)

unread,
Dec 13, 2019, 11:25:04 AM12/13/19
to jenkinsc...@googlegroups.com

mjou@u-blox.com (JIRA)

unread,
Dec 13, 2019, 11:29:02 AM12/13/19
to jenkinsc...@googlegroups.com
 
Re: p4 unshelve not updating changes (pipeline)

In the screenshot you can see my pipeline output.

In this code i synced CL 614442 on 2 streams and then unshelved 614492

1) The CL 614442 appears both (for each stream) , the code doesn't create a single set of unique CLs

2) I can see no shelve CL comments

mjou@u-blox.com (JIRA)

unread,
Dec 13, 2019, 11:34:03 AM12/13/19
to jenkinsc...@googlegroups.com
[2019-12-11T16:33:23.125Z] P4 Task: unshelve review: 614492
[2019-12-11T16:33:23.127Z] (p4):cmd:... p4 unshelve -f -s614492 -cdefault
[2019-12-11T16:33:23.127Z] p4 unshelve -f -s614492 -cdefault

The pipeline code shows the unshelve but nothing in the summary

The pipeline groovy looks like

 p4unshelve credential: p4_credential, resolve: 'at', shelf: ubxShelve, tidy: false, workspace: [$class: 'StreamWorkspaceImpl', charset: 'none', format: p4Workspace, pinHost: false, streamName: perforceStream]

The sync steps (that does provide the changes summary), looks like

checkout poll: false, scm: perforce(
                                                        credential: credential_id, 
                                                        populate: autoClean(delete: true, 
                                                                            modtime: true, 
                                                                            parallel: [enable: false, minbytes: '1024', minfiles: '1', threads: '4'], 
                                                                            pin: perforceLabel, 
                                                                            quiet: false, 
                                                                            replace: true, 
                                                                            tidy: false), 
                                                        workspace:ws )

mjou@u-blox.com (JIRA)

unread,
Dec 13, 2019, 11:37:03 AM12/13/19
to jenkinsc...@googlegroups.com

Am on jenkins 2.176.4 with p4-plugin 1.10.6

mjou@u-blox.com (JIRA)

unread,
Dec 13, 2019, 11:42:03 AM12/13/19
to jenkinsc...@googlegroups.com

in your testing, please do a sync step and then an unshelve step and check both are in the jenkins changes summary page. thanks

kwirth@perforce.com (JIRA)

unread,
Jan 2, 2020, 10:26:03 AM1/2/20
to jenkinsc...@googlegroups.com
Karl Wirth updated an issue
 
Change By: Karl Wirth
Attachment: image-2020-01-02-15-25-09-490.png

kwirth@perforce.com (JIRA)

unread,
Jan 2, 2020, 10:27:03 AM1/2/20
to jenkinsc...@googlegroups.com
Karl Wirth commented on Bug JENKINS-38781
 
Re: p4 unshelve not updating changes (pipeline)

Hi Morne Joubert - Happy New Year and thanks for all the detail. I was easily able to reproduce this so will pass it back to the devs.

 

Reproduction Steps:

(1) Create the depot structure:

//depot/JENKINS-38781-UnsyncChangelist/JenkinsfileHome/Jenkinsfile
//depot/JENKINS-38781-UnsyncChangelist/sync/s1
//depot/JENKINS-38781-UnsyncChangelist/unshelve/u1

(2) In the Jenkinsfile put the following code:

pipeline {
  agent { label 'master' }
  stages {
    stage("Repro"
) {
      steps {
        script {
        p4sync charset: 'none', credential: 'JenkinsMaster', populate: autoClean(delete: true, modtime: false, parallel: [enable: false, minbytes: '1024', minfiles: '1', threads: '4'], pin: '', quiet: false, replace: true, tidy: false), source: depotSource('//depot/JENKINS-38781-UnsyncChangelist/sync/...')
        def p4env = p4unshelve credential: 'JenkinsMaster', ignoreEmpty: false, resolve: 'at', shelf: '2254', tidy: false, workspace: manualSpec(charset: 'none', cleanup: false, name: 'jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}-unshelve', pinHost: false, spec: clientSpec(allwrite: false, backup: true, changeView: '', clobber: true, compress: false, line: 'LOCAL', locked: false, modtime: false, rmdir: false, serverID: '', streamName: '', type: 'WRITABLE', view: '//depot/JENKINS-38781-UnsyncChangelist/unshelve/... //jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}-unshelve/unshelve/... '))
       }
      }
    }
  }
}

Note that there is a sync step followed by an unshelve to a different directory.

(3) Run the job using 'Build Now'.

The unshelve step should have unshelved '2254' but it is not reported:

We would like to see unshelved changelist reported.

 

 

kwirth@perforce.com (JIRA)

unread,
Jan 2, 2020, 10:29:02 AM1/2/20
to jenkinsc...@googlegroups.com
Karl Wirth updated an issue
Change By: Karl Wirth
Labels: P4_SUPPORT P4_B

kwirth@perforce.com (JIRA)

unread,
Jan 2, 2020, 10:29:03 AM1/2/20
to jenkinsc...@googlegroups.com
Karl Wirth updated an issue
Change By: Karl Wirth
Labels: P4_B P4_VERIFY

kwirth@perforce.com (JIRA)

unread,
Jan 2, 2020, 10:29:04 AM1/2/20
to jenkinsc...@googlegroups.com
Karl Wirth assigned an issue to Unassigned
Change By: Karl Wirth
Assignee: Karl Wirth

yannick@koehler.name (JIRA)

unread,
Mar 6, 2020, 2:35:03 PM3/6/20
to jenkinsc...@googlegroups.com
Yannick Koehler commented on Bug JENKINS-38781
 
Re: p4 unshelve not updating changes (pipeline)

I am experimenting the same problem...  My CL unshelve through the plugin, after a checkout() using p4 plugin also results in the changeset being empty or missing the CL that got unshelve.

Only using checkout with changelog: true then I get p4 plugin to populate changeset but only with the sync's CL which is of no interest in the case of an unshelve situation.

 

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages