Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-66461

Add logging for p4/event endpoint

XMLWordPrintable

      The p4/change endpoint has good debugging that allows you to see when the endpoint is triggered.

      Would help support if the same debugging could applied to p4/event. At the moment no trace of the endpoint being called is seen in the default logging.

      Reproduction steps:

      (1) Create a multibranch pipeline job.

      (2) Call p4/event from 'curl'. For example:

      curl --header 'Content-Type: application/json' --user USER:API-TOKEN --request POST --data "payload={change:103,p4port:\"perforce:1666\",event_type:\"UPDATED\"}" http://JENKINS-SERVER:8080/p4/event/
      

      (3) Look in the URL '{JENKINS_URL}/log/all'.

       

      Note - A good hack to make sure the URL is getting through is to unescape the quotes around UPDATED:

      curl --header 'Content-Type: application/json' --user USER:API-TOKEN --request POST --data "payload={change:103,p4port:\"perforce:1666\",event_type:"UPDATED"}" http://JENKINS-SERVER:8080/p4/event/
      

      This produces the following error in the Jenkins log:

      Aug 26, 2021 11:20:37 AM WARNING org.eclipse.jetty.server.handler.ContextHandler$Context log
      Error while serving http://JENKINS-SERVER:8080//p4/event/ net.sf.json.JSONException: Unquotted string 'UPDATED'
      

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

              Created:
              Updated: