-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: Added --skip-prepare-infra to skip the prepare hook stage #4377
Merged
Merged
Changes from 9 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
763b04a
Added --skip-prepare-iac option
lucashuy b9b5087
Merge branch 'develop-terraform-hooks' of github.com:aws/aws-sam-cli …
lucashuy 175a8f8
Merge branch 'develop-terraform-hooks' of github.com:aws/aws-sam-cli …
lucashuy cd0783f
Updated and added more tests
lucashuy 1528b12
Added flag to invoke and start-lambda
lucashuy fbb5336
Moved skip prepare to terraform hook
lucashuy c1e7d45
Merge branch 'develop-terraform-hooks' of github.com:aws/aws-sam-cli …
lucashuy 176d643
Merge branch 'develop-terraform-hooks' of github.com:aws/aws-sam-cli …
lucashuy b7b3def
Added checks for default_map
lucashuy 6e1a242
Changed hook package to hook name and remove LOG assert
lucashuy 52a69af
Added log message if we provided --skip-prepare-infra but have no met…
lucashuy 0d581f6
Removed lingering extra decorator from earlier merge
lucashuy fb8e9c5
Merge branch 'develop-terraform-hooks' into skip_prepare
moelasmar e9ab359
Merge remote-tracking branch 'aws-sam-cli-public/develop-terraform-ho…
moelasmar 9382b7f
Merge remote-tracking branch 'aws-sam-cli-public/develop-terraform-ho…
moelasmar 14dafbe
Merge remote-tracking branch 'aws-sam-cli-public/develop-terraform-ho…
moelasmar 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 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 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 |
---|---|---|
|
@@ -200,6 +200,26 @@ def resolve_s3_callback(ctx, param, provided_value, artifact, exc_set, exc_not_s | |
return provided_value | ||
|
||
|
||
def skip_prepare_infra_callback(ctx, param, provided_value): | ||
""" | ||
Callback for --skip-prepare-infra to check if --hook-package-id is also specified | ||
|
||
Parameters | ||
---------- | ||
ctx: click.core.Context | ||
Click context | ||
param: click.Option | ||
Parameter properties | ||
provided_value: bool | ||
True if option was provided | ||
""" | ||
is_option_provided = provided_value or ctx.default_map.get("skip_prepare_infra") | ||
is_hook_provided = ctx.params.get("hook_package_id") or ctx.default_map.get("hook_package_id") | ||
|
||
if is_option_provided and not is_hook_provided: | ||
raise click.BadOptionUsage(option_name=param.name, ctx=ctx, message="Missing option --hook-package-id") | ||
|
||
|
||
def template_common_option(f): | ||
""" | ||
Common ClI option for template | ||
|
@@ -693,6 +713,25 @@ def decorator(f): | |
return composed_decorator(decorator_list) | ||
|
||
|
||
def skip_prepare_infra_click_option(): | ||
""" | ||
Click option to skip the hook preparation stage | ||
""" | ||
return click.option( | ||
"--skip-prepare-infra", | ||
is_flag=True, | ||
required=False, | ||
callback=skip_prepare_infra_callback, | ||
help="This option should be used to skip the preparation stage if there " | ||
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. Subject to change. |
||
"have not been any infrastructure changes. The --hook-name option should " | ||
"also be specified when using this option.", | ||
) | ||
|
||
|
||
def skip_prepare_infra_option(f): | ||
return skip_prepare_infra_click_option()(f) | ||
|
||
|
||
@parameterized_option | ||
def resolve_s3_option(f, guided=False): | ||
return resolve_s3_click_option(guided)(f) | ||
|
This file contains 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 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 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 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 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
Oops, something went wrong.
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.
--hook-package-id
to--hook-name