feat: Support build parameters in resource names, labels, and numbers#972
Merged
mPokornyETM merged 5 commits intomasterfrom Apr 3, 2026
Merged
feat: Support build parameters in resource names, labels, and numbers#972mPokornyETM merged 5 commits intomasterfrom
mPokornyETM merged 5 commits intomasterfrom
Conversation
Contributor
Author
Contributor
|
|
997e67f to
7ddfe2a
Compare
Contributor
|
⏸️ Auto-merge countdown PAUSED: CI checks are not passing. The countdown will resume when all checks are green. |
Allow references in the Required Lockable Resources job property so that resource names, labels, and resource numbers can be resolved from build parameters at queue time and build start. Changes: - Utils: add requiredResources(Job, EnvVars) overload and getParametersAsEnvVars(Queue.Item) to extract build parameters - LockableResourcesStruct: expand requiredNumber via env.expand() - LockableResourcesQueueTaskDispatcher: pass build parameters from queue item to resource struct for early expansion - LockRunListener: pass AbstractBuild environment to resource struct so parameter references are expanded at build start - RequiredResourcesProperty: form validation now recognises \ patterns and shows a warning instead of an error - Messages.properties: add warning messages for parameter references - Tests: add parameterizedResourceName, parameterizedLabel, parameterizedResourceNumber tests and UtilsTest.containsVariable Fixes #159, Fixes #202 Replaces #214
- Utils.getParametersAsEnvVars: remove unnecessary try-catch (APIs do not throw checked exceptions) - LockRunListener.onStarted: catch IOException | InterruptedException instead of generic Exception
Add 7 new test methods covering all code paths: - No actions (empty list) - Single parameter - Multiple parameters in one action - Multiple ParametersAction instances - Null parameter value (skipped) - Non-string value (converted via toString) - Duplicate key across actions (later wins) Also fix @NoExternalUse annotations to use @restricted(NoExternalUse.class) and add missing imports for ExcludeFromJacocoGeneratedReport.
7ddfe2a to
c995a5c
Compare
Contributor
|
✅ Auto-approved: No review received within 3 days. Merging now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Linked issues
Fixes #159 — Allow to specify resource and label by build parameter
Fixes #202 — Allow build parameters as resource/label/number
Replaces #214 — Clean re-implementation on current master
Description
Allows \\ references in the Required Lockable Resources job property so that resource names, labels, and resource numbers can be resolved from build parameters at queue time and build start.
Changes
How it works
equiredNumber\
Differences from PR #214
Testing
Checklist