fix(parameters): honor auto transform in batched get_parameters_by_name - #8436
Open
MohammedAlkindi wants to merge 1 commit into
Conversation
transform="auto" infers the transform method from the parameter name suffix, but _transform_and_cache_get_parameters_response called transform_value() without key=name. The batched GetParameters path therefore inferred from an empty string and silently fell back to the identity transform, returning raw strings instead of parsed values. Parameters routed to the single GetParameter path (decrypt=True) already pass the key via BaseProvider.get(), so a single get_parameters_by_name call could return a parsed dict for some parameters and a raw string for others.
|
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
|
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.



Issue number: closes #8435
transform="auto"infers the transform from the parameter name suffix, but_transform_and_cache_get_parameters_responsecalledtransform_value()withoutkey=name. The batchedGetParameterspath therefore inferred from an empty string and fell back to the identity transform, returning raw strings with nothing raised. Parameters routed throughBaseProvider.get()(decrypt=True) already pass the key, so a singleget_parameters_by_namecall could return a parsed dict for some names and a raw string for others. #7083 fixed the argument-order bug in this function and coveredtransform="json";autowas not covered by that test. This was the onlytransform_value()call site omitting the key:BaseProvider.get()andsecrets.pypass it, andget_multiple()transforms a dict keyed per item.Fail-before, source reverted and the new test kept: 1 failed, the assertion showing the raw JSON string against the expected dict. Pass-after: 1 passed.
tests/functional/parameters/: 125 passed.ruff format --checkandruff check: clean.Not run here:
make mypy,make ty, and the e2e suite.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.