You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[JENKINS-7004] cause not working in parameterized projects #19694
Code changed in hudson
User: : mindless
Path:
trunk/hudson/main/core/src/main/java/hudson/model/AbstractProject.java
trunk/hudson/main/core/src/main/java/hudson/model/ParametersDefinitionProperty.java
trunk/hudson/main/core/src/main/resources/hudson/model/BuildAuthorizationToken/config.jelly
trunk/www/changelog.html
http://jenkins-ci.org/commit/33032
Log:
[FIXED JENKINS-7004] Make /buildWithParameters support remote cause and
user supplied cause text for build via authentication token, just as /build does.
Code changed in hudson
User: : mindless
Path:
trunk/hudson/main/core/src/main/java/hudson/model/AbstractProject.java
trunk/hudson/main/core/src/main/java/hudson/model/ParametersDefinitionProperty.java
trunk/hudson/main/core/src/main/resources/hudson/model/BuildAuthorizationToken/config.jelly
trunk/www/changelog.html http://jenkins-ci.org/commit/33032
Log: [FIXED JENKINS-7004] Make /buildWithParameters support remote cause and
user supplied cause text for build via authentication token, just as /build does.
We've done some testing and reviewed the commits, and the Cause field does not seem to be fully supported on parameterized builds. As nakilon has said, the `cause` field does not work at all when using http auth via header or URL. The job MUST have a `token` assigned, and as amonsen has said, it MUST come before the `cause` parameter.
I suggest reopening this ticket.
We've done some testing and reviewed the commits, and the Cause field does not seem to be fully supported on parameterized builds. As nakilon has said, the `cause` field does not work at all when using http auth via header or URL. The job MUST have a `token` assigned, and as amonsen has said, it MUST come before the `cause` parameter.
This feature only exists for triggering builds via token and nowhere else, which is why it is part of that feature's documentation. Adding it elsewhere would be a feature request.
The job MUST have a `token` assigned
This feature only exists for triggering builds via token and nowhere else, which is why it is part of that feature's documentation. Adding it elsewhere would be a feature request.
My intent is to figure out if there is a way to monitor a job invocation accurately by either using the Queue ID returned as part of the Location and then retrieving the Build ID OR by passing a unique identifier to the Cause parameter.
What I find weird is that when there is a Quiet period in effect neither the Queue ID nor the Cause parameter behave as expected. Please see the attached sample test harness and its output.
There are 3 jobs invoked in parallel each a unique identifier for cause. This is is the outcome.
A. First job gets a successful build, the other 2 don't (presumably because of the Quiet period).
B. The First job is queryable through the Queue ID and the response does have the unique identifier passed in Cause.
C. However the second and third invocations get a status of 201 and have the same Queue ID of the first, with the response having all the 3 causes.
My intent is to figure out if there is a way to monitor a job invocation accurately by either using the Queue ID returned as part of the Location and then retrieving the Build ID OR by passing a unique identifier to the Cause parameter.
What I find weird is that when there is a Quiet period in effect neither the Queue ID nor the Cause parameter behave as expected. Please see the attached sample test harness and its output.
There are 3 jobs invoked in parallel each a unique identifier for cause. This is is the outcome.
A. First job gets a successful build, the other 2 don't (presumably because of the Quiet period).
B. The First job is queryable through the Queue ID and the response does have the unique identifier passed in Cause.
C. However the second and third invocations get a status of 201 and have the same Queue ID of the first, with the response having all the 3 causes.
The behavior described above is as designed, queue items are combined when they're considered identical, and causes combined as well. So if you pass the same build parameters (the Magic "cause" is not one of them) they will be combined.
The behavior described above is as designed, queue items are combined when they're considered identical, and causes combined as well. So if you pass the same build parameters (the Magic "cause" is not one of them) they will be combined.
In the above case when the queue items are combined is there any way to know that they are combined from the response when they are invoked ? All of them return a http status code of 201 (= Resource Created), so for sure this doesn't help.
In the above case when the queue items are combined is there any way to know that they are combined from the response when they are invoked ? All of them return a http status code of 201 (= Resource Created), so for sure this doesn't help.
Activity
jenkins-infra-bot commentedon Jul 16, 2010
anshnd:
Raw content of original comment:
assigning to parameters and not to unrelated parameterized-trigger
jenkins-infra-bot commentedon Jul 18, 2010
Raw content of original comment:
Code changed in hudson
User: : mindless
Path:
trunk/hudson/main/core/src/main/java/hudson/model/AbstractProject.java
trunk/hudson/main/core/src/main/java/hudson/model/ParametersDefinitionProperty.java
trunk/hudson/main/core/src/main/resources/hudson/model/BuildAuthorizationToken/config.jelly
trunk/www/changelog.html
http://jenkins-ci.org/commit/33032
Log:
[FIXED JENKINS-7004] Make /buildWithParameters support remote cause and
user supplied cause text for build via authentication token, just as /build does.
jenkins-infra-bot commentedon Nov 20, 2012
Raw content of original comment:
FYI, it appears cause must follow token in the query string or cause is discarded. For example:
works, but
discards cause.
jenkins-infra-bot commentedon Apr 9, 2015
Raw content of original comment:
Probably I have similar issue when passing credentials via base auth, not token.
jenkins-infra-bot commentedon Feb 6, 2019
Raw content of original comment:
We've done some testing and reviewed the commits, and the Cause field does not seem to be fully supported on parameterized builds. As nakilon has said, the `cause` field does not work at all when using http auth via header or URL. The job MUST have a `token` assigned, and as amonsen has said, it MUST come before the `cause` parameter.
I suggest reopening this ticket.
jenkins-infra-bot commentedon Mar 7, 2019
Raw content of original comment:
This feature only exists for triggering builds via token and nowhere else, which is why it is part of that feature's documentation. Adding it elsewhere would be a feature request.
jenkins-infra-bot commentedon Mar 10, 2019
cvijayan:
Raw content of original comment:
My intent is to figure out if there is a way to monitor a job invocation accurately by either using the Queue ID returned as part of the Location and then retrieving the Build ID OR by passing a unique identifier to the Cause parameter.
What I find weird is that when there is a Quiet period in effect neither the Queue ID nor the Cause parameter behave as expected. Please see the attached sample test harness and its output.
There are 3 jobs invoked in parallel each a unique identifier for cause. This is is the outcome.
A. First job gets a successful build, the other 2 don't (presumably because of the Quiet period).
B. The First job is queryable through the Queue ID and the response does have the unique identifier passed in Cause.
C. However the second and third invocations get a status of 201 and have the same Queue ID of the first, with the response having all the 3 causes.
jenkins-infra-bot commentedon Mar 10, 2019
cvijayan:
Raw content of original comment:
Should I open a new ticket or reopen this ticket ?
jenkins-infra-bot commentedon Mar 10, 2019
Raw content of original comment:
The behavior described above is as designed, queue items are combined when they're considered identical, and causes combined as well. So if you pass the same build parameters (the Magic "cause" is not one of them) they will be combined.
jenkins-infra-bot commentedon Mar 11, 2019
cvijayan:
Raw content of original comment:
In the above case when the queue items are combined is there any way to know that they are combined from the response when they are invoked ? All of them return a http status code of 201 (= Resource Created), so for sure this doesn't help.