[JIRA] (JENKINS-58456) explain polling per change

28 views
Skip to first unread message

luckyhk.lee@samsung.com (JIRA)

unread,
Jul 12, 2019, 2:24:02 AM7/12/19
to jenkinsc...@googlegroups.com
Hokwang Lee created an issue
 
Jenkins / Task JENKINS-58456
explain polling per change
Issue Type: Task Task
Assignee: Unassigned
Attachments: image-2019-07-12-15-22-43-852.png
Components: p4-plugin
Created: 2019-07-12 06:23
Priority: Critical Critical
Reporter: Hokwang Lee

Hi,

 

I want to make jenkins pipeline job

to run whenever commit comes.

 

In checkout code, there's filter: [incremental(true)] feature like below.

checkout perforce(
    credential: 'p4',
    filter: [incremental(true)],
    populate: syncOnly(...),
    workspace: templateSpec(...)
)

What is this for? 

 

and there's polling build filters options in configuration page.

What is this for?

What is different with upper code ?

 

Many thanks,

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

kwirth@perforce.com (JIRA)

unread,
Jul 12, 2019, 3:36:02 AM7/12/19
to jenkinsc...@googlegroups.com
Karl Wirth updated an issue
Change By: Karl Wirth
Attachment: image-2019-07-12-08-35-27-798.png

kwirth@perforce.com (JIRA)

unread,
Jul 12, 2019, 3:45:02 AM7/12/19
to jenkinsc...@googlegroups.com
Karl Wirth commented on Task JENKINS-58456
 
Re: explain polling per change

Yes if you check the Pipeline Syntax snippet generator that checkbox controls incremental (true):

This is described in:

  https://www.perforce.com/manuals/jenkins/Content/P4Jenkins/chapter-polling-build-filters.html?Highlight=poll%20per

 

          Polling per Change: A build is carried out for every change that is submitted. The polling event will only return the oldest

           unbuilt change, resulting in incremental builds.

 

Therefore when enabled you should see:

 

CL 1 submitted.

5 minute poll builds CL1

CL2 submitted

CL3 submitted

5 minute poll builds CL2

CL4 submitted

5 minute poll builds CL3

As you can see for every change to be built the polling has to occur more frequently than the submits.

 

If you really want on demand builds for every changelist a 'change-submit' Perforce trigger that explicitly calls the Jenkins job URL passing the changelist as a parameter is the recommended mechanism.

 

 

 

 

 

kwirth@perforce.com (JIRA)

unread,
Jul 12, 2019, 3:46:02 AM7/12/19
to jenkinsc...@googlegroups.com
Karl Wirth edited a comment on Task JENKINS-58456
Hi [~luckyhorang],

Yes if you check the Pipeline Syntax snippet generator that checkbox controls incremental (true):

!image-2019-07-12-08-35-27-798.png!

