-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 filtering deprecated charts #3635
Conversation
- Always show charts, just disable the option to select them in the details view - Optimize the loading of repo charts to sort and normalize once - Using the structured clone algorithm instead of JSON and fix the cache placement Signed-off-by: Sebastian Malton <[email protected]>
Signed-off-by: Sebastian Malton <[email protected]>
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.
Left few minor comments. While testing works okay, fixes the issues listed in #3515. However, unable to find any deprecated chart versions to test this one (versions with line-through
visibility) https://github.com/lensapp/lens/pull/3635/files#diff-4ada9d82cde72ab9fa11079e8dd1c571c9d3de88a5a5ff0494ac8c04eea92a25
|
||
export class HelmChartManager { | ||
protected cache: any = {}; | ||
protected repo: HelmRepo; | ||
static #cache = new Map<string, Buffer>(); |
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.
We're not using such style anywhere else. Probably better to omit the hash sign?
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.
This is a better version of private
as it is actually enforced at runtime
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.
Why is this better? And why mark static
property as private? Asking because static property can not be called on instance of a class.
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.
Same reason to mark an instance property as private
, so to better model the encapsulation.
A static
property that is #
(JS private) cannot be accessed by code that is not a static member or an instance member.
Sure, you can add the |
Signed-off-by: Sebastian Malton <[email protected]>
iter.map( | ||
charts, | ||
(chart => { | ||
const __version = coerce(chart.version, { includePrerelease: true, loose: true }); |
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.
What is the meaning to use underscores before variable name here? __version
?
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 meant it as both "temporary" and less likely to conflict with other fields. I chose __version
because it is related to the version
field but I don't want to override that field.
Signed-off-by: Sebastian Malton <[email protected]>
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.
LGTM
Always show charts, just disable the option to select them in the
details view
Optimize the loading of repo charts to sort and normalize once
Using the structured clone algorithm instead of JSON and fix the cache
placement
Signed-off-by: Sebastian Malton [email protected]
fixes #3515