Skip to content

Add runtime attribute for locked resources and allow multiple locks#303

Closed
bgalamb wants to merge 4 commits intojenkinsci:masterfrom
bgalamb:feature/add_runtime_attributes
Closed

Add runtime attribute for locked resources and allow multiple locks#303
bgalamb wants to merge 4 commits intojenkinsci:masterfrom
bgalamb:feature/add_runtime_attributes

Conversation

@bgalamb
Copy link

@bgalamb bgalamb commented Feb 7, 2022

Added runtime attribute support for functionality #302

  • Added attribute to resource Object

  • Changed logic to return resource if it contains the needed attribute even if it's locked

  • Changed build reference of Resource to list type List<Run> from Run

  • Changed locked by externalID of resource to List from String

  • Adjusted methods to work with lists

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!

  • Ensure that the pull request title represents the desired changelog entry

  • Please describe what you did

  • Link to relevant issues in GitHub or Jira

  • Link to relevant pull requests, esp. upstream and downstream changes

  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@jimklimov jimklimov added the extended properties Ideas about more aspects of the lockable resource instances than we had before label Feb 8, 2022
@jimklimov
Copy link
Contributor

This seems to address a similar problem space as #299 (and #20 before it) - but for a somewhat different (or just more specific?) use-case that looks closer to agent/SUT deployment details than lockable resources generally.

Sanity-check: can this goal be implemented on top of that mechanism, to avoid adding vaguely similar fields? Or is it truly different enough?

@bgalamb
Copy link
Author

bgalamb commented Feb 8, 2022

@jimklimov . I think this PR tries to solve a different problem... The linked PR's - #299 (and #20 - add "static" attributes to the lockable resources that you can retrieve into env vars inside the lock block, to get specific and unchangeable values that belong to the given resource.

But this PR is about adding "dynamic" attributes to the resource that live until the/any lock is present.
Normally if a lock is present on a resource then all others jobs would need to wait until it's released even if they require basically the same.

So with this change multiple jobs could lock the same resource (if label and attributes are matching) and can run in parallel.
(I described the use case in #302)

@jimklimov jimklimov added the got conflicts Feature/fix may be reasonable, but can not be merged cleanly label Mar 21, 2022
@mPokornyETM mPokornyETM added the Triage Need to clarify, remove, close or whatever to clean up open issues / PRs label Feb 1, 2023
@mPokornyETM mPokornyETM added this to the Triage milestone Feb 1, 2023
@bgalamb bgalamb closed this by deleting the head repository Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extended properties Ideas about more aspects of the lockable resource instances than we had before got conflicts Feature/fix may be reasonable, but can not be merged cleanly Triage Need to clarify, remove, close or whatever to clean up open issues / PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants