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

chore: ask for consent for diagnose report #12710

Open
wants to merge 33 commits into
base: dev
Choose a base branch
from

Conversation

evcodes
Copy link
Contributor

@evcodes evcodes commented May 31, 2023

Description of changes

Previously the CLI would ask permission for diagnose command on init but this PR moves the ask to the beginning of diagnose command. This is set on a per-project basis.

Issue #, if available

Description of how you validated changes

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
  • 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.

@evcodes evcodes requested a review from a team as a code owner May 31, 2023 21:33
@evcodes evcodes requested a review from a team as a code owner June 1, 2023 11:28
@evcodes evcodes marked this pull request as draft June 8, 2023 13:38
Comment on lines 40 to 44
false,
false,
0,
false,
true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should make a settings object within amplifyPushUpdate parameters.. I wrote this like this as a quick and dirty solution just to see if this would work.

@evcodes evcodes marked this pull request as ready for review June 29, 2023 15:42
import { amplifyRegions } from '../configure';
import { mergeDeploymentSecrets } from '@aws-amplify/amplify-cli-core';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import mergeDeploymentSecrets.
Comment on lines +90 to +99
if (DebugConfig.Instance.promptSendReport()) {
const result = await prompter.yesOrNo('Help improve Amplify CLI by sharing non sensitive configurations on failures', false);
DebugConfig.Instance.setAndWriteShareProject(result);
if (result === false) {
return;
}
const diagnoseAction = await prompter.pick('What would you like to do?', choices);
if (diagnoseAction !== choices[0]) {
return;
}
Copy link
Member

Choose a reason for hiding this comment

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

We should.

  1. Double check this condition with
    if (!isHeadless && DebugConfig.Instance.promptSendReport()) {
    . I.e. we must never ask this question in headless mode.
  2. We should undo all the changes made to e2e/migration/other tests. They don't scale. Current implementation covers very narrow failure modes that are expected. All unexpected errors will now result in nexpect timing out on unexpected prompt should failure happen (transient or not). This will contribute to overall e2e test runtime.
  3. Instead of that we should.
    1. Opt out existing e2e tests by default, i.e. make sure DebugConfig.Instance.promptSendReport() returns false, so this prompt is never asked there.
    2. Add test(s) and test utils dedicated to covering that particular scenario.

if (diagnoseAction !== choices[0]) {
return;
if (DebugConfig.Instance.promptSendReport()) {
const result = await prompter.yesOrNo('Help improve Amplify CLI by sharing non sensitive configurations on failures', false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like we've already got a prompt on line 37, why do we need to add this line to zipSend again? https://github.com/aws-amplify/amplify-cli/pull/12710/files#diff-71cabcaa3379af3b9458f6802b25c65f6c00768606d5ef7f8c010094d8720aa1R37

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.

None yet

3 participants