Skip to content
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: add console command to storage category #10981

Merged
merged 15 commits into from
Jan 13, 2023

Conversation

fossamagna
Copy link
Contributor

Implements amplify storage console command.

Description of changes

Issue #, if available

fix #9900

Description of how you validated changes

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@fossamagna fossamagna requested a review from a team as a code owner September 7, 2022 14:05
@codecov-commenter
Copy link

codecov-commenter commented Sep 13, 2022

Codecov Report

Merging #10981 (2fefad9) into dev (3c39eba) will increase coverage by 0.03%.
The diff coverage is 64.70%.

@@            Coverage Diff             @@
##              dev   #10981      +/-   ##
==========================================
+ Coverage   47.82%   47.85%   +0.03%     
==========================================
  Files         669      670       +1     
  Lines       32678    32719      +41     
  Branches     6608     6614       +6     
==========================================
+ Hits        15627    15659      +32     
- Misses      15419    15428       +9     
  Partials     1632     1632              
Impacted Files Coverage Δ
packages/amplify-category-storage/src/index.ts 28.12% <52.00%> (+4.67%) ⬆️
...rage/src/provider-utils/awscloudformation/index.ts 29.24% <75.00%> (+12.37%) ⬆️
...y-category-storage/src/commands/storage/console.ts 100.00% <100.00%> (ø)
...li/src/domain/amplify-usageData/getUsageDataUrl.ts 100.00% <0.00%> (+12.50%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@edwardfoyle edwardfoyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @fossamagna thanks for the contribution! Functionally this change looks good to me, just a couple small nits to address.

@@ -41,8 +44,11 @@ export {
s3RemoveStorageLambdaTrigger,
} from './provider-utils/awscloudformation/service-walkthroughs/s3-resource-api';

/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: prefer to disable this lint rule for the file rather than have empty comment blocks

return;
}
const { tableName, region } = await prompter.pick<'one', Pickchoice['value']>("Select DynamoDB table to open on your browser", tables);
const url = `https://${region}.console.aws.amazon.com/dynamodbv2/home?region=${region}#table?initialTagKey=&name=${tableName}&tab=overview`;
Copy link
Contributor

@edwardfoyle edwardfoyle Sep 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the initialTagKey= query parameter needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its query parameter is not required, I will remove it.

@fossamagna
Copy link
Contributor Author

@edwardfoyle Thank you for your review.
I fixed according to your suggestions.

Copy link
Contributor

@edwardfoyle edwardfoyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for the churn, just one more thing then I think this is ready to go

Comment on lines 108 to 110
printer.info(err.stack);
printer.error('There was an error trying to open the storage web console.');
throw err;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for not catching this in the previous review. We have a new top-level error handler that will take care of printing stack traces and printing messages. This try/catch can be removed and the error handler will handle printing the message and the stacktrace

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edwardfoyle Thank you for your review.
I could not find where top-level error handling is. Am I missing somewhere?
Would you tell me where top-level error handling takes place?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you tell me where top-level error handling takes place?

I found the top-level error handling.

process.on('uncaughtException', handleException);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edwardfoyle I removed try-catch to use top-level error handling.

@fossamagna
Copy link
Contributor Author

@edwardfoyle I fixed according to your addition suggestions. Could you review this RP again ?

@fossamagna
Copy link
Contributor Author

@edwardfoyle Is this RP has blockers? Is there anything I can do to get my PR reviewed?
Thanks.

@fossamagna
Copy link
Contributor Author

@edwardfoyle I fixed according to your addition suggestions. Could you review this RP again ?

Copy link
Contributor

@jhockett jhockett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for the slow turnaround @fossamagna! I found a couple things I think need updating, but otherwise it LGTM. Thank you again for your contribution!

packages/amplify-category-storage/src/index.ts Outdated Show resolved Hide resolved
packages/amplify-category-storage/src/index.ts Outdated Show resolved Hide resolved
packages/amplify-category-storage/src/index.ts Outdated Show resolved Hide resolved
@fossamagna
Copy link
Contributor Author

@jhockett Thank you for your review. I corrected it in accordance with your suggestions.

@fossamagna fossamagna requested review from jhockett and removed request for edwardfoyle December 28, 2022 14:44
jhockett
jhockett previously approved these changes Dec 28, 2022
jhockett
jhockett previously approved these changes Jan 11, 2023
@jhockett jhockett requested a review from goldbez January 11, 2023 01:29
goldbez
goldbez previously approved these changes Jan 11, 2023
@goldbez
Copy link
Member

goldbez commented Jan 11, 2023

This looks good to me. I do see that the verify-extract-api test is failing. Can you please run yarn clean && yarn dev-build && yarn extract-api and then push to your branch to fix the issue?

@fossamagna fossamagna dismissed stale reviews from goldbez and jhockett via 4ed1598 January 12, 2023 00:20
@fossamagna
Copy link
Contributor Author

@goldbez Thanks. I run yarn clean && yarn dev-build && yarn extract-api and then push it.

@goldbez
Copy link
Member

goldbez commented Jan 12, 2023

@goldbez Thanks. I run yarn clean && yarn dev-build && yarn extract-api and then push it.

Thank you

@goldbez
Copy link
Member

goldbez commented Jan 12, 2023

@goldbez goldbez merged commit 7d7e94c into aws-amplify:dev Jan 13, 2023
@goldbez
Copy link
Member

goldbez commented Jan 13, 2023

Thank you for your contribution, @fossamagna

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Open AWS Management Console of S3 or DynamoDB service when run amplify storage console
5 participants