[JENKINS-31437] Assign properties to lockable resources and retrieve them in environment variables#299
Conversation
|
Please hold - this change exacerbates the randomness of the lock ordering in the env variable; I will fix the current issue in master first and fix here after |
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
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
|
Ok - fixed. This change would have caused regression against #301 |
|
You desserve the revival or wakeup the deads badge ;-) Congrats. |
|
@gaspardpetit : given the comments in #301, is this PR good to merge already (e.g. for #303/#302 to build upon, if suitable) or better delay until you complete the bigger idea here first? |
|
This one is ready to go, it's a nice improvement to the plugin already :) |
|
If #307 makes it to the master branch, I am now wondering if we need to output properties to environment variables - we could instead make it easy to This would soft of make the |
|
Sounds cool, but I think one downside could be generally about scripted vs declarative pipelines. Although in this particular use-case, you "declare" that you want a @abayer : if we might bother someone more keen on pure-declarative code for an opinion? ;) |
|
The most problematic flaw I see with the existing design is that the result is unpredictable. If you ask for a single lock, or N of a single lock label, it's fine. But when you mix the This makes using environment variables for the result almost impossible because you can't predict how many locks you will actually get. The If we do continue with environment variables, we will need to define very well how the |
|
Hi @gaspardpetit, in case you couldn't tell, I'm more of an interim maintainer than a maintainer for this plugin. If you want commit access to be able to merge and release PRs for this plugin, feel free to file a |
|
Sorry about mostly falling out of the loop, recent months were hectic :\ Hope to catch up in the coming weeks... |
|
@basil no worries, I understand - I find this plugin useful and I have java experience, so I'd be happy to give a hand on reviewing and approving some of the PR; Sorry for asking, I have never before asked for such permission, can you explain how I can request "repository-permissions-updater" permission on github? |
|
Hi @gaspardpetit, I highly appreciate your contributions to this plugin. This page documents the procedure; namely, submit a PR on the "Repository Permission Updater" (RPU) repository. Feel free to at-mention me on the PR and I will approve it. Once you have commit access, you will be able to merge PRs and perform releases. Feel free to reach out to me or any other members of the Jenkins core development team if you have any questions about Jenkins plugin development that are not answered in the Jenkins developer reference. |
|
Hi @gaspardpetit, are you still interested in adopting this plugin? |
|
+1 from me, hectic time here switching from one job to another to another... too long without a laptop of my own :\ |
|
@gaspardpetit are you still interested to conrtibut? |
|
Yes, even though my time will be limited I'm happy the help. I still haven't figured out how to request the role though 😅 |
|
I am one of the owners now. And very interested to improve this plugin (now).
I try to do my best, but I am still missing some other developers here. Approve own changes without review makes no sense. I think when we merge currently opened PRs and solve some issues, the maintenance here will be fine. It looks terrible at the moment. |
|
Thank you for dedicating time to this plugin. I will update my pending reviews during the week and also consider the feedback left on them. |
(This replaces #295 with a simplified commit history)
This is pretty much #20 updated for HEAD - most of the credits go to @McFoggy
I recommend reviewing this after #294 since it will simplify the complexity of this PR. #294 adds an environment variable for each acquired locks when unlocking multiple ones, and this PR builds on this change.
The lock properties can be set on the lock definition in the System Configuration;
When setting a
variable, the name of the variable is used as a prefix to also set an environment variable for each of the lockable resource's properties. For example:We plan on using these properties to store information such as the IP, URL or an account to use with the lockable resource obtained.