Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 323568 - [build] add support for parameterized builds
Summary: [build] add support for parameterized builds
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: 0.7   Edit
Assignee: Eike Stepper CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, noteworthy
Depends on: 323759 323781
Blocks:
  Show dependency tree
 
Reported: 2010-08-25 03:44 EDT by Eike Stepper CLA
Modified: 2011-01-05 14:44 EST (History)
1 user (show)

See Also:


Attachments
BuildParametersConfig.png (67.85 KB, image/png)
2010-08-25 03:44 EDT, Eike Stepper CLA
no flags Details
BuildParameters.png (80.71 KB, image/png)
2010-08-25 03:45 EDT, Eike Stepper CLA
no flags Details
PSF (4.47 KB, application/octet-stream)
2010-08-25 05:03 EDT, Eike Stepper CLA
no flags Details
Patch v1 - complete, but with 403 status on runBuild (459.34 KB, patch)
2010-08-26 13:39 EDT, Eike Stepper CLA
no flags Details | Diff
Patch v2 (17.35 KB, patch)
2010-08-27 02:16 EDT, Eike Stepper CLA
steffen.pingel: iplog+
Details | Diff
PSF (4.58 KB, application/octet-stream)
2010-08-27 02:33 EDT, Eike Stepper CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eike Stepper CLA 2010-08-25 03:44:44 EDT
Created attachment 177387 [details]
BuildParametersConfig.png

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]).

Kicking a build from the new Builds view within Eclipse *silently* fails to start such a parameterized build.
Comment 1 Eike Stepper CLA 2010-08-25 03:45:43 EDT
Created attachment 177388 [details]
BuildParameters.png

Steffen, I could not find a Bugzilla component for "Builds". Please move this bug to the appropriate place.
Comment 2 Eike Stepper CLA 2010-08-25 04:40:38 EDT
I've just found out how to query the job config by appending "config.xml" to the job URL, as in https://build.eclipse.org/hudson/job/emf-cdo-integration/config.xml
Comment 3 Eike Stepper CLA 2010-08-25 04:46:15 EDT
The parameter definitions can be found in the resulting XML:

   <project>
      <hudson.model.ParametersDefinitionProperty>
         <parameterDefinitions>

The following parameter types seem possible:

   FileParameterDefinition, 
   BooleanParameterDefinition, 
   ChoiceParameterDefinition, 
   JobParameterDefinition, 
   PasswordParameterDefinition, 
   RunParameterDefinition, 
   StringParameterDefinition

See also http://hudson-ci.org/javadoc/hudson/model/ParameterDefinition.html
Comment 4 Eike Stepper CLA 2010-08-25 04:58:06 EDT
I've stripped down the HTML of my build's parameters form for you:

<form method="post" action="build" name="parameters">
	<div name="parameter" description="">
		<input value="BUCKMINSTER_LOGLEVEL" type="hidden" name="name"/>
		<select name="value">
			<option value="INFO">INFO</option>
			<option value="WARNING">WARNING</option>
			<option value="ERROR">ERROR</option>
			<option value="DEBUG">DEBUG</option>
		</select>
	</div>
	<div name="parameter" description="">
		<input value="CLEAN_TOOLS" type="hidden" name="name"/>
		<input checked="true" class=" " type="checkbox" name="value"/>
	</div>
	<div name="parameter" description="">
		<input value="CLEAN_TP" type="hidden" name="name"/>
		<input checked="true" class=" " type="checkbox" name="value"/>
	</div>
	<div name="parameter" description="">
		<input value="CLEAN_WORKSPACE" type="hidden" name="name"/>
		<input checked="true" class=" " type="checkbox" name="value"/>
	</div>
	<div name="parameter" description="">
		<input value="CLEAN_OUTPUT" type="hidden" name="name"/>
		<input checked="true" class=" " type="checkbox" name="value"/>
	</div>
	<div name="parameter" description="">
		<input value="BUILD_TYPE" type="hidden" name="name"/>
		<select name="value">
			<option value="N">N</option>
			<option value="I">I</option>
			<option value="S">S</option>
			<option value="R">R</option>
		</select>
	</div>
	<div name="parameter" description="">
		<input value="BUILD_TARGET" type="hidden" name="name"/>
		<select name="value">
			<option value="test">test</option>
			<option value="site.p2">site.p2</option>
			<option value="provision">provision</option>
			<option value="promote.sites">promote.sites</option>
		</select>
	</div>
	<div name="parameter" description="">
		<input value="SITE_PACK200" type="hidden" name="name"/>
		<input checked="true" class=" " type="checkbox" name="value"/>
	</div>
	<input value="Build" class="submit-button" type="submit" name="Submit"/>
</form>
Comment 5 Eike Stepper CLA 2010-08-25 05:03:20 EDT
Created attachment 177394 [details]
PSF

For my own convenience ;-)
Comment 6 Steffen Pingel CLA 2010-08-25 13:40:34 EDT
Thanks for the detailed feature request. I am not sure if we would want to support a native interface for providing the parameter controls but it would be nice to at least delegate to the browser if running a build requires additional input.

Thanks so much for creating the PSF! I'll upload that to our website. You can tag all Hudson/Builds related bugs as [build] for now. We'll move those to a separate component once we have figured out how to proceed with the Mylyn project restructuring.
Comment 7 Eike Stepper CLA 2010-08-25 13:53:43 EDT
(In reply to comment #6)
> Thanks for the detailed feature request. 

You're welcome ;-)

> I am not sure if we would want to
> support a native interface for providing the parameter controls

But that would make it way more acceptable. I know that many projects at Eclipse use parameters. I'm willing to help...
Comment 8 Steffen Pingel CLA 2010-08-25 20:23:10 EDT
> > I am not sure if we would want to
> > support a native interface for providing the parameter controls
> 
> But that would make it way more acceptable. I know that many projects at Eclipse
> use parameters. I'm willing to help...

Great to hear :). I should have phrased that better... A native interface would certainly be preferable but I would expect that to require significantly more effort than browser based solution. That said, if anyone is interested in working on this, it would be a very welcome enhancement.
Comment 9 Eike Stepper CLA 2010-08-26 13:39:12 EDT
Created attachment 177546 [details]
Patch v1 - complete, but with 403 status on runBuild
Comment 10 Steffen Pingel CLA 2010-08-26 17:17:24 EDT
Thanks. Please try adding this call after createPostMethod(getJobUrl(job) + "/build") to fix the 403: method.setDoAuthentication(true); . It looks like Hudson responds with a 302 to the post request on success, probably need to fix the check

Looks good overall. I'll post some more feedback later today.
Comment 11 Eike Stepper CLA 2010-08-27 02:16:12 EDT
Created attachment 177584 [details]
Patch v2

stripped down to builds.core
Comment 12 Eike Stepper CLA 2010-08-27 02:21:29 EDT
I confirm that I'm the only author of the contributed patch and that I apply the EPL to this contribution.
Comment 13 Eike Stepper CLA 2010-08-27 02:33:55 EDT
Created attachment 177588 [details]
PSF

added JSON from Orbit
Comment 14 Steffen Pingel CLA 2010-08-27 02:51:22 EDT
Thanks a lot! I have applied the patch and re-generated the model. I changed for requesting a build slightly to take a request object so we can extend it in the future, e.g. to add support for specifying a delay.