Hi Mads,
They are in the order that they where added to the build (via
addAction(...) ) - but this is an implementation detail that is not in
the contract and there is nothing stopping any arbitrary code from
sorting or otherwise modifying the order of the list.
see
https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Actionable.java
If you need a specific BuildData - I would suggest you use
build.getAction*s*(BuildData.class) and then use logic in your plugin to
get the one you are most interested in.
Regards
/James
On 03/12/2014 11:30, Mads Nielsen wrote:
I have a question, how are Actions attributed to builds sorted?
for example i am working with the Multiple-SCM's plugin which can add
multiple GitSCM actions.
*/BuildData gitBuildData = build.getAction(BuildData.class);/*
*/
/*
*/'/*Gets the action (first instance to be found) of a specified type
that contributed to this build.'
So...for each job run i only want the newest (or the repository that
triggered the build) .
But for that to work, the actions would need to be sorted by date
created in Descending order.
--
You received this message because you are subscribed to the Google Groups "Jenkins
Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-dev/547EFB61.8090602%40teilo.net.
For more options, visit https://groups.google.com/d/optout.