Closed f1ames closed 9 months ago
Latest commit: be5334a5dfbb9b9cedbdb6870b72adc8224d619a
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Tests are commented, maybe just remove them since they are in git anyway? Or maybe you still wanted to do them before finalising this PR?
Tests are commented, maybe just remove them since they are in git anyway? Or maybe you still wanted to do them before finalising this PR?
Yes, I wanted to at least add one test which will cover synchronization logic, that's why I left it like that. I will clean it up when adding it 👍
This PR is a part of https://github.com/kubeshop/vscode-monokle/issues/93.
The main goal is to allow fetching all data required for integrations at once and to allow fetched data to be used in synchronous manner.
I kept previous
synchronizer
without changes (but deprecated it) since it is used by multiple integrations. And introducedProjectSynchronizer
since the way it works is quite different from the previous one. Putting everything in the same class would be a mess.The main idea is that it exposes
synchronize
method (the same as previous one) which refetches data whenever called (so this is integrator responsibility to know when to refetch). Entire response is cached and then used whenget*
methods are used. This way fetching is decoupled from getting/using data.Changes
ProjectSynchronizer
.getPermissions
query inApiHandler
which may be useful too for other integrations.Fixes
Checklist