This is described in:

  [https://www.perforce.com/manuals/jenkins/Content/P4Jenkins/chapter-polling-build-filters.html?Highlight=poll%20per]

 

          *Polling per Change:* A build is carried out for every change that is submitted. The polling event will only return the oldest


           unbuilt change, resulting in incremental builds.

 

Therefore when enabled you should see:

 
{code:java}

CL 1 submitted.

5 minute poll builds CL1

CL2 submitted

CL3 submitted

5 minute poll builds CL2

CL4 submitted

5 minute poll builds CL3
{code}

As you can see for every change to be built the polling has to occur more frequently than the submits.

 

If you really want on demand builds for every changelist a 'change-submit' Perforce trigger that explicitly calls the Jenkins job URL passing the changelist as a parameter is the recommended mechanism.

kwirth@perforce.com (JIRA)

unread,
Jul 12, 2019, 3:47:01 AM7/12/19
to jenkinsc...@googlegroups.com
Karl Wirth resolved as Not A Defect
Change By: Karl Wirth
Status: Open Resolved
Resolution: Not A Defect

kwirth@perforce.com (JIRA)

unread,
Jul 12, 2019, 3:47:02 AM7/12/19
to jenkinsc...@googlegroups.com
Karl Wirth updated an issue
Change By: Karl Wirth
Labels: P4_SUPPORT

kwirth@perforce.com (JIRA)

unread,
Jul 12, 2019, 3:47:02 AM7/12/19
to jenkinsc...@googlegroups.com
Karl Wirth assigned an issue to Karl Wirth
Change By: Karl Wirth
Assignee: Karl Wirth

kwirth@perforce.com (JIRA)

unread,
Sep 2, 2019, 11:26:01 AM9/2/19
to jenkinsc...@googlegroups.com
Karl Wirth updated an issue
Change By: Karl Wirth
Attachment: image-2019-09-02-16-25-39-289.png

kwirth@perforce.com (JIRA)

unread,
Sep 2, 2019, 11:27:02 AM9/2/19
to jenkinsc...@googlegroups.com
Karl Wirth updated an issue
Change By: Karl Wirth
Attachment: image-2019-09-02-16-26-19-383.png

kwirth@perforce.com (JIRA)

unread,
Sep 2, 2019, 11:27:03 AM9/2/19
to jenkinsc...@googlegroups.com
Karl Wirth updated an issue
Change By: Karl Wirth
Attachment: image-2019-09-02-16-26-46-699.png

kwirth@perforce.com (JIRA)

unread,
Sep 2, 2019, 11:27:04 AM9/2/19
to jenkinsc...@googlegroups.com
Karl Wirth updated an issue
Change By: Karl Wirth
Attachment: image-2019-09-02-16-25-59-683.png

kwirth@perforce.com (JIRA)

unread,
Sep 2, 2019, 11:33:01 AM9/2/19
to jenkinsc...@googlegroups.com

Believe I have reproduced this. Reproduction steps:

(1) Create a workspace in ws

(2) Create files in "/ws/JENKINS-58639"

(3) Created "/ws/JENKINS-58639/Jenkinsfile":

pipeline {
  options {
        skipDefaultCheckout()
  }  agent { label 'docker-slave' }  stages {
    stage("Sync") {
      steps {
         script{
             checkout perforce(credential: 'JenkinsMaster', filter: [incremental(true)], populate: syncOnly(force: false, have: true, modtime: false, parallel: [enable: false, minb
ytes: '1024', minfiles: '1', threads: '4'], pin: '', quiet: true, revert: false), workspace: templateSpec(charset: 'none', format: 'jenkins-${NODE_NAME}-${JOB_NAME}-src', pinHost: 
false, templateName: "JENKINS-58639-template"))
      }
     }
    }
    stage ("wait_prior_starting_smoke_testing") {
         steps {
          echo 'Waiting 20 seconds'
          sleep 30
          }
        }
    stage("Test") {
      steps {
          sh 'ls'
      }
    }
  }
}

(4) Create a job with

(5) Set quiet period to 5 (not so important).

(6) Build job once.

(7) Submit a file to '/ws/JENKINS-58639'.

(8) Add a trigger to perforce to slow down syncs. For example create script "sleep.sh":

echo Sleeping for 600s in trigger...
sleep 600

make the file executable, then create a trigger entry:

	trigger.sleep.1 command pre-user-sync ./sleep.sh

(9) Run Poll now. Job will wait 5 seconds then start building.

(10) Submit another changelist to '/ws/JENKINS-58639'.

(11) Wait 20 seconds run Poll now. Job will wait 5 seconds then start building.

(12) Wait 20 seconds run Poll now. Job will wait 5 seconds then start building.

(13) Wait 20 seconds run Poll now. Job will wait 5 seconds then start building.

(14) Wait 20 seconds run Poll now. Job will wait 5 seconds then start building.

 

 

kwirth@perforce.com (JIRA)

unread,
Sep 2, 2019, 11:38:04 AM9/2/19
to jenkinsc...@googlegroups.com
Karl Wirth updated an issue
Change By: Karl Wirth
Comment:
Believe I have reproduced this. Reproduction steps:

(1) Create a workspace in ws

(2) Create files in "/ws/JENKINS-58639"

(3) Created "/ws/JENKINS-58639/Jenkinsfile":
{code:java}

pipeline {
  options {
        skipDefaultCheckout()
  }  agent { label 'docker-slave' }  stages {
    stage("Sync") {
      steps {
         script{
             checkout perforce(credential: 'JenkinsMaster', filter: [incremental(true)], populate: syncOnly(force: false, have: true, modtime: false, parallel: [enable: false, minb
ytes: '1024', minfiles: '1', threads: '4'], pin: '', quiet: true, revert: false), workspace: templateSpec(charset: 'none', format: 'jenkins-${NODE_NAME}-${JOB_NAME}-src', pinHost:
false, templateName: "JENKINS-58639-template"))
      }
     }
    }
    stage ("wait_prior_starting_smoke_testing") {
         steps {
          echo 'Waiting 20 seconds'
          sleep 30
          }
        }
    stage("Test") {
      steps {
          sh 'ls'
      }
    }
  }
}
{code}

(4) Create a job with

!image-2019-09-02-16-25-39-289.png!

!image-2019-09-02-16-25-59-683.png!

!image-2019-09-02-16-26-19-383.png!

!image-2019-09-02-16-26-46-699.png!


(5) Set quiet period to 5 (not so important).

(6) Build job once.

(7) Submit a file to '/ws/JENKINS-58639'.

(8) Add a trigger to perforce to slow down syncs. For example create script "sleep.sh":
{code:java}

echo Sleeping for 600s in trigger...
sleep 600
{code}

make the file executable, then create a trigger entry:
{code:java}
trigger.sleep.1 command pre-user-sync ./sleep.sh
{code}

(9) Run Poll now. Job will wait 5 seconds then start building.

(10) Submit another changelist to '/ws/JENKINS-58639'.

(11) Wait 20 seconds run Poll now. Job will wait 5 seconds then start building.

(12) Wait 20 seconds run Poll now. Job will wait 5 seconds then start building.

(13) Wait 20 seconds run Poll now. Job will wait 5 seconds then start building.

(14) Wait 20 seconds run Poll now. Job will wait 5 seconds then start building.

 

 

luckyhk.lee@samsung.com (JIRA)

unread,
Sep 3, 2019, 2:15:02 AM9/3/19
to jenkinsc...@googlegroups.com
Hokwang Lee edited a comment on Task JENKINS-58456
[~p4karl],

Thanks for your reply.

 

So, if I use 
{code:java}
filter: [incremental(true)],{code}
in checkout syntax in Pipeline,

I don't need to check Polling per Change in Polling build filters. Right?

 

 

 

 

luckyhk.lee@samsung.com (JIRA)

unread,
Sep 3, 2019, 2:15:02 AM9/3/19
to jenkinsc...@googlegroups.com

So, if I use 

filter: [incremental(true)],

in checkout syntax in Pipeline,

I don't need to check Polling per Change in Polling build filters. Right?

 

 

 

 

kwirth@perforce.com (JIRA)

unread,
Nov 27, 2019, 10:17:02 AM11/27/19
to jenkinsc...@googlegroups.com
Karl Wirth closed an issue as Not A Defect
Change By: Karl Wirth
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages