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

Enable extension to specify storeName for persisting data #7107

Merged
merged 4 commits into from Feb 15, 2023

Conversation

panuhorsmalahti
Copy link
Contributor

@panuhorsmalahti panuhorsmalahti commented Feb 3, 2023

Fixes #7052

Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
@panuhorsmalahti panuhorsmalahti added this to the 6.4.0 milestone Feb 3, 2023
@panuhorsmalahti panuhorsmalahti added the area/extension Something to related to the extension api label Feb 3, 2023
@apialaviiva apialaviiva self-assigned this Feb 15, 2023
@apialaviiva apialaviiva requested a review from a team February 15, 2023 07:45
@apialaviiva apialaviiva marked this pull request as ready for review February 15, 2023 07:46
@apialaviiva apialaviiva requested a review from a team as a code owner February 15, 2023 07:46
@apialaviiva apialaviiva requested review from jansav and jim-docker and removed request for a team February 15, 2023 07:46
@apialaviiva apialaviiva added the enhancement New feature or request label Feb 15, 2023
Signed-off-by: Antti Lustila <antti.lustila@luotocompany.fi>
Copy link
Member

@ixrock ixrock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -80,6 +87,11 @@ export class LensExtension<
return this.manifest.description;
}

// Name of extension for persisting data
get storeName() {
return this.manifest.storeName || this.name;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
return this.manifest.storeName || this.name;
return this.manifest.storeName ?? this.name;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want this. If storeName is set as "", we want to fall back to name.

const getHashInjectable = getInjectable({
id: "get-hash",

instantiate: () => (text: string) => SHA256(text).toString(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add causesSideEffects: true since used external imported package?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In don't think that is necessary because a hash should be stable given its input

@apialaviiva apialaviiva merged commit 3f0de05 into master Feb 15, 2023
@apialaviiva apialaviiva deleted the feature/extension-store-name branch February 15, 2023 12:56
@Nokel81 Nokel81 mentioned this pull request Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/extension Something to related to the extension api enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow extension to specify storeName
5 participants