Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Major
-
Resolution: Fixed
-
Component/s: p4-plugin
-
Labels:
-
Environment:Jenkins 2.89.3
P4-Plugin 1.8.10
-
Similar Issues:
Description
When using Poll per change the system will correctly run individual builds for each new changelist but if using 'p4sync' or 'checkout' steps are used they will sync to #HEAD instead of the changelist to be built.
For example if the Jenkinsfile relies on the implicit sync that happens automatically the behavior is:
Setup job with a 30 second sleep at start Submit CL 1, 2 ,3, 4 Build 1 runs that syncs up to changelist 1 and reports that only CL 1 has built. Build 2 runs that syncs up to changelist 2 and reports that only CL 2 has built. Build 3 runs that syncs up to changelist 3 and reports that only CL 3 has built. Build 4 runs that syncs up to changelist 4 and reports that only CL 4 has built.
If instead the implicit sync is switched off and an explicit 'p4sync' or checkout' is used in the Jenkinsfile the behavior is:
Setup job with a 30 second sleep at start Submit CL 1, 2 ,3, 4 Build 1 runs that syncs up to changelist 4 but reports that only CL 1 has built. Build 2 runs that syncs up to changelist 4 but reports that only CL 2 has built. Build 3 runs that syncs up to changelist 4 but reports that only CL 3 has built. Build 4 runs that syncs up to changelist 4 but reports that only CL 4 has built.
Reproduction Step:
(1) Create a pipeline job with Jenkinsfile in SCM and polling build filter of 'Polling Per Change'.
(2) Create a dummy Jenkinsfile with a sleep and submit to Perforce. For example:
pipeline { //agent any agent{label 'MySlave'} //options { skipDefaultCheckout() } stages { stage("PollPerChange") { steps { script { echo "In script." echo "Sleeping..." sleep 30 //checkout perforce(credential: 'MasterServer', filter: [incremental(true)], populate: autoClean(delete: true, modtime: false, parallel: [enable: false, minbytes: '1024', minfiles: '1', threads: '4'], pin: '', quiet: true, replace: true, tidy: false), workspace: manualSpec(charset: 'none', name: 'jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}', pinHost: false, spec: clientSpec(allwrite: false, backup: false, clobber: true, compress: false, line: 'LOCAL', locked: false, modtime: false, rmdir: false, serverID: '', streamName: '', type: 'WRITABLE', view: '//depot/pollperchange/... //jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}/...'))) sh 'ls' } } } } }
(3) Create 3 changelists in relevant path then run 'poll now' on job (customised to your environment) as it is.
(4) Uncomment 3 lines in Jenkinsfile and submit to Perforce.
(5) Create 3 changelists in relevant path then run 'poll now' on job.
Attachments
Issue Links
- is related to
-
JENKINS-52066 Poll per change with multibranch pipeline jobs
-
- Closed
-
- relates to
-
JENKINS-47427 Poll per change with pipeline jobs
-
- Closed
-
-
JENKINS-52066 Poll per change with multibranch pipeline jobs
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Labels | P4_SUPPORT |
Description |
When using Poll per change the system will correctly run individual builds for each new changelist but if using 'p4sync' or 'checkout' steps are used they will sync to #HEAD instead of the changelist to be built. For example if the Jenkinsfile relies on the implicit sync that happens automatically the behavior is: {code:java} Setup job with a 30 second sleep at start Submit CL 1, 2 ,3, 4 Build 1 runs that syncs up to changelist 1 and reports that only CL 1 has built. Build 2 runs that syncs up to changelist 2 and reports that only CL 2 has built. Build 3 runs that syncs up to changelist 3 and reports that only CL 3 has built. Build 4 runs that syncs up to changelist 4 and reports that only CL 4 has built.{code} If instead the implicit sync is switched off and an explicit 'p4sync' or checkout' is used in the Jenkinsfile the behavior is: {code:java} Setup job with a 30 second sleep at start Submit CL 1, 2 ,3, 4 Build 1 runs that syncs up to changelist 4 but reports that only CL 1 has built. Build 2 runs that syncs up to changelist 4 but reports that only CL 2 has built. Build 3 runs that syncs up to changelist 4 but reports that only CL 3 has built. Build 4 runs that syncs up to changelist 4 but reports that only CL 4 has built.{code} |
When using Poll per change the system will correctly run individual builds for each new changelist but if using 'p4sync' or 'checkout' steps are used they will sync to #HEAD instead of the changelist to be built. For example if the Jenkinsfile relies on the implicit sync that happens automatically the behavior is: {code:java} Setup job with a 30 second sleep at start Submit CL 1, 2 ,3, 4 Build 1 runs that syncs up to changelist 1 and reports that only CL 1 has built. Build 2 runs that syncs up to changelist 2 and reports that only CL 2 has built. Build 3 runs that syncs up to changelist 3 and reports that only CL 3 has built. Build 4 runs that syncs up to changelist 4 and reports that only CL 4 has built.{code} If instead the implicit sync is switched off and an explicit 'p4sync' or checkout' is used in the Jenkinsfile the behavior is: {code:java} Setup job with a 30 second sleep at start Submit CL 1, 2 ,3, 4 Build 1 runs that syncs up to changelist 4 but reports that only CL 1 has built. Build 2 runs that syncs up to changelist 4 but reports that only CL 2 has built. Build 3 runs that syncs up to changelist 4 but reports that only CL 3 has built. Build 4 runs that syncs up to changelist 4 but reports that only CL 4 has built.{code} *Reproduction Step:* (1) Create a pipeline job with Jenkinsfile in SCM and polling build filter of 'Polling Per Change'. (2) Create a dummy Jenkinsfile with a sleep and submit to Perforce. For example: {code:java} pipeline { //agent any agent{label 'MySlave'} //options { skipDefaultCheckout() } stages { stage("PollPerChange") { steps { script { echo "In script." echo "Sleeping..." sleep 30 //checkout perforce(credential: 'MasterServer', filter: [incremental(true)], populate: autoClean(delete: true, modtime: false, parallel: [enable: false, minbytes: '1024', minfiles: '1', threads: '4'], pin: '', quiet: true, replace: true, tidy: false), workspace: manualSpec(charset: 'none', name: 'jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}', pinHost: false, spec: clientSpec(allwrite: false, backup: false, clobber: true, compress: false, line: 'LOCAL', locked: false, modtime: false, rmdir: false, serverID: '', streamName: '', type: 'WRITABLE', view: '//depot/pollperchange/... //jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}/...'))) sh 'ls' } } } } } {code} (3) Create 3 changelists in relevant path then run 'poll now' on job (customised to your environment) as it is. (4) Uncomment 3 lines in Jenkinsfile and submit to Perforce. (5) Create 3 changelists in relevant path then run 'poll now' on job. |
Labels | P4_SUPPORT | P4_VERIFY |
Link |
This issue relates to |
Link |
This issue relates to |
Assignee | Paul Allen [ p4paul ] |
Labels | P4_VERIFY | P4_A |
Link |
This issue is related to |
Priority | Minor [ 4 ] | Major [ 3 ] |
Labels | P4_A | P4_A P4_SUPPORT |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |