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

fix: do not route to plugin when command is invalid #12132

Merged
merged 1 commit into from
Feb 28, 2023

Conversation

goldbez
Copy link
Member

@goldbez goldbez commented Feb 28, 2023

Description of changes

When commands are deemed invalid by the input-manager, the command is set to "help" but the plugin is not changed. This leads to invalid commands still being routed to non-core plugins, which sometimes results in users being prompted, even after a message showing that the command is invalid is printed. This change stops commands from being routed to plugins by setting the plugin to core. The plugin that executes the help command does not matter, as all plugins yield the same top-level help. See the first photo below for an example of a prompt appearing after an invalid command message and the second photo for the new behavior.

image

image

Issue #, if available

#12118

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.

Sorry, something went wrong.

@goldbez goldbez requested a review from a team as a code owner February 28, 2023 18:26
@aws-eddy
Copy link
Contributor

aws-eddy commented Feb 28, 2023

Excellent fix! Are we capturing/validating this behavior anywhere in e2e tests?

@codecov-commenter
Copy link

Codecov Report

Merging #12132 (562e192) into dev (984c0f8) will decrease coverage by 3.14%.
The diff coverage is 56.28%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##              dev   #12132      +/-   ##
==========================================
- Coverage   49.45%   46.32%   -3.14%     
==========================================
  Files         692      821     +129     
  Lines       33424    37587    +4163     
  Branches     6840     7643     +803     
==========================================
+ Hits        16529    17411     +882     
- Misses      15370    18514    +3144     
- Partials     1525     1662     +137     
Impacted Files Coverage Δ
...sync-simulator/src/data-loader/opensearch/index.ts 45.45% <0.00%> (ø)
...s/amplify-appsync-simulator/src/type-definition.ts 100.00% <ø> (ø)
...sync-simulator/src/velocity/util/dynamodb-utils.ts 6.55% <0.00%> (ø)
...y-appsync-simulator/src/velocity/util/map-utils.ts 10.00% <ø> (ø)
...tor/src/velocity/util/transform/dynamodb-filter.ts 4.93% <0.00%> (ø)
...ync-simulator/src/velocity/util/transform/index.ts 21.05% <0.00%> (ø)
...appsync-simulator/src/velocity/value-mapper/map.ts 86.88% <ø> (ø)
...ackages/amplify-category-auth/src/commands/auth.ts 0.00% <0.00%> (ø)
...es/amplify-category-auth/src/commands/auth/help.ts 0.00% <0.00%> (ø)
.../amplify-category-auth/src/commands/auth/import.ts 0.00% <0.00%> (ø)
... and 539 more

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

@goldbez goldbez merged commit 4490c7e into aws-amplify:dev Feb 28, 2023
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

4 participants