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
Upgrade and adapt to new version of libraries in ogre-tools #7241
Conversation
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
@@ -262,6 +272,11 @@ describe("cluster-store", () => { | |||
|
|||
describe("pre 3.6.0-beta.1 config with an existing cluster", () => { | |||
beforeEach(() => { | |||
di.override(storeMigrationVersionInjectable, () => "3.6.0"); |
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.
override
has to happen before inject
.
di.override(storeMigrationVersionInjectable, () => "10.0.0"); | ||
|
||
userStore = di.inject(userStoreInjectable); |
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.
override
has to happen before inject
@@ -43,7 +43,7 @@ describe("ApiManager", () => { | |||
di.override(directoryForKubeConfigsInjectable, () => "/some-kube-configs"); | |||
di.override(storesAndApisCanBeCreatedInjectable, () => true); | |||
|
|||
const createCluster = di.inject(createClusterInjectable); | |||
const createCluster = di.inject(createClusterInjectionToken); |
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.
Reference equality is important here. Previously it worked because the implementation for createClusterInjectionToken
in main
and renderer
had same ID.
const someChannelListenerInjectable = getInjectable({ | ||
id: "some-channel-listener", | ||
|
||
instantiate: () => ({ | ||
channel: testRequestChannel, | ||
handler: () => () => "irrelevant", | ||
}), | ||
|
||
injectionToken: requestChannelListenerInjectionToken, | ||
}); | ||
|
||
testChannelListenerInMain2Injectable.id += "2"; | ||
const someOtherChannelListenerInjectable = getInjectable({ | ||
id: "some-other-channel-listener", | ||
|
||
instantiate: () => ({ | ||
channel: testRequestChannel, | ||
handler: () => () => "irrelevant", | ||
}), | ||
|
||
injectionToken: requestChannelListenerInjectionToken, | ||
}); | ||
|
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.
Mutating injectable ID is not possible and shouldn't be advertised.
builder.beforeWindowStart((windowDi) => { | ||
// TODO: remove once ClusterStore can be used without overriding it | ||
windowDi.override(getClusterByIdInjectable, () => (clusterId) => { | ||
if (clusterId === cluster.id) { | ||
return cluster; | ||
} | ||
|
||
return undefined; | ||
}); | ||
}); | ||
|
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.
override
has to happen before inject
@@ -830,7 +830,40 @@ exports[`Showing correct entity settings when navigating to non-local cluster en | |||
> | |||
Proxy | |||
</h2> | |||
<section /> | |||
<section> |
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.
Notice that previously the snapshot was providing wrong output.
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
bcdfa1c
to
684ac49
Compare
This version brings back requirement for exact reference for injection tokens and injectables. It also allows future Features not have conflicting IDs for injectables automatically.