-
Notifications
You must be signed in to change notification settings - Fork 559
Misc bugfixes #713
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
Merged
Merged
Misc bugfixes #713
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
74dce6d
Expand file paths during interactive secret registration
schustmi 0ac1f09
Fix type in github example
schustmi ef3e19f
Allow ~ and relative paths when passing files as secrets
schustmi 0702edd
Quote pip requirements during docker install
schustmi c45834d
Updating stack component now uses pydantic validation
schustmi 674f5c2
Update interactive secret registration message
schustmi 568abb0
Fix failing test
schustmi 39789d1
Fix typing issue
schustmi bfe0a86
Merge branch 'develop' into bugfix/misc-bugfixes
strickvl fb18279
Merge branch 'develop' into bugfix/misc-bugfixes
htahir1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -643,9 +643,13 @@ def update_stack_component_command( | |
| else: | ||
| continue | ||
|
|
||
| updated_component = component_wrapper.to_component().copy( | ||
| update=parsed_args | ||
| ) | ||
| # Initialize a new component object to make sure pydantic validation | ||
| # is used | ||
| new_attributes = { | ||
| **component_wrapper.to_component().dict(), | ||
| **parsed_args, | ||
| } | ||
|
Comment on lines
+648
to
+651
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice ! :) |
||
| updated_component = component_class(**new_attributes) | ||
|
|
||
| repo.update_stack_component( | ||
| name, updated_component.TYPE, updated_component | ||
|
|
@@ -721,9 +725,13 @@ def remove_attribute_stack_component_command( | |
| f"'{', '.join(optional_attributes)}'." | ||
| ) | ||
|
|
||
| updated_component = current_component.copy( | ||
| update={arg: None for arg in parsed_args} | ||
| ) | ||
| # Remove the attributes from the current component dict | ||
| new_attributes = { | ||
| **current_component.dict(), | ||
| **{arg: None for arg in parsed_args}, | ||
| } | ||
|
|
||
| updated_component = current_component.__class__(**new_attributes) | ||
|
|
||
| repo.update_stack_component( | ||
| name, updated_component.TYPE, updated_component | ||
|
|
||
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
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
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.
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.
When adding the ability to expand secret values from file contents, I was thinking of also doing it in the interactive mode, but then decided not to, because 1. you can't see what you're typing and 2. you don't get auto-completion to help you to point to an existing file on disk. These reasons make it really error prone to specify a path in interactive mode.
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.
Do you think it's better to remove it again? I've just without checking expected the interactive version to work the same way and tried copy-pasting the paths there with a prepended @ and got confused when it didn't work, that's why I implemented it.