• Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • p4-plugin
    • 1.8.5

      At the moment there is no way to diagnose polling filter problems. Would be great if we could add some debug lines to allow us to see what filters have caused polling to ignore files in the build.

          [JENKINS-50013] Provide better polling filter debugging

          Eric Blom added a comment -

          Is it possible to add a polling filter for a pipeline job?

          I'm converting freestyle jobs to pipelines and I'm struggling to figure out how to migrate our polling filters. I've searched the documentation, asked on IRC, and then found this ticket. Based on this title of this ticket I'm hopeful that polling filters are supported in pipelines they just are documented.

          Eric Blom added a comment - Is it possible to add a polling filter for a pipeline job? I'm converting freestyle jobs to pipelines and I'm struggling to figure out how to migrate our polling filters. I've searched the documentation, asked on IRC, and then found this ticket. Based on this title of this ticket I'm hopeful that polling filters are supported in pipelines they just are documented.

          Karl Wirth added a comment -

          Hi bobwills,

          Yes if you are using 'Pipeline script from SCM' there is a 'Polling build filters' section after the 'Parrallel Sync' section.

           

          If you want the filter in your Jenkinsfile you can go to the snippet generator ('JENKINS_URL/pipeline-syntax/') then choose 'checkout' and set SCM to 'Perforce Software' you can build up your manual checkout step. The Polling build filters are at the end of the dialog.

          Below is an example that I generated. Note the 'filter' section:

          checkout perforce(credential: 'JenkinsMaster', 
          filter: [pathFilter('//depot/ignore_me/...')], 
          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', 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/project1/... //jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}/...')))
          

           

          Karl Wirth added a comment - Hi bobwills , Yes if you are using 'Pipeline script from SCM' there is a 'Polling build filters' section after the 'Parrallel Sync' section.   If you want the filter in your Jenkinsfile you can go to the snippet generator (' JENKINS_URL /pipeline-syntax/') then choose 'checkout' and set SCM to 'Perforce Software' you can build up your manual checkout step. The Polling build filters are at the end of the dialog. Below is an example that I generated. Note the 'filter' section: checkout perforce(credential: 'JenkinsMaster' , filter: [pathFilter( ' //depot/ignore_me/...' )], 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' , 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/project1/... //jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}/...')))  

          Eric Blom added a comment -

          Thank you for the reply. Through a circuitous path I finally got my filter working. I think the key learning was don't use p4sync. Use checkout from the snippet generator and select Perforce. I tried using the Pipeline script from SCM, as you mentioned, but, didn't get it to work. I must have had something configured incorrectly, but, I never figured out what. As this ticket suggests there isn't much output to help debug problems.

          Eric Blom added a comment - Thank you for the reply. Through a circuitous path I finally got my filter working. I think the key learning was don't use p4sync. Use checkout from the snippet generator and select Perforce. I tried using the Pipeline script from SCM, as you mentioned, but, didn't get it to work. I must have had something configured incorrectly, but, I never figured out what. As this ticket suggests there isn't much output to help debug problems.

          Karl Wirth added a comment -

          Hi bobwills - Great that you got it working and thanks for the feedback. I'll make sure the developers see it.

          Karl Wirth added a comment - Hi bobwills - Great that you got it working and thanks for the feedback. I'll make sure the developers see it.

            Unassigned Unassigned
            p4karl Karl Wirth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: