aws-amplify / aws-amplify/amplify-cli

CLI 1st command after upgrading takes excessively longer than subsequent commands

Open
#10,238 4 comments 0 reactions 1 assignee Claimed by @sobolk View on GitHub
bug installation p2 platform
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Before opening, please confirm:

- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/master/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

### How did you install the Amplify CLI?

amplify upgrade command

### If applicable, what version of Node.js are you using?

14.18.1

### Amplify CLI Version

8.0.2

### What operating system are you using?

Windows

### Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

None

### Amplify Categories

Not applicable

### Amplify Commands

Not applicable

### Describe the bug

Was on Amplify 8.0.1

1) amplify upgrade
message: "Successfully upgraded to Amplify CLI version 8.0.2!"

2) measure-command { amplify version | out-host }
Screen had no update for 27 seconds, then displayed 8.0.2 and output of measure-command:
8.0.2

Days : 0
Hours : 0
Minutes : 0
Seconds : 27
Milliseconds : 223
Ticks : 272231809
TotalDays : 0.000315083112268519
TotalHours : 0.00756199469444444
TotalMinutes : 0.453719681666667
TotalSeconds : 27.2231809
TotalMilliseconds : 27223.1809

3) rerun same command (completes in 2.75 seconds)
PS C:\Users\erstraub\dev\teamperformance> measure-command { amplify version | out-host}
8.0.2

Days : 0
Hours : 0
Minutes : 0
Seconds : 2
Milliseconds : 749
Ticks : 27491750
TotalDays : 3.18191550925926E-05
TotalHours : 0.000763659722222222
TotalMinutes : 0.0458195833333333
TotalSeconds : 2.749175
TotalMilliseconds : 2749.175

More Information:
This is a result of CLI running a plugin scan the first time it is invoked after an upgrade.

### Expected behavior

Amplify version time should be consistent

### Reproduction steps

1. amplify upgrade
2. amplify version
3. amplify version

2 takes a long time
3 takes 2.75 seconds on my machine

### GraphQL schema(s)

```graphql
# Put schemas below this line

```

### Log output

```
# Put your logs below this line

```

### Additional information

Amplify should either remove the need for plug-in scan or should perform the plug-in scan as part of the upgrade so that upon completion of the upgrade, commands have consistent timing run to run.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.