|
I am developing a plugin to customize the build process. The jenkins version for the plugin is 1.466.
The plugin should show a custom page with fixed parameters and the normal parameters defined at job, before starting the build, without having to define (the fixed parameters) as parameterized build. My problem is the following: 1) At jobs view (http://localhost/jenkins), the build link (schedule execution) renders:
And when I click the link sends EVER a GET request, although the job is not a parameterized build. 2) When I enter at job view in jenkins (http://localhost/jenkins/job/jobName), the build link renders: * When the job isn't a parameterized build:
There is an extra onclick="return build(this)", that launch a POST request. * When the job is a parameterized build: <a href="/jenkins/job/aaa/build?delay=0sec"> ... </a> There is no the extra onclick, so launch a GET request. To reproduce this problem you must: Create a new project of any type (for example, Maven 2 project), that it is not a parameterized build. Save changes. Examine the Build now link. It has the extra onclick="return build(this)". Now add a text parameter. Save changes. Examine the Build now link. It hasn't the extra onclick="return build(this)". I was examining the code hudson/model/AbstractProject.java (tag 1.466), for my plugin, the key is the method:
and following that, hudson/model/ParametersDefinitionProperty.java
So we see the req.getMethod.equals("POST") is the solution for my problem, but Jenkins render different links that launch GET call at jobs view and GET or POST call at job view. So my code is not working when I launch the build from job view. |
|
Sorry. It was a problem of my error code.
This thread can be closed. El jueves, 30 de agosto de 2012 10:18:32 UTC+2, Ramón Rial escribió: I am developing a plugin to customize the build process. The jenkins version for the plugin is 1.466. |
|
In reply to this post by Ramón Rial
The problem is still there. My last post was not ok. So I think there is a bug.
I understand that the AJAX call is great for user experience, but it is an incoherence two different calls for the same action: one GET and one POST. And when the only way to detect if we sended the parameters (build parameterized) is the method call, that for now works great because it has no considered the posibility of showing a similar page when there are no build parameters. El jueves, 30 de agosto de 2012 10:18:32 UTC+2, Ramón Rial escribió: I am developing a plugin to customize the build process. The jenkins version for the plugin is 1.466. |
| Powered by Nabble | Edit this page |
