Hi all,
We are unable to get P4 Triggered builds to work on our local Jenkin/Perforce setup. When the JSON payload is POST'd to /p4/change it does not trigger our builds which are set to "Perforce triggered build.", but using the "Manual Configuration for Trigger" does work. If I use the /p4/ url and the "Manual Configuration for Trigger" and specify the port as: "perf.mysite.com:1666", and the change as "200" (not entirely clear what this field is used for, any number seems to work) this will cause the build to correctly trigger and fire.
We have tried both using cURL (as per the example) and Postman and neither of them can successfully trigger builds. This is the exact cUrl command we use:
curl --header "Content-Type: application/json" --request POST --data "payload=
{change:200,p4port:\"perf.mysite.com:1666\"}" http://jenkins.mysite.com:8192/p4/change
And Postman:
POST /p4/change HTTP/1.1
Host: jenkins.mysite.com:8192
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: 8425cf56-212f-f0fa-7007-b70a4591565e
payload=
{"change":"500", "p4port" :"perf.mysite.com:1666"}Job Setup:
It was set up as a freestyle job (inside of a folder, though moving the job to the root level does not resolve it) and the Perforce Credentials were chosen. A workspace name was assigned, and a View Mapping was applied. Under "Build Triggers", only "Perforce triggered build." is checked.
Logs:
When Postman is used to POST the JSON payload as a simple test-case the following is printed into the logs (note that this was POST'd multiple times with different change values):
Nov 14, 2016 3:44:32 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange
Received trigger event:
Nov 14, 2016 3:44:48 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange
Received trigger event:
However, nothing in the logs happens after that. I know that the [probeJobs](https://github.com/jenkinsci/p4-plugin/blob/master/src/main/java/org/jenkinsci/plugins/p4/trigger/P4Hook.java#L92) function works, as the Manual Trigger also invokes it and that is successfully printed.
If I run the "Manual Configuration for Trigger" via the webpage, the following is printed into the logs:
Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChangeSubmit
Manual trigger event:
Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook probeJobs
P4: probing: MY_PROJECT
Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Trigger poke
P4: poking: MY_PROJECT
Nov 14, 2016 3:50:04 PM INFO org.jenkinsci.plugins.p4.tasks.CheckoutTask getBuildChange
getBuildChange:return:726
The only thing I can think of at this point is that it is not correctly retrieving the string for "p4port" variable, thus it never runs probeJobs when called from doChange. I cannot get it to print "p4port must be specified" in the logs, however I do not know if setting Jenkins log to /all includes Fine level logging or not. I cannot think of any reason the submitted JSON payloads would not work otherwise.
[JENKINS-39734] P4 Trigger (/p4/change) Doesn't Detect p4port
Description |
Original:
Hi all, We are unable to get P4 Triggered builds to work on our local Jenkin/Perforce setup. When the JSON payload is POST'd to /p4/change it does not trigger our builds which are set to "Perforce triggered build.", but using the "Manual Configuration for Trigger" does work. If I use the /p4/ url and the "Manual Configuration for Trigger" and specify the port as: "perf.mysite.com:1666", and the change as "200" (not entirely clear what this field is used for, any number seems to work) *this will cause the build to correctly trigger and fire*. We have tried both using cURL (as per the example) and Postman and neither of them can successfully trigger builds. This is the exact cUrl command we use: curl --header "Content-Type: application/json" --request POST --data "payload={change:200,p4port:\"perf.mysite.com:1666\"}" http://jenkins.mysite.com:8192/p4/change And Postman: POST /p4/change HTTP/1.1 Host: jenkins.mysite.com:8192 Content-Type: application/json Cache-Control: no-cache Postman-Token: 8425cf56-212f-f0fa-7007-b70a4591565e payload={"change":"500", "p4port" :"perf.mysite.com:1666"} *Job Setup:* It was set up as a freestyle job (inside of a folder, though moving the job to the root level does not resolve it) and the Perforce Credentials were chosen. A workspace name was assigned, and a View Mapping was applied. Under "Build Triggers", *only "Perforce triggered build." is checked*. *Logs:* When Postman is used to POST the JSON payload as a simple test-case the following is printed into the logs (note that this was POST'd multiple times with different change values): Nov 14, 2016 3:44:32 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange Received trigger event: {"change":"202","p4port":"perf.mysite.com:1666"} Nov 14, 2016 3:44:48 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange Received trigger event: {"change":500,"p4port":"perf.mysite.com:1666"} However, nothing in the logs happens after that. I know that the [probeJobs](https://github.com/jenkinsci/p4-plugin/blob/master/src/main/java/org/jenkinsci/plugins/p4/trigger/P4Hook.java#L92) function works, as the Manual Trigger also invokes it and that is successfully printed. If I run the "Manual Configuration for Trigger" via the webpage, the following is printed into the logs: Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChangeSubmit Manual trigger event: Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook probeJobs P4: probing: MY_PROJECT Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Trigger poke P4: poking: MY_PROJECT Nov 14, 2016 3:50:04 PM INFO org.jenkinsci.plugins.p4.tasks.CheckoutTask getBuildChange getBuildChange:return:726 The only thing I can think of at this point is that it is not correctly retrieving the string for "p4port" variable, thus it never runs probeJobs when called from doChange. However, I cannot think of any reason the submitted JSON payloads would not work. |
New:
Hi all, We are unable to get P4 Triggered builds to work on our local Jenkin/Perforce setup. When the JSON payload is POST'd to /p4/change it does not trigger our builds which are set to "Perforce triggered build.", but using the "Manual Configuration for Trigger" does work. If I use the /p4/ url and the "Manual Configuration for Trigger" and specify the port as: "perf.mysite.com:1666", and the change as "200" (not entirely clear what this field is used for, any number seems to work) *this will cause the build to correctly trigger and fire*. We have tried both using cURL (as per the example) and Postman and neither of them can successfully trigger builds. This is the exact cUrl command we use: {{curl --header "Content-Type: application/json" --request POST --data "payload={change:200,p4port:\"perf.mysite.com:1666\"}" http://jenkins.mysite.com:8192/p4/change}} And Postman: {{POST /p4/change HTTP/1.1 Host: jenkins.mysite.com:8192 Content-Type: application/json Cache-Control: no-cache Postman-Token: 8425cf56-212f-f0fa-7007-b70a4591565e payload={"change":"500", "p4port" :"perf.mysite.com:1666"}}} *Job Setup:* It was set up as a freestyle job (inside of a folder, though moving the job to the root level does not resolve it) and the Perforce Credentials were chosen. A workspace name was assigned, and a View Mapping was applied. Under "Build Triggers", *only "Perforce triggered build." is checked*. *Logs:* When Postman is used to POST the JSON payload as a simple test-case the following is printed into the logs (note that this was POST'd multiple times with different change values): bq. Nov 14, 2016 3:44:32 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange bq. Received trigger event: {"change":"202","p4port":"perf.mysite.com:1666"} bq. Nov 14, 2016 3:44:48 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange bq. Received trigger event: {"change":500,"p4port":"perf.mysite.com:1666"} However, nothing in the logs happens after that. I know that the [probeJobs](https://github.com/jenkinsci/p4-plugin/blob/master/src/main/java/org/jenkinsci/plugins/p4/trigger/P4Hook.java#L92) function works, as the Manual Trigger also invokes it and that is successfully printed. If I run the "Manual Configuration for Trigger" via the webpage, the following is printed into the logs: bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChangeSubmit bq. Manual trigger event: bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook probeJobs bq. P4: probing: MY_PROJECT bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Trigger poke bq. P4: poking: MY_PROJECT bq. Nov 14, 2016 3:50:04 PM INFO org.jenkinsci.plugins.p4.tasks.CheckoutTask getBuildChange bq. getBuildChange:return:726 bq. The only thing I can think of at this point is that it is not correctly retrieving the string for "p4port" variable, thus it never runs probeJobs when called from doChange. However, I cannot think of any reason the submitted JSON payloads would not work. |
Description |
Original:
Hi all, We are unable to get P4 Triggered builds to work on our local Jenkin/Perforce setup. When the JSON payload is POST'd to /p4/change it does not trigger our builds which are set to "Perforce triggered build.", but using the "Manual Configuration for Trigger" does work. If I use the /p4/ url and the "Manual Configuration for Trigger" and specify the port as: "perf.mysite.com:1666", and the change as "200" (not entirely clear what this field is used for, any number seems to work) *this will cause the build to correctly trigger and fire*. We have tried both using cURL (as per the example) and Postman and neither of them can successfully trigger builds. This is the exact cUrl command we use: {{curl --header "Content-Type: application/json" --request POST --data "payload={change:200,p4port:\"perf.mysite.com:1666\"}" http://jenkins.mysite.com:8192/p4/change}} And Postman: {{POST /p4/change HTTP/1.1 Host: jenkins.mysite.com:8192 Content-Type: application/json Cache-Control: no-cache Postman-Token: 8425cf56-212f-f0fa-7007-b70a4591565e payload={"change":"500", "p4port" :"perf.mysite.com:1666"}}} *Job Setup:* It was set up as a freestyle job (inside of a folder, though moving the job to the root level does not resolve it) and the Perforce Credentials were chosen. A workspace name was assigned, and a View Mapping was applied. Under "Build Triggers", *only "Perforce triggered build." is checked*. *Logs:* When Postman is used to POST the JSON payload as a simple test-case the following is printed into the logs (note that this was POST'd multiple times with different change values): bq. Nov 14, 2016 3:44:32 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange bq. Received trigger event: {"change":"202","p4port":"perf.mysite.com:1666"} bq. Nov 14, 2016 3:44:48 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange bq. Received trigger event: {"change":500,"p4port":"perf.mysite.com:1666"} However, nothing in the logs happens after that. I know that the [probeJobs](https://github.com/jenkinsci/p4-plugin/blob/master/src/main/java/org/jenkinsci/plugins/p4/trigger/P4Hook.java#L92) function works, as the Manual Trigger also invokes it and that is successfully printed. If I run the "Manual Configuration for Trigger" via the webpage, the following is printed into the logs: bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChangeSubmit bq. Manual trigger event: bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook probeJobs bq. P4: probing: MY_PROJECT bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Trigger poke bq. P4: poking: MY_PROJECT bq. Nov 14, 2016 3:50:04 PM INFO org.jenkinsci.plugins.p4.tasks.CheckoutTask getBuildChange bq. getBuildChange:return:726 bq. The only thing I can think of at this point is that it is not correctly retrieving the string for "p4port" variable, thus it never runs probeJobs when called from doChange. However, I cannot think of any reason the submitted JSON payloads would not work. |
New:
Hi all, We are unable to get P4 Triggered builds to work on our local Jenkin/Perforce setup. When the JSON payload is POST'd to /p4/change it does not trigger our builds which are set to "Perforce triggered build.", but using the "Manual Configuration for Trigger" does work. If I use the /p4/ url and the "Manual Configuration for Trigger" and specify the port as: "perf.mysite.com:1666", and the change as "200" (not entirely clear what this field is used for, any number seems to work) *this will cause the build to correctly trigger and fire*. We have tried both using cURL (as per the example) and Postman and neither of them can successfully trigger builds. This is the exact cUrl command we use: {quote}curl --header "Content-Type: application/json" --request POST --data "payload={change:200,p4port:\"perf.mysite.com:1666\"}" http://jenkins.mysite.com:8192/p4/change{quote} And Postman: POST /p4/change HTTP/1.1 Host: jenkins.mysite.com:8192 Content-Type: application/json Cache-Control: no-cache Postman-Token: 8425cf56-212f-f0fa-7007-b70a4591565e payload={"change":"500", "p4port" :"perf.mysite.com:1666"} *Job Setup:* It was set up as a freestyle job (inside of a folder, though moving the job to the root level does not resolve it) and the Perforce Credentials were chosen. A workspace name was assigned, and a View Mapping was applied. Under "Build Triggers", *only "Perforce triggered build." is checked*. *Logs:* When Postman is used to POST the JSON payload as a simple test-case the following is printed into the logs (note that this was POST'd multiple times with different change values): bq. Nov 14, 2016 3:44:32 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange bq. Received trigger event: {"change":"202","p4port":"perf.mysite.com:1666"} bq. Nov 14, 2016 3:44:48 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange bq. Received trigger event: {"change":500,"p4port":"perf.mysite.com:1666"} However, nothing in the logs happens after that. I know that the [probeJobs](https://github.com/jenkinsci/p4-plugin/blob/master/src/main/java/org/jenkinsci/plugins/p4/trigger/P4Hook.java#L92) function works, as the Manual Trigger also invokes it and that is successfully printed. If I run the "Manual Configuration for Trigger" via the webpage, the following is printed into the logs: bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChangeSubmit bq. Manual trigger event: bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook probeJobs bq. P4: probing: MY_PROJECT bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Trigger poke bq. P4: poking: MY_PROJECT bq. Nov 14, 2016 3:50:04 PM INFO org.jenkinsci.plugins.p4.tasks.CheckoutTask getBuildChange bq. getBuildChange:return:726 bq. The only thing I can think of at this point is that it is not correctly retrieving the string for "p4port" variable, thus it never runs probeJobs when called from doChange. However, I cannot think of any reason the submitted JSON payloads would not work. |
Description |
Original:
Hi all, We are unable to get P4 Triggered builds to work on our local Jenkin/Perforce setup. When the JSON payload is POST'd to /p4/change it does not trigger our builds which are set to "Perforce triggered build.", but using the "Manual Configuration for Trigger" does work. If I use the /p4/ url and the "Manual Configuration for Trigger" and specify the port as: "perf.mysite.com:1666", and the change as "200" (not entirely clear what this field is used for, any number seems to work) *this will cause the build to correctly trigger and fire*. We have tried both using cURL (as per the example) and Postman and neither of them can successfully trigger builds. This is the exact cUrl command we use: {quote}curl --header "Content-Type: application/json" --request POST --data "payload={change:200,p4port:\"perf.mysite.com:1666\"}" http://jenkins.mysite.com:8192/p4/change{quote} And Postman: POST /p4/change HTTP/1.1 Host: jenkins.mysite.com:8192 Content-Type: application/json Cache-Control: no-cache Postman-Token: 8425cf56-212f-f0fa-7007-b70a4591565e payload={"change":"500", "p4port" :"perf.mysite.com:1666"} *Job Setup:* It was set up as a freestyle job (inside of a folder, though moving the job to the root level does not resolve it) and the Perforce Credentials were chosen. A workspace name was assigned, and a View Mapping was applied. Under "Build Triggers", *only "Perforce triggered build." is checked*. *Logs:* When Postman is used to POST the JSON payload as a simple test-case the following is printed into the logs (note that this was POST'd multiple times with different change values): bq. Nov 14, 2016 3:44:32 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange bq. Received trigger event: {"change":"202","p4port":"perf.mysite.com:1666"} bq. Nov 14, 2016 3:44:48 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange bq. Received trigger event: {"change":500,"p4port":"perf.mysite.com:1666"} However, nothing in the logs happens after that. I know that the [probeJobs](https://github.com/jenkinsci/p4-plugin/blob/master/src/main/java/org/jenkinsci/plugins/p4/trigger/P4Hook.java#L92) function works, as the Manual Trigger also invokes it and that is successfully printed. If I run the "Manual Configuration for Trigger" via the webpage, the following is printed into the logs: bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChangeSubmit bq. Manual trigger event: bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook probeJobs bq. P4: probing: MY_PROJECT bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Trigger poke bq. P4: poking: MY_PROJECT bq. Nov 14, 2016 3:50:04 PM INFO org.jenkinsci.plugins.p4.tasks.CheckoutTask getBuildChange bq. getBuildChange:return:726 bq. The only thing I can think of at this point is that it is not correctly retrieving the string for "p4port" variable, thus it never runs probeJobs when called from doChange. However, I cannot think of any reason the submitted JSON payloads would not work. |
New:
Hi all, We are unable to get P4 Triggered builds to work on our local Jenkin/Perforce setup. When the JSON payload is POST'd to /p4/change it does not trigger our builds which are set to "Perforce triggered build.", but using the "Manual Configuration for Trigger" does work. If I use the /p4/ url and the "Manual Configuration for Trigger" and specify the port as: "perf.mysite.com:1666", and the change as "200" (not entirely clear what this field is used for, any number seems to work) *this will cause the build to correctly trigger and fire*. We have tried both using cURL (as per the example) and Postman and neither of them can successfully trigger builds. This is the exact cUrl command we use: curl --header "Content-Type: application/json" --request POST --data "payload={change:200,p4port:\"perf.mysite.com:1666\"}" http://jenkins.mysite.com:8192/p4/change And Postman: POST /p4/change HTTP/1.1 Host: jenkins.mysite.com:8192 Content-Type: application/json Cache-Control: no-cache Postman-Token: 8425cf56-212f-f0fa-7007-b70a4591565e payload={"change":"500", "p4port" :"perf.mysite.com:1666"} *Job Setup:* It was set up as a freestyle job (inside of a folder, though moving the job to the root level does not resolve it) and the Perforce Credentials were chosen. A workspace name was assigned, and a View Mapping was applied. Under "Build Triggers", *only "Perforce triggered build." is checked*. *Logs:* When Postman is used to POST the JSON payload as a simple test-case the following is printed into the logs (note that this was POST'd multiple times with different change values): bq. Nov 14, 2016 3:44:32 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange bq. Received trigger event: {"change":"202","p4port":"perf.mysite.com:1666"} bq. Nov 14, 2016 3:44:48 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange bq. Received trigger event: {"change":500,"p4port":"perf.mysite.com:1666"} However, nothing in the logs happens after that. I know that the [probeJobs](https://github.com/jenkinsci/p4-plugin/blob/master/src/main/java/org/jenkinsci/plugins/p4/trigger/P4Hook.java#L92) function works, as the Manual Trigger also invokes it and that is successfully printed. If I run the "Manual Configuration for Trigger" via the webpage, the following is printed into the logs: bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChangeSubmit bq. Manual trigger event: bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook probeJobs bq. P4: probing: MY_PROJECT bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Trigger poke bq. P4: poking: MY_PROJECT bq. Nov 14, 2016 3:50:04 PM INFO org.jenkinsci.plugins.p4.tasks.CheckoutTask getBuildChange bq. getBuildChange:return:726 bq. The only thing I can think of at this point is that it is not correctly retrieving the string for "p4port" variable, thus it never runs probeJobs when called from doChange. However, I cannot think of any reason the submitted JSON payloads would not work. |
Description |
Original:
Hi all, We are unable to get P4 Triggered builds to work on our local Jenkin/Perforce setup. When the JSON payload is POST'd to /p4/change it does not trigger our builds which are set to "Perforce triggered build.", but using the "Manual Configuration for Trigger" does work. If I use the /p4/ url and the "Manual Configuration for Trigger" and specify the port as: "perf.mysite.com:1666", and the change as "200" (not entirely clear what this field is used for, any number seems to work) *this will cause the build to correctly trigger and fire*. We have tried both using cURL (as per the example) and Postman and neither of them can successfully trigger builds. This is the exact cUrl command we use: curl --header "Content-Type: application/json" --request POST --data "payload={change:200,p4port:\"perf.mysite.com:1666\"}" http://jenkins.mysite.com:8192/p4/change And Postman: POST /p4/change HTTP/1.1 Host: jenkins.mysite.com:8192 Content-Type: application/json Cache-Control: no-cache Postman-Token: 8425cf56-212f-f0fa-7007-b70a4591565e payload={"change":"500", "p4port" :"perf.mysite.com:1666"} *Job Setup:* It was set up as a freestyle job (inside of a folder, though moving the job to the root level does not resolve it) and the Perforce Credentials were chosen. A workspace name was assigned, and a View Mapping was applied. Under "Build Triggers", *only "Perforce triggered build." is checked*. *Logs:* When Postman is used to POST the JSON payload as a simple test-case the following is printed into the logs (note that this was POST'd multiple times with different change values): bq. Nov 14, 2016 3:44:32 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange bq. Received trigger event: {"change":"202","p4port":"perf.mysite.com:1666"} bq. Nov 14, 2016 3:44:48 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange bq. Received trigger event: {"change":500,"p4port":"perf.mysite.com:1666"} However, nothing in the logs happens after that. I know that the [probeJobs](https://github.com/jenkinsci/p4-plugin/blob/master/src/main/java/org/jenkinsci/plugins/p4/trigger/P4Hook.java#L92) function works, as the Manual Trigger also invokes it and that is successfully printed. If I run the "Manual Configuration for Trigger" via the webpage, the following is printed into the logs: bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChangeSubmit bq. Manual trigger event: bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook probeJobs bq. P4: probing: MY_PROJECT bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Trigger poke bq. P4: poking: MY_PROJECT bq. Nov 14, 2016 3:50:04 PM INFO org.jenkinsci.plugins.p4.tasks.CheckoutTask getBuildChange bq. getBuildChange:return:726 bq. The only thing I can think of at this point is that it is not correctly retrieving the string for "p4port" variable, thus it never runs probeJobs when called from doChange. However, I cannot think of any reason the submitted JSON payloads would not work. |
New:
Hi all, We are unable to get P4 Triggered builds to work on our local Jenkin/Perforce setup. When the JSON payload is POST'd to /p4/change it does not trigger our builds which are set to "Perforce triggered build.", but using the "Manual Configuration for Trigger" does work. If I use the /p4/ url and the "Manual Configuration for Trigger" and specify the port as: "perf.mysite.com:1666", and the change as "200" (not entirely clear what this field is used for, any number seems to work) *this will cause the build to correctly trigger and fire*. We have tried both using cURL (as per the example) and Postman and neither of them can successfully trigger builds. This is the exact cUrl command we use: curl --header "Content-Type: application/json" --request POST --data "payload={change:200,p4port:\"perf.mysite.com:1666\"}" http://jenkins.mysite.com:8192/p4/change And Postman: POST /p4/change HTTP/1.1 Host: jenkins.mysite.com:8192 Content-Type: application/json Cache-Control: no-cache Postman-Token: 8425cf56-212f-f0fa-7007-b70a4591565e payload={"change":"500", "p4port" :"perf.mysite.com:1666"} *Job Setup:* It was set up as a freestyle job (inside of a folder, though moving the job to the root level does not resolve it) and the Perforce Credentials were chosen. A workspace name was assigned, and a View Mapping was applied. Under "Build Triggers", *only "Perforce triggered build." is checked*. *Logs:* When Postman is used to POST the JSON payload as a simple test-case the following is printed into the logs (note that this was POST'd multiple times with different change values): {quote}Nov 14, 2016 3:44:32 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange Received trigger event: {"change":"202","p4port":"perf.mysite.com:1666"} Nov 14, 2016 3:44:48 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange Received trigger event: {"change":500,"p4port":"perf.mysite.com:1666"}{quote} However, nothing in the logs happens after that. I know that the [probeJobs](https://github.com/jenkinsci/p4-plugin/blob/master/src/main/java/org/jenkinsci/plugins/p4/trigger/P4Hook.java#L92) function works, as the Manual Trigger also invokes it and that is successfully printed. If I run the "Manual Configuration for Trigger" via the webpage, the following is printed into the logs: bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChangeSubmit bq. Manual trigger event: bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook probeJobs bq. P4: probing: MY_PROJECT bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Trigger poke bq. P4: poking: MY_PROJECT bq. Nov 14, 2016 3:50:04 PM INFO org.jenkinsci.plugins.p4.tasks.CheckoutTask getBuildChange bq. getBuildChange:return:726 bq. The only thing I can think of at this point is that it is not correctly retrieving the string for "p4port" variable, thus it never runs probeJobs when called from doChange. However, I cannot think of any reason the submitted JSON payloads would not work. |
Description |
Original:
Hi all, We are unable to get P4 Triggered builds to work on our local Jenkin/Perforce setup. When the JSON payload is POST'd to /p4/change it does not trigger our builds which are set to "Perforce triggered build.", but using the "Manual Configuration for Trigger" does work. If I use the /p4/ url and the "Manual Configuration for Trigger" and specify the port as: "perf.mysite.com:1666", and the change as "200" (not entirely clear what this field is used for, any number seems to work) *this will cause the build to correctly trigger and fire*. We have tried both using cURL (as per the example) and Postman and neither of them can successfully trigger builds. This is the exact cUrl command we use: curl --header "Content-Type: application/json" --request POST --data "payload={change:200,p4port:\"perf.mysite.com:1666\"}" http://jenkins.mysite.com:8192/p4/change And Postman: POST /p4/change HTTP/1.1 Host: jenkins.mysite.com:8192 Content-Type: application/json Cache-Control: no-cache Postman-Token: 8425cf56-212f-f0fa-7007-b70a4591565e payload={"change":"500", "p4port" :"perf.mysite.com:1666"} *Job Setup:* It was set up as a freestyle job (inside of a folder, though moving the job to the root level does not resolve it) and the Perforce Credentials were chosen. A workspace name was assigned, and a View Mapping was applied. Under "Build Triggers", *only "Perforce triggered build." is checked*. *Logs:* When Postman is used to POST the JSON payload as a simple test-case the following is printed into the logs (note that this was POST'd multiple times with different change values): {quote}Nov 14, 2016 3:44:32 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange Received trigger event: {"change":"202","p4port":"perf.mysite.com:1666"} Nov 14, 2016 3:44:48 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange Received trigger event: {"change":500,"p4port":"perf.mysite.com:1666"}{quote} However, nothing in the logs happens after that. I know that the [probeJobs](https://github.com/jenkinsci/p4-plugin/blob/master/src/main/java/org/jenkinsci/plugins/p4/trigger/P4Hook.java#L92) function works, as the Manual Trigger also invokes it and that is successfully printed. If I run the "Manual Configuration for Trigger" via the webpage, the following is printed into the logs: bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChangeSubmit bq. Manual trigger event: bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook probeJobs bq. P4: probing: MY_PROJECT bq. Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Trigger poke bq. P4: poking: MY_PROJECT bq. Nov 14, 2016 3:50:04 PM INFO org.jenkinsci.plugins.p4.tasks.CheckoutTask getBuildChange bq. getBuildChange:return:726 bq. The only thing I can think of at this point is that it is not correctly retrieving the string for "p4port" variable, thus it never runs probeJobs when called from doChange. However, I cannot think of any reason the submitted JSON payloads would not work. |
New:
Hi all, We are unable to get P4 Triggered builds to work on our local Jenkin/Perforce setup. When the JSON payload is POST'd to /p4/change it does not trigger our builds which are set to "Perforce triggered build.", but using the "Manual Configuration for Trigger" does work. If I use the /p4/ url and the "Manual Configuration for Trigger" and specify the port as: "perf.mysite.com:1666", and the change as "200" (not entirely clear what this field is used for, any number seems to work) *this will cause the build to correctly trigger and fire*. We have tried both using cURL (as per the example) and Postman and neither of them can successfully trigger builds. This is the exact cUrl command we use: curl --header "Content-Type: application/json" --request POST --data "payload={change:200,p4port:\"perf.mysite.com:1666\"}" http://jenkins.mysite.com:8192/p4/change And Postman: POST /p4/change HTTP/1.1 Host: jenkins.mysite.com:8192 Content-Type: application/json Cache-Control: no-cache Postman-Token: 8425cf56-212f-f0fa-7007-b70a4591565e payload={"change":"500", "p4port" :"perf.mysite.com:1666"} *Job Setup:* It was set up as a freestyle job (inside of a folder, though moving the job to the root level does not resolve it) and the Perforce Credentials were chosen. A workspace name was assigned, and a View Mapping was applied. Under "Build Triggers", *only "Perforce triggered build." is checked*. *Logs:* When Postman is used to POST the JSON payload as a simple test-case the following is printed into the logs (note that this was POST'd multiple times with different change values): {quote}Nov 14, 2016 3:44:32 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange Received trigger event: {"change":"202","p4port":"perf.mysite.com:1666"} Nov 14, 2016 3:44:48 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange Received trigger event: {"change":500,"p4port":"perf.mysite.com:1666"}{quote} However, nothing in the logs happens after that. I know that the [probeJobs](https://github.com/jenkinsci/p4-plugin/blob/master/src/main/java/org/jenkinsci/plugins/p4/trigger/P4Hook.java#L92) function works, as the Manual Trigger also invokes it and that is successfully printed. If I run the "Manual Configuration for Trigger" via the webpage, the following is printed into the logs: {quote}Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChangeSubmit Manual trigger event: Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook probeJobs P4: probing: MY_PROJECT Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Trigger poke P4: poking: MY_PROJECT Nov 14, 2016 3:50:04 PM INFO org.jenkinsci.plugins.p4.tasks.CheckoutTask getBuildChange getBuildChange:return:726{quote} The only thing I can think of at this point is that it is not correctly retrieving the string for "p4port" variable, thus it never runs probeJobs when called from doChange. I cannot get it to print "p4port must be specified" in the logs, however I do not know if setting Jenkins log to /all includes Fine level logging or not. I cannot think of any reason the submitted JSON payloads would not work otherwise. |
Description |
Original:
Hi all, We are unable to get P4 Triggered builds to work on our local Jenkin/Perforce setup. When the JSON payload is POST'd to /p4/change it does not trigger our builds which are set to "Perforce triggered build.", but using the "Manual Configuration for Trigger" does work. If I use the /p4/ url and the "Manual Configuration for Trigger" and specify the port as: "perf.mysite.com:1666", and the change as "200" (not entirely clear what this field is used for, any number seems to work) *this will cause the build to correctly trigger and fire*. We have tried both using cURL (as per the example) and Postman and neither of them can successfully trigger builds. This is the exact cUrl command we use: curl --header "Content-Type: application/json" --request POST --data "payload={change:200,p4port:\"perf.mysite.com:1666\"}" http://jenkins.mysite.com:8192/p4/change And Postman: POST /p4/change HTTP/1.1 Host: jenkins.mysite.com:8192 Content-Type: application/json Cache-Control: no-cache Postman-Token: 8425cf56-212f-f0fa-7007-b70a4591565e payload={"change":"500", "p4port" :"perf.mysite.com:1666"} *Job Setup:* It was set up as a freestyle job (inside of a folder, though moving the job to the root level does not resolve it) and the Perforce Credentials were chosen. A workspace name was assigned, and a View Mapping was applied. Under "Build Triggers", *only "Perforce triggered build." is checked*. *Logs:* When Postman is used to POST the JSON payload as a simple test-case the following is printed into the logs (note that this was POST'd multiple times with different change values): {quote}Nov 14, 2016 3:44:32 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange Received trigger event: {"change":"202","p4port":"perf.mysite.com:1666"} Nov 14, 2016 3:44:48 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange Received trigger event: {"change":500,"p4port":"perf.mysite.com:1666"}{quote} However, nothing in the logs happens after that. I know that the [probeJobs](https://github.com/jenkinsci/p4-plugin/blob/master/src/main/java/org/jenkinsci/plugins/p4/trigger/P4Hook.java#L92) function works, as the Manual Trigger also invokes it and that is successfully printed. If I run the "Manual Configuration for Trigger" via the webpage, the following is printed into the logs: {quote}Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChangeSubmit Manual trigger event: Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook probeJobs P4: probing: MY_PROJECT Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Trigger poke P4: poking: MY_PROJECT Nov 14, 2016 3:50:04 PM INFO org.jenkinsci.plugins.p4.tasks.CheckoutTask getBuildChange getBuildChange:return:726{quote} The only thing I can think of at this point is that it is not correctly retrieving the string for "p4port" variable, thus it never runs probeJobs when called from doChange. I cannot get it to print "p4port must be specified" in the logs, however I do not know if setting Jenkins log to /all includes Fine level logging or not. I cannot think of any reason the submitted JSON payloads would not work otherwise. |
New:
Hi all, We are unable to get P4 Triggered builds to work on our local Jenkin/Perforce setup. When the JSON payload is POST'd to /p4/change it does not trigger our builds which are set to "Perforce triggered build.", but using the "Manual Configuration for Trigger" does work. If I use the /p4/ url and the "Manual Configuration for Trigger" and specify the port as: "perf.mysite.com:1666", and the change as "200" (not entirely clear what this field is used for, any number seems to work) *this will cause the build to correctly trigger and fire*. We have tried both using cURL (as per the example) and Postman and neither of them can successfully trigger builds. This is the exact cUrl command we use: curl --header "Content-Type: application/json" --request POST --data "payload={change:200,p4port:\"perf.mysite.com:1666\"}" http://jenkins.mysite.com:8192/p4/change And Postman: POST /p4/change HTTP/1.1 Host: jenkins.mysite.com:8192 Content-Type: application/json Cache-Control: no-cache Postman-Token: 8425cf56-212f-f0fa-7007-b70a4591565e payload={"change":"500", "p4port" :"perf.mysite.com:1666"} *Job Setup:* It was set up as a freestyle job (inside of a folder, though moving the job to the root level does not resolve it) and the Perforce Credentials were chosen. A workspace name was assigned, and a View Mapping was applied. Under "Build Triggers", *only "Perforce triggered build." is checked*. *Logs:* When Postman is used to POST the JSON payload as a simple test-case the following is printed into the logs (note that this was POST'd multiple times with different change values): Nov 14, 2016 3:44:32 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange Received trigger event: {"change":"202","p4port":"perf.mysite.com:1666"} Nov 14, 2016 3:44:48 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChange Received trigger event: {"change":500,"p4port":"perf.mysite.com:1666"} However, nothing in the logs happens after that. I know that the [probeJobs](https://github.com/jenkinsci/p4-plugin/blob/master/src/main/java/org/jenkinsci/plugins/p4/trigger/P4Hook.java#L92) function works, as the Manual Trigger also invokes it and that is successfully printed. If I run the "Manual Configuration for Trigger" via the webpage, the following is printed into the logs: Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook doChangeSubmit Manual trigger event: Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Hook probeJobs P4: probing: MY_PROJECT Nov 14, 2016 3:49:57 PM INFO org.jenkinsci.plugins.p4.trigger.P4Trigger poke P4: poking: MY_PROJECT Nov 14, 2016 3:50:04 PM INFO org.jenkinsci.plugins.p4.tasks.CheckoutTask getBuildChange getBuildChange:return:726 The only thing I can think of at this point is that it is not correctly retrieving the string for "p4port" variable, thus it never runs probeJobs when called from doChange. I cannot get it to print "p4port must be specified" in the logs, however I do not know if setting Jenkins log to /all includes Fine level logging or not. I cannot think of any reason the submitted JSON payloads would not work otherwise. |
Component/s | New: p4-plugin [ 19224 ] | |
Component/s | Original: perforce-plugin [ 15506 ] |
Assignee | Original: Rob Petti [ rpetti ] |
Assignee | New: Paul Allen [ p4paul ] |