Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 323759 - [build][hudson] support parsing of build parameters
Summary: [build][hudson] support parsing of build parameters
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 0.7   Edit
Assignee: Eike Stepper CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 328204
Blocks: 323568
  Show dependency tree
 
Reported: 2010-08-26 17:18 EDT by Steffen Pingel CLA
Modified: 2011-01-05 14:44 EST (History)
2 users (show)

See Also:


Attachments
Patch v1 - JSON form encoding missing (17.63 KB, patch)
2010-08-27 02:17 EDT, Eike Stepper CLA
steffen.pingel: iplog+
Details | Diff
all parameter types (2.90 KB, text/plain)
2010-08-31 14:48 EDT, Steffen Pingel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Pingel CLA 2010-08-26 17:18:05 EDT
From bug 323568: Hudson builds can have parameters (see attachment #1 [details]) that lead to a parameter entry page when a build is kicked (see attachment #2 [details]).

The connector should have support for parsing parameter definitions.
Comment 1 Eike Stepper CLA 2010-08-27 02:17:55 EDT
Created attachment 177585 [details]
Patch v1 - JSON form encoding missing
Comment 2 Eike Stepper CLA 2010-08-27 02:21:42 EDT
I confirm that I'm the only author of the contributed patch and that I apply the EPL to this contribution.
Comment 3 Steffen Pingel CLA 2010-08-27 03:51:12 EDT
I have applied the patch but added a guard around the retrieval of the configuration since this can fails if a user does not have the corresponding permissions. Since the required information is already provided in the original request for the list of plans I would prefer to parse it from there, e.g.: 

https://build.eclipse.org/hudson/api/xml?wrapper=hudson&depth=1&xpath=/hudson/job[name%3D%27emf-cdo-integration%27]&exclude=/hudson/job/build

The only information that seems to be missing is the type. What do you think?

I have tweaked RestfulHudsonClient.runBuild() to send a JSON representation of the request along which seems to be required by Hudson.
Comment 4 Eike Stepper CLA 2010-08-27 04:09:49 EDT
(In reply to comment #3)
> I have applied the patch but added a guard around the retrieval of the
> configuration since this can fails if a user does not have the corresponding
> permissions. 

Good catch! I generally wondered if request failures should be better indicated to the user. IIRC I've never received failure info in the Error Log or in a dialog...

> Since the required information is already provided in the original
> request for the list of plans I would prefer to parse it from there, e.g.: 
> 
> https://build.eclipse.org/hudson/api/xml?wrapper=hudson&depth=1&xpath=/hudson/job[name%3D%27emf-cdo-integration%27]&exclude=/hudson/job/build
> 
> The only information that seems to be missing is the type. What do you think?

Excellent idea! But we'd definitely need the type.

> I have tweaked RestfulHudsonClient.runBuild() to send a JSON representation of
> the request along which seems to be required by Hudson.

Thank you ;-)
Comment 5 Steffen Pingel CLA 2010-08-27 04:24:13 EDT
> Good catch! I generally wondered if request failures should be better indicated
> to the user. IIRC I've never received failure info in the Error Log or in a
> dialog...

I have that on my list of things to fix. BuildSchedulerUi is supposed to handle job results but the implementation is not yet complete.
Comment 6 Steffen Pingel CLA 2010-08-31 14:48:03 EDT
Created attachment 177874 [details]
all parameter types
Comment 7 Steffen Pingel CLA 2010-08-31 14:56:14 EDT
The run and file parameter types are not yet properly supported. Apparently the AJAX string for run parameters needs to specify the id of a particular run and files need to included in a multi-part mime post (see attachments).
Comment 8 Steffen Pingel CLA 2010-10-25 15:28:17 EDT
Let's close this bug for now. We can open other bugs to add support for addtional types. I have created bug 328204 to improve the Hudson API to provide parameter types in the job schema.