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

Fix installation of helm charts #5841

Merged
merged 16 commits into from Jul 20, 2022
Merged

Fix installation of helm charts #5841

merged 16 commits into from Jul 20, 2022

Conversation

jansav
Copy link
Contributor

@jansav jansav commented Jul 18, 2022

Fixes #5827

Notice the added behaviours, they describe completely how it should work. There's still lot to improve in the implementation, but that's enough for now.

jansav added 11 commits July 18, 2022 15:51
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
…nents to be rendered in unit tests

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
@jansav jansav added bug Something isn't working blocker labels Jul 18, 2022
@jansav jansav added this to the 5.6.0 milestone Jul 18, 2022
@jansav jansav requested a review from a team as a code owner July 18, 2022 13:28
@jansav jansav requested review from nevalla and Iku-turso and removed request for a team July 18, 2022 13:28
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

return {
value: computed(
() => state.get() || versionsOfSelectedHelmChart.value.get()[0],
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit, using ?? is more semantically correct.

@@ -59,7 +61,7 @@ const NonInjectedEditorPanel = observer(({
autoFocus={autoFocus}
id={tabId}
value={value}
className={cssNames(styles.EditorPanel, className)}
className={cssNames(styles.EditorPanel, className, { hidden })}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems strange, why is this needed?

Copy link
Contributor Author

@jansav jansav Jul 19, 2022

Choose a reason for hiding this comment

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

Because MonacoEditor works incorrectly

const SomeComponent = observer(({ someProp, value }: Props) => (
  <div>
    {someProp.get() ? <MonacoEditor value={value.get()} /> : <div>Something else</div>}
  </div>
));
  1. someProp.get() returns truthy value, MonacoEditor is rendered
  2. someProp.get() changes to falsy value, MonacoEditor is not rendered
  3. value.get() changes
  4. someProp.get() changes back to truthy value, MonacoEditor renders with old value

Copy link
Collaborator

Choose a reason for hiding this comment

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

Then shouldn't we fix MonacoEditor? That sounds like it isn't checking for an updated value prop (in componentDidUpdate or something).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we should. Draw the line here, because there is lot to improve in MonacoEditor. Issue is that it's calling this.restoreViewState(this.model); when it creates the editor. Didn't go any deeper than that.

Comment on lines +8 to +12
const getRandomInstallChartTabIdInjectable = getInjectable({
id: "get-random-install-chart-tab-id",
instantiate: (di) => di.inject(getRandomIdInjectable),
});

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is weird, why have this additional level of abstraction?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Overriding in test. If I would have overridden getRandomIdInjectable then all of use places (even the ones not relevant here) would be overridden.


instantiate: async (di, tabId: string) => {
const store = di.inject(installChartTabStoreInjectable);
const callForHelmChartValues = di.inject(callForHelmChartValuesInjectable);
Copy link
Collaborator

Choose a reason for hiding this comment

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

comment: what is the benefit of naming these sort of injectables with the callFor prefix? Wouldn't getHelmChartValues be descriptive enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's just matter of preference and what we're used to.

We've been using callForX for stuff that needs to be get from somewhere outside of the system. E.g. API call, file system, local storage. getX doesn't really communicate enough because it could also mean that we are getting some static value from somewhere or e.g. some deeply nested value from the input.

@@ -111,6 +112,9 @@ export const getDiForUnitTesting = (opts: { doGeneralOverrides?: boolean } = {})

di.override(historyInjectable, () => createMemoryHistory());
di.override(legacyOnChannelListenInjectable, () => () => noop);

di.override(storageSaveDelayInjectable, () => 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this override different than that of main's getDiForUnitTesting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is used only by createStorage which is renderer thing.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Then why should main even know about it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't?

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
@jim-docker
Copy link
Contributor

Screen.Recording.2022-07-19.at.8.55.31.AM.mov

Or maybe this is related to the Upgrade bug

@jansav
Copy link
Contributor Author

jansav commented Jul 19, 2022

Screen.Recording.2022-07-19.at.8.55.31.AM.mov

Or maybe this is related to the Upgrade bug

Yes, this is related to the other issue I created today. #5852

@jim-docker
Copy link
Contributor

The release details page slides in a few extra times (sometimes it doesn't happen till ~30 seconds later)
Also, after removing a release, the release list gets redrawn a few extra times.

Screen.Recording.2022-07-19.at.10.41.21.PM.mov

@jim-docker
Copy link
Contributor

crash after removing a release with an upgrade tab open

Screen.Recording.2022-07-19.at.10.59.48.PM.mov

Copy link
Contributor

@jim-docker jim-docker left a comment

Choose a reason for hiding this comment

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

approving in case found issues should be fixed in another PR

@jansav jansav merged commit f281df1 into master Jul 20, 2022
@jansav jansav deleted the fix/installing-charts branch July 20, 2022 05:15
@Nokel81 Nokel81 mentioned this pull request Jul 22, 2022
@jansav jansav mentioned this pull request Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installing Helm Chart doesn't work properly
3 participants