Skip to main content



      Home
Home » Archived » Hudson » Hudson job build ID
Hudson job build ID [message #1058288] Mon, 13 May 2013 09:17 Go to next message
Eclipse UserFriend
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 #1058356 is a reply to message #1058288] Mon, 13 May 2013 12:08 Go to previous messageGo to next message
Eclipse UserFriend
There is a BUILD_ID environment variable set by Run. Does it do what you want?

Started by user anonymous
Building on master
[workspace] $ /bin/sh -xe /var/folders/0q/w6ps9wr522149s4h2dm5fvg80000gn/T/hudson16113398879048111.sh
+ echo BUILD_ID=2013-05-13_09-06-25
BUILD_ID=2013-05-13_09-06-25
Finished: SUCCESS
Re: Hudson job build ID [message #1058365 is a reply to message #1058356] Mon, 13 May 2013 13:51 Go to previous message
Eclipse UserFriend
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...
Previous Topic:Hudson (v1.395.1) - multiple JDKs
Next Topic:Upgrade Hudson 1.386 to latest hudson 3.0
Goto Forum:
  


Current Time: Tue Jul 08 06:10:03 EDT 2025

Powered by FUDForum. Page generated in 0.04837 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top