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

Useless installation of temporary CLI #24024

Closed
1 task
egonknapen opened this issue Oct 6, 2022 · 5 comments · Fixed by #24028
Closed
1 task

Useless installation of temporary CLI #24024

egonknapen opened this issue Oct 6, 2022 · 5 comments · Fixed by #24028
Labels
area: @angular/cli freq1: low Only reported by a handful of users who observe it rarely ng update DX severity2: inconvenient

Comments

@egonknapen
Copy link

Command

update

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

I'm not sure if this should be a bug or a feature, it's more of an annoyance.

Every week when I check with 'ng update' it first complains that the CLI is outdated and starts installing a temporary CLI version, which takes a while. Then it tells me there is a new CLI version and I have to install it again with 'ng update @angular/cli', this time for real. Next time I do a 'ng update' it quickly shows me, without the delay.

Is it really necessary to install a new temporary cli version every week ?

Or maybe if there is a new one, can't we have question or a parameter to install the new CLI version (automatically), instead of installing it temporarily (and thus twice)? Just like when you type 'ng new' you also get a question.

Minimal Reproduction

ng update

The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 14.2.5 to perform the update.
√ Packages successfully installed.

Exception or Error

No response

Your Environment

Angular CLI: 14.2.5
Node: 16.16.0
Package Manager: npm 8.3.0
OS: win32 x64

Anything else relevant?

No response

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Oct 6, 2022

Primarily ng update is needed to update to a new major version as this is typically when code migrations are added. For minor and patch updates, updating the dependencies in the package.json or refreshing the lock file will suffice.

The temporary CLI is installed when an outdated version is used to perform the update. The latest version is always used as the update runner. This is extremely important when there are fixes and features that target the update process, as otherwise during the update the old version with potential bugs is used which might cause updates to fail. As such downloading the temporary version is definitely the better DX.

@egonknapen
Copy link
Author

Which means that a batch file doing:

ng update @angular/cli
ng update

Would be the faster way to weekly check for updates of your system...

That CLI system is outdated every week.

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Oct 6, 2022

I strongly belief that developers should not perform dependency updates themselves (At least for non major versions).

There are a number of excellent tools that automate this, like RenovateBot which can also be self hosted and thus ideal for corp environments and DependaBot.

@alan-agius4
Copy link
Collaborator

Following a convo with @clydin we decided that we will disable downloading a temporary version of the Angular CLI when running ng update without any package name. Since in this cases an update to date update executer is not neccessary.

alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Oct 6, 2022
… without package names

In the case when `ng update` is ran without a package name, an update is not be performed. In this case using the current installed version of the CLI is good enough.

Closes angular#24024
@alan-agius4 alan-agius4 added area: @angular/cli ng update DX severity2: inconvenient freq1: low Only reported by a handful of users who observe it rarely labels Oct 6, 2022
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Oct 6, 2022
… without package names

In the case when `ng update` is ran without a package name, an update is not be performed. In this case using the current installed version of the CLI is good enough.

Closes angular#24024
clydin pushed a commit that referenced this issue Oct 6, 2022
… without package names

In the case when `ng update` is ran without a package name, an update is not be performed. In this case using the current installed version of the CLI is good enough.

Closes #24024
clydin pushed a commit that referenced this issue Oct 6, 2022
… without package names

In the case when `ng update` is ran without a package name, an update is not be performed. In this case using the current installed version of the CLI is good enough.

Closes #24024

(cherry picked from commit 3202410)
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Oct 7, 2022
… without package names

In the case when `ng update` is ran without a package name, an update is not be performed. In this case using the current installed version of the CLI is good enough.

Closes angular#24024
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @angular/cli freq1: low Only reported by a handful of users who observe it rarely ng update DX severity2: inconvenient
Projects
None yet
2 participants