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.
fix(stacks): update_stack_env defaults to merge-semantic to prevent variable data loss #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
fix(stacks): update_stack_env defaults to merge-semantic to prevent variable data loss #82
Changes from all commits
15d7549File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two key issues with the current merge implementation:
isSecret: true), and a partial update is performed on it without explicitly passingisSecret: true(since it is optional in the schema), the existingisSecretflag will be overwritten withundefined. This causes the variable to lose its secret status and potentially be written to the.envfile in plain text. Preserving the existingisSecretflag unless explicitly overridden is a crucial security safeguard.variablesis not an array (e.g.,null),existingVars.mapwill throw a runtimeTypeError. CheckingArray.isArray(existingVars)and filtering out any malformed entries prevents potential crashes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we updated the merge implementation to safely preserve the
isSecretflag, the regex in this test needs to be updated to be more flexible (matching just the key setting rather than expecting exactlyvas the second argument).Additionally, please note that static analysis tests (reading the source file and matching regexes) are highly fragile to refactoring, formatting, and variable name changes, and they do not verify actual runtime behavior (such as correct merging of properties or handling of edge cases). It is highly recommended to add real functional/unit tests using a mocked client to verify the actual runtime behavior of the tool.
Uh oh!
There was an error while loading. Please reload this page.