fix(options): merge RunTags across config layers instead of replacing#5714
Open
yordis wants to merge 1 commit intografana:masterfrom
Open
fix(options): merge RunTags across config layers instead of replacing#5714yordis wants to merge 1 commit intografana:masterfrom
yordis wants to merge 1 commit intografana:masterfrom
Conversation
Previously, Options.Apply replaced RunTags wholesale, so any higher-priority layer (env var or CLI flag) would silently discard all tags set in lower-priority layers (e.g. options.tags in the script). Tags now merge per-key, with the higher-priority layer winning on collision, consistent with the documented order of precedence. Closes grafana#2694
4e14c5b to
cb2e307
Compare
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.
What?
Options.Applypreviously replacedRunTagswholesale when a higher-priority layer set any tags. This causedoptions.tagsin a script to be silently discarded whenever--tagorK6_TAGSwas also used.Tags are now merged per-key across all config layers.
Why?
Per the order of precedence, higher-priority layers should win on conflict — not erase everything from lower-priority layers. Every other map-type option (e.g.
Thresholds) replaces wholesale because replacement is the right semantic there. For tags the user expectation is additive: script setsenv=staging, CLI addsteam=backend, both should appear.Checklist
make check) and all pass.Checklist: Documentation (only for k6 maintainers and if relevant)
Please do not merge this PR until the following items are filled out.
Related PR(s)/Issue(s)
Closes #2694
instance_id/job_nametags via CLI which wiped script-level tags for operator users