vars: Add matcher placeholder handling tests#7640
Merged
Merged
Conversation
mholt
approved these changes
Apr 10, 2026
Member
mholt
left a comment
There was a problem hiding this comment.
Thank you!
Happy to merge this as-is; one other thought I had is, do you think it's worth adding a test where a placeholder that accesses the query string is used? e.g. {http.request.uri.query.foo} -- obviously it shouldn't matter, but it should go to document that we've covered that case as well. (I actually got a duplicate report that used the query string, instead of the header, I presume because they did not realize the patch was universal.)
Member
Author
Would be worth. Will do so now. |
This was referenced May 11, 2026
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.
Adds focused regression coverage for #7629.
Summary
This adds table-driven tests for matcher-side placeholder handling in
varsandvars_regexp.The main goal is to cover the case where already-resolved values contain placeholder syntax such as
{env.SECRET}and must not be re-expanded by the matcher. It also adds a compatibility case to make sure matcher-side values still expand placeholders as before.Behaviour
Added coverage to verify that:
VarsMatcherdoes not re-expand resolved values from literal varsVarsMatcherdoes not re-expand resolved values from placeholder-key lookupsVarsMatcherstill expand placeholdersMatchVarsREdoes not re-expand resolved values from literal varsMatchVarsREdoes not re-expand resolved values from placeholder-key lookupsThese tests exercise the matcher boundary directly by injecting already-resolved values into
VarsCtxKeywhich matches the behavior changed in #7629.Assistance Disclosure
No AI was used.