-
Notifications
You must be signed in to change notification settings - Fork 1.2k
small UX improvements: #2914
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
small UX improvements: #2914
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
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 |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
| import click | ||
|
|
||
| from samcli.lib.config.samconfig import SamConfig | ||
| from samcli.lib.utils.colors import Colored | ||
| from samcli.lib.utils.managed_cloudformation_stack import manage_stack, StackOutput | ||
| from .resource import Resource, IAMUser, ECRImageRepository | ||
|
|
||
|
|
@@ -94,6 +95,7 @@ def __init__( | |
| self.artifacts_bucket: Resource = Resource(arn=artifacts_bucket_arn) | ||
| self.create_image_repository: bool = create_image_repository | ||
| self.image_repository: ECRImageRepository = ECRImageRepository(arn=image_repository_arn) | ||
| self.color = Colored() | ||
|
|
||
| def did_user_provide_all_required_resources(self) -> bool: | ||
| """Check if the user provided all of the environment resources or not""" | ||
|
|
@@ -138,7 +140,7 @@ def bootstrap(self, confirm_changeset: bool = True) -> bool: | |
|
|
||
| if self.did_user_provide_all_required_resources(): | ||
| click.secho( | ||
| f"\nAll required resources for the {self.name} environment exist, skipping creation.", fg="yellow" | ||
| self.color.yellow(f"\nAll required resources for the {self.name} environment exist, skipping creation.") | ||
|
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. Just curious are there any differences between using
Contributor
Author
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. No difference in the functionality. Just cleaner code. |
||
| ) | ||
| return True | ||
|
|
||
|
|
@@ -150,6 +152,7 @@ def bootstrap(self, confirm_changeset: bool = True) -> bool: | |
| if confirm_changeset: | ||
| confirmed: bool = click.confirm("Should we proceed with the creation?") | ||
| if not confirmed: | ||
| click.secho(self.color.red("Canceling pipeline bootstrap creation.")) | ||
| return False | ||
|
|
||
| environment_resources_template_body = Environment._read_template(ENVIRONMENT_RESOURCES_CFN_TEMPLATE) | ||
|
|
@@ -272,28 +275,30 @@ def print_resources_summary(self) -> None: | |
| created_resources.append(resource) | ||
|
|
||
| if created_resources: | ||
| click.secho("\nWe have created the following resources:", fg="green") | ||
| click.secho(self.color.green("\nWe have created the following resources:")) | ||
| for resource in created_resources: | ||
| click.secho(f"\t{resource.arn}", fg="green") | ||
|
|
||
| if provided_resources: | ||
| click.secho( | ||
| "\nYou provided the following resources. Please make sure it has the required permissions as shown at " | ||
| "https://github.com/aws/aws-sam-cli/blob/develop/" | ||
| "samcli/lib/pipeline/bootstrap/environment_resources.yaml", | ||
| fg="green", | ||
| self.color.green( | ||
| "\nYou provided the following resources. Please make sure it has the required permissions " | ||
| "as shown at https://github.com/aws/aws-sam-cli/blob/develop/" | ||
| "samcli/lib/pipeline/bootstrap/environment_resources.yaml", | ||
| ) | ||
| ) | ||
| for resource in provided_resources: | ||
| click.secho(f"\t{resource.arn}", fg="green") | ||
| click.secho(self.color.green(f"\t{resource.arn}")) | ||
|
|
||
| if not self.pipeline_user.is_user_provided: | ||
| click.secho( | ||
| "Please configure your CI/CD project with the following pipeline user credentials and " | ||
| "make sure to periodically rotate it:", | ||
| fg="green", | ||
| self.color.green( | ||
| "Please configure your CI/CD project with the following pipeline user credentials and " | ||
| "make sure to periodically rotate it:", | ||
| ) | ||
| ) | ||
| click.secho(f"\tACCESS_KEY_ID: {self.pipeline_user.access_key_id}", fg="green") | ||
| click.secho(f"\tSECRET_ACCESS_KEY: {self.pipeline_user.secret_access_key}", fg="green") | ||
| click.secho(self.color.green(f"\tACCESS_KEY_ID: {self.pipeline_user.access_key_id}")) | ||
| click.secho(self.color.green(f"\tSECRET_ACCESS_KEY: {self.pipeline_user.secret_access_key}")) | ||
|
|
||
| def _get_stack_name(self) -> str: | ||
| sanitized_environment_name: str = re.sub("[^0-9a-zA-Z]+", "-", self.name) | ||
|
|
||
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
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.
Might add a brief comment here just like all exceptions above?