-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat(core): show warnings on unused / redundant package extensions #2091
Conversation
@@ -1579,8 +1599,8 @@ export class Project { | |||
for (const extensionsByIdent of this.configuration.packageExtensions.values()) | |||
for (const [, extensionsByRange] of extensionsByIdent) | |||
for (const extension of extensionsByRange) | |||
if (extension.active) | |||
Configuration.telemetry?.reportPackageExtension(extension.description); | |||
if (extension.userProvided && extension.status === `active`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes more sense to only report user-provided and non-redundant extensions inside our telemetry collection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might actually make a lot of sense to report the redundant builtins, since it means we can remove them during the next major. Wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few concerns:
- We can't tell which builtins are ours and which are registered by custom (possibly private) plugins. We can only distinguish between user-provided and not user-provided.
- Redundant builtins are relative to a project and its installed dependency tree, since a builtin can match multiple packages and can be active for some of them and redundant for others (e.g. if a dependency issue gets fixed in a newer version of a package).
- We'd have to report redundant builtins separately to be able to distinguish them inside the dashboard from active user-provided extensions.
@@ -1579,8 +1599,8 @@ export class Project { | |||
for (const extensionsByIdent of this.configuration.packageExtensions.values()) | |||
for (const [, extensionsByRange] of extensionsByIdent) | |||
for (const extension of extensionsByRange) | |||
if (extension.active) | |||
Configuration.telemetry?.reportPackageExtension(extension.description); | |||
if (extension.userProvided && extension.status === `active`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might actually make a lot of sense to report the redundant builtins, since it means we can remove them during the next major. Wdyt?
Co-authored-by: Maël Nison <[email protected]>
I made a diff refactoring slightly the rendering - in particular:
I think this looks really good! Your PR will be very useful to many 👍 |
What's the problem this PR addresses?
Package extensions weren't validated in any way, which meant that they could easily get out of sync with the installed dependency tree without anybody noticing.
How did you fix it?
I've made it so that we emit warnings at the end of the resolution step (we can only know which package extensions are used once we resolve all packages) on:
I've also fixed a weird bug with boolean values being loaded as strings from the configuration files and the lockfile - I've ranted enough about it on Discord where you can find more details.
You can see how it looks in this poorly-cropped screenshot below:
Checklist