When first setting up a Perforce triggered build or changing the polling configuration it can be hard to debug issues.

      After a poll that found no changes there's nothing in the P4 Trigger Log to indicate when the webhook was last called. In that case there's no way to distinguish between the poll running again but not finding changes, or the poll not happening any more.

      Adding the date and time to the P4 Polling Log would make it easy to confirm that the poll is running when expected.

          [JENKINS-69759] Print date/time at top of "P4 Trigger Log"

          Karl Wirth added a comment -

          Hi rcowsill ,

          Thanks for the suggestion. I will highlight it to the developers.

          For now I debug problems like this by setting up a Jenkins logger:

           

          Name: Perforce Log
          Logger: org.jenkinsci.plugins.p4
          Log Level: ALL

          The type of output you see in the log when a trigger fires is:

           

           

          Received trigger event for: 192.168.1.129:1666
          Feb 22, 2021 5:13:55 PM FINE org.jenkinsci.plugins.p4.trigger.P4Hook
          P4: trying: longfiles
          Feb 22, 2021 5:13:55 PM FINE org.jenkinsci.plugins.p4.trigger.P4Hook
          P4: trigger not set: longfiles
          Feb 22, 2021 5:12:48 PM FINE org.jenkinsci.plugins.p4.trigger.P4Hook
          P4: trying: P4Triggered_Build
          Feb 22, 2021 5:12:48 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook probeJobs
          P4: probing: P4Triggered_Build
          Feb 22, 2021 5:12:48 PM INFO org.jenkinsci.plugins.p4.trigger.P4Trigger poke
          P4: poking: P4Triggered_Build      # Only see this if the job workspace view matches files in the submit.

          Note that you only see the 'poking' message if the view in the workspace matches a file in the submitted changelist that triggered the build.

           

           

          Reproduction steps:

          (1) Create a Perforce job that has a workspace that covers '//depot/project1/...'

          (2) Set the 'Build Triggers' to be 'Perforce Triggered build.':

          (3) Submit a file to '//depot/project1' and record the submitted changelist number:

          (4) Trigger the build by using the script in the link below with the sbmitted changelist number.

             https://www.perforce.com/manuals/jenkins/Content/P4Jenkins/build-trigger-perforce.html?Highlight=triggered

          (5) See under the polling Log that there is no way to tell when the last trigger action was:

           

          Karl Wirth added a comment - Hi rcowsill , Thanks for the suggestion. I will highlight it to the developers. For now I debug problems like this by setting up a Jenkins logger:   Name: Perforce Log Logger: org.jenkinsci.plugins.p4 Log Level: ALL The type of output you see in the log when a trigger fires is:     Received trigger event for : 192.168.1.129:1666 Feb 22, 2021 5:13:55 PM FINE org.jenkinsci.plugins.p4.trigger.P4Hook P4: trying: longfiles Feb 22, 2021 5:13:55 PM FINE org.jenkinsci.plugins.p4.trigger.P4Hook P4: trigger not set: longfiles Feb 22, 2021 5:12:48 PM FINE org.jenkinsci.plugins.p4.trigger.P4Hook P4: trying: P4Triggered_Build Feb 22, 2021 5:12:48 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook probeJobs P4: probing: P4Triggered_Build Feb 22, 2021 5:12:48 PM INFO org.jenkinsci.plugins.p4.trigger.P4Trigger poke P4: poking: P4Triggered_Build      # Only see this if the job workspace view matches files in the submit. Note that you only see the 'poking' message if the view in the workspace matches a file in the submitted changelist that triggered the build.     Reproduction steps: (1) Create a Perforce job that has a workspace that covers '//depot/project1/...' (2) Set the 'Build Triggers' to be 'Perforce Triggered build.': (3) Submit a file to '//depot/project1' and record the submitted changelist number: (4) Trigger the build by using the script in the link below with the sbmitted changelist number.     https://www.perforce.com/manuals/jenkins/Content/P4Jenkins/build-trigger-perforce.html?Highlight=triggered (5) See under the polling Log that there is no way to tell when the last trigger action was:  

            Unassigned Unassigned
            rcowsill Robert Cowsill
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: