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: usage flow logging for interactive and non-interactive cli commands #10288

Merged
merged 23 commits into from
May 5, 2022

Conversation

sachscode
Copy link
Contributor

Description of changes

  1. CLI Flow logging in "@amplify-cli/prompter" library.
    note: Only the interactive flows which use the amplify-prompter library will be journaled . Other flows will be ported to use the prompter library.
  2. Non-interactive CLI Flow logging for categories: Auth, Storage, Geo , Functions, API-REST, API-GraphQL.
  3. amplify-cli-shared-interfaces package to share common interfaces between categories.

Issue #, if available

Description of how you validated changes

  1. Manually validated interactive and non-interactive test data is available in Beta testing S3 bucket.
  2. Manually validated all sensitive information is redacted in the testing Bucket.
  3. Unit-tests for interactive and non-interactive flows.

Checklist

  • [* ] PR description included
  • [*] yarn test passes
  • [*] Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)
  • New AWS SDK calls or CloudFormation actions have been added to relevant test and service IAM policies

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

@lgtm-com
Copy link

lgtm-com bot commented Apr 25, 2022

This pull request introduces 5 alerts when merging b5e475d into 0909769 - view on LGTM.com

new alerts:

  • 5 for Unused variable, import, function or class

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.

Overall looks good. Left some small comments.

My main concern is I'm not sure that the flowData object should be accessed directly but rather the usageData object has an instance of a flowData and has some methods that proxy to the flowData object. Do you think an approach like that would be feasible? Did you have a specific reason for exposing the flowData object directly?

packages/amplify-cli-shared-interfaces/CHANGELOG.md Outdated Show resolved Hide resolved

/**
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: remove empty block or add contents

packages/amplify-prompts/src/prompter.ts Show resolved Hide resolved
packages/amplify-prompts/src/prompter.ts Outdated Show resolved Hide resolved
packages/amplify-prompts/src/prompter.ts Outdated Show resolved Hide resolved
packages/amplify-prompts/src/prompter.ts Outdated Show resolved Hide resolved
@lgtm-com
Copy link

lgtm-com bot commented Apr 30, 2022

This pull request introduces 5 alerts when merging a772eb9 into 9a13376 - view on LGTM.com

new alerts:

  • 5 for Unused variable, import, function or class

@lgtm-com
Copy link

lgtm-com bot commented May 1, 2022

This pull request introduces 3 alerts when merging f3161a2 into 9a13376 - view on LGTM.com

new alerts:

  • 3 for Unused variable, import, function or class

@jhockett jhockett changed the title Feature: usage flow logging for interactive and non-interactive cli commands feat: usage flow logging for interactive and non-interactive cli commands May 3, 2022
@sachscode sachscode force-pushed the feat/cliflow branch 3 times, most recently from dc604b7 to 56a7521 Compare May 4, 2022 16:50
@lgtm-com
Copy link

lgtm-com bot commented May 4, 2022

This pull request introduces 3 alerts when merging 67750f7 into 2af11f4 - view on LGTM.com

new alerts:

  • 3 for Unused variable, import, function or class

@lgtm-com
Copy link

lgtm-com bot commented May 4, 2022

This pull request introduces 3 alerts when merging e2b2b12 into 2af11f4 - view on LGTM.com

new alerts:

  • 3 for Unused variable, import, function or class

@lgtm-com
Copy link

lgtm-com bot commented May 4, 2022

This pull request introduces 3 alerts when merging 2b5f5e3 into 971d517 - view on LGTM.com

new alerts:

  • 3 for Unused variable, import, function or class

@lgtm-com
Copy link

lgtm-com bot commented May 4, 2022

This pull request introduces 3 alerts when merging e6da634 into 08fb69f - view on LGTM.com

new alerts:

  • 3 for Unused variable, import, function or class

@lgtm-com
Copy link

lgtm-com bot commented May 5, 2022

This pull request introduces 3 alerts when merging 7ad2920 into 08fb69f - view on LGTM.com

new alerts:

  • 3 for Unused variable, import, function or class

@lgtm-com
Copy link

lgtm-com bot commented May 5, 2022

This pull request introduces 3 alerts when merging 79f5014 into 08fb69f - view on LGTM.com

new alerts:

  • 3 for Unused variable, import, function or class

Comment on lines +48 to +49
if ( isInteractiveShell ) {
if (this.flowData && input ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can combine into one condition

@akshbhu akshbhu merged commit da391b1 into aws-amplify:master May 5, 2022
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.

5 participants