amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

fix: usage data consent being shown on post init success.

Open aws-eddy opened this issue 2 years ago • 4 comments
trafficstars

Description of changes

Post install script is no longer running on latest npm version so this change moves the notice of data collection to post init successful. Moving the amplify-diagnose consent into the diagnose command logic.

Before amplify-diagnose consent was shown on post init success: Screenshot 2023-05-12 at 10 36 54 AM

Post install script never ran unless you configured npm to show scripts that are running in the background:

After: Screenshot 2023-05-12 at 9 22 49 AM Screenshot 2023-05-12 at 10 28 31 AM

Issue #, if available

Description of how you validated changes

Checklist

  • [x] PR description included
  • [x] 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
  • [ ] Pull request labels are added

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

aws-eddy avatar May 12 '23 14:05 aws-eddy

Codecov Report

Merging #12622 (05e93dd) into dev (ec9a2ba) will increase coverage by 47.58%. The diff coverage is 44.33%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@             Coverage Diff             @@
##              dev   #12622       +/-   ##
===========================================
+ Coverage    0.00%   47.58%   +47.58%     
===========================================
  Files        1296      842      -454     
  Lines      149743    38340   -111403     
  Branches     1296     7836     +6540     
===========================================
+ Hits            0    18246    +18246     
+ Misses     148447    18469   -129978     
- Partials     1296     1625      +329     
Impacted Files Coverage Δ
...ify-category-function/src/events/prePushHandler.ts 33.33% <0.00%> (+33.33%) :arrow_up:
...ib/S3AndCloudFront/helpers/configure-CloudFront.js 87.06% <ø> (+87.06%) :arrow_up:
...lify-category-hosting/lib/S3AndCloudFront/index.js 89.65% <ø> (+89.65%) :arrow_up:
...s/amplify-cli-core/src/errors/amplify-exception.ts 82.35% <ø> (+82.35%) :arrow_up:
...ackages/amplify-cli-core/src/help/commands-info.ts 100.00% <ø> (+100.00%) :arrow_up:
packages/amplify-cli-core/src/types.ts 100.00% <ø> (+100.00%) :arrow_up:
packages/amplify-cli/src/commands/console.ts 0.00% <0.00%> (ø)
packages/amplify-cli/src/commands/diagnose.ts 71.85% <0.00%> (+71.85%) :arrow_up:
packages/amplify-cli/src/commands/pull.ts 0.00% <0.00%> (ø)
...es/amplify-provider-awscloudformation/src/index.ts 60.20% <ø> (+60.20%) :arrow_up:
... and 28 more

... and 1267 files with indirect coverage changes

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

codecov-commenter avatar May 12 '23 20:05 codecov-commenter

To test this flow, you will need to checkout this PR, make a change in the above file, and run yarn setup-dev. Then you will need to init a new Amplify project, confirm that the data consent screen is shown. Then init another amplify project and confirm that the data consent is not seen.

aws-eddy avatar May 23 '23 20:05 aws-eddy

Project run 1: Simulating a fresh install Second run

aws-eddy avatar May 23 '23 21:05 aws-eddy

Post install script is no longer running on latest npm version

~~Do we have a link for that?~~

Reference: https://github.com/npm/cli/issues/3647

0618 avatar Jul 29 '23 00:07 0618