Hudson job build ID [message #1058288] |
Mon, 13 May 2013 09:17  |
Eclipse User |
|
|
|
Team,
I'm developing an integration to Hudson, and during my development I found an issue that seems to be discussed several times but no fair solution on that.
My integration (probably many others) submits a job (and its parameters). But it needs a safe build ID that could be tracked in all stages of a hudson build - queue and builds.
The feature of getting next build number works but is not reliable. I have situations when having two or more tasks in queue (waiting for processing) the nextBuildNumber becomes invalidated from the integration logic perspective just bc/ I can't associate the buidNumber with the right job request in integration side.
<timestamp>: when a job is in queue, normally I see the timestamp there. But also, it's not reliable, since it is NEVER propagated when the job is executed. I see it changes to a <id> but the data type differ: timestamp is a datetime encoded as millis since epoch; <id> is datetime encoded as string (yyyy-mm-dd_hh-mi-ss) without millis.
Due legacy (old job settings), I can't create a new parameter to track the build request with a data from my own.
So I came to this forum and I ask:
- Is there any means to get a safe build id that can be trackeable along the job execution lifecycle?
- Is there a plugin that I simply instantiate it and all jobs, regardless of configuration could implement this ID?
- Is there any means to pass a HTTP parameter that could be processed by hudson without being declared as a job configurable parameter?
|
|
|
|
Re: Hudson job build ID [message #1058365 is a reply to message #1058356] |
Mon, 13 May 2013 13:51  |
Eclipse User |
|
|
|
No.. it doesn't work. I can't set this value when submitting the job, creating a traceability of the request.
Just to explay better, here's an excerpt of the request IN QUEUE in JSON format (sensitive fields trimmed):
{"items":[{"actions":[{"parameters":[---TRIMMED---]},{"causes":[{"shortDescription":"Started by user XXXX","userName":"XXX"}]}],"blocked":false,"buildable":false,"params":"---TRIMMED---","stuck":false,"task":{"name":"JOBNAME","url":"http_:_//<server>/hudson/job/JOBNAME/","color":"blue"},"why":"In the quiet period. Expires in 1.3 sec","timestamp":1368466145782}]}
Now the request when executed
{"actions":[{"parameters":[]},{"causes":[]},{}],"artifacts":[],"building":false,"description":null,"duration":47023,"fullDisplayName":"JOBNAME #419","id":"2013-05-13_12-29-05","keepLog":false,"number":419,"result":"SUCCESS","timestamp":1368466145805,"url":"http_:_//SERVER/hudson/job/JOBNAME/419/","builtOn":"","changeSet":{"items":[],"kind":null},"culprits":[]}
See the field id, it's the BUILD_ID... I supposed "timestamp" never changed... but it changes. There's no means to properly identify both records in the hudson job execution lifecycle unless doing the parameter comparison, assuming no one submitted same job twice in a short period of time...
|
|
|
Powered by
FUDForum. Page generated in 0.04837 seconds