Maintain lock ordering when reporting in environment variables#301
Conversation
Fixes jenkinsci#300 : The order of the locked resources in the environment variable does not match the order in the extra parameter
Fixes jenkinsci#300 : The order of the locked resources in the environment variable does not match the order in the extra parameter
Fixes jenkinsci#300 : The order of the locked resources in the environment variable does not match the order in the extra parameter
Fixes jenkinsci#300 : The order of the locked resources in the environment variable does not match the order in the extra parameter
|
Nice catch, so a set vs. list, huh? |
|
yes - but after this is merged in, I will refactor this a bit. For now we just pass around a list (or set) of lock names, but with #299 we start having to pass around the properties as well. I'd like to allow each |
|
Released in 2.15. |
|
|
||
| public synchronized boolean lock( | ||
| Set<LockableResource> resources, Run<?, ?> build, @Nullable StepContext context) { | ||
| List<LockableResource> resources, Run<?, ?> build, @Nullable StepContext context) { |
There was a problem hiding this comment.
so I'm by no means a java person, but I am a dev who uses Jenkins.
can someone explain to me why this param type change from Set to List isn't considered a breaking change, or even worth a callout in the release notes?
it breaks groovy jobs like mine that call lock() directly because it was previously being created as a Set to match the API.
is this a release notes/documentation failure, or am I misusing the plugin maybe?
There was a problem hiding this comment.
Hi @joshsleeper
Definitely a failure to report in the release notes. While I am an experienced Java developer, I only just recently started contributing to Jenkins plugins. My experience with them is to only use operations exposed as steps, and I initially did not realize some people were calling internal plug-in methods directly and had backward compatibility expectations on them. I'll definitely be more careful to flag these breaking changes going forward and for now I can only apologize.
Gaspard
There was a problem hiding this comment.
no anger here and plenty of understanding~
this isn't the first upgrade of this plugin that's busted things for us, so figured we were better off calling it out in the hopes that it doesn't happen every time!
I would suggest, if possible, to consider updating the release notes to mention the breaking change~
after all, changing the calling pattern of anything that's public is a breaking change! 😆
that aside, jenkins plugin maintenance def isn't a job folks do for glory so thanks for all your hard work!
Fixes #300 : The order of the locked resources in the environment variable does not match the order in the extra parameter