-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add compatibility functions to support multiple server version #16
Conversation
Signed-off-by: Francesco Torchia <[email protected]>
Signed-off-by: Francesco Torchia <[email protected]>
9cb9a73
to
cc20304
Compare
Signed-off-by: Francesco Torchia <[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.
My only concern is there will be 4+ times number of files under edit/list/models/detail folders.
- v1.3.0
- v1.3.1
- v1.3.2
- latest
and we will have future release
- v1.3.3
- v1.4.1
But rootGetters['type-map/hasCustomEdit']
seems not greatly support extra layer folder like edit/v1.3.2/harvesterhci.io.keypair.vue
.
Another idea is to modify the latest code base to hide those v1.4.0 features based on I like the env variable |
My opinion is that this pattern will overwrite Dashboard's It's a pattern that was used a couple of times and never yielded any good results/outcome. We've had to revert every single usage of it through time. If you don't track updates on Dashboard for these files that tackle crucial bugs, then your introducing bugs when your extension is installed. It's difficult to track those bug because people rarely make the association of an extension being installed causing a bug somewhere else on Dashboard. I advise not using it. One alternative would be to create your "custom" You will still need to maintain them but at least you won't be overriding Dashboard's code because they are "unique". You'll need to investigate if it's possible to do that kind of isolation on an extension. |
Signed-off-by: Francesco Torchia <[email protected]>
Thanks for all of your suggestions! We realized that this approach overtakes the compatibility goal. It introduce high code duplication compared to the benefits. |
Summary
Implementing custom components and store functions to support multiple server versions.
Usage:
Define a component in
list/edit/details/models
directory, where the root path is the resource name and the suffix is the server version that we want to support.example:
latest
server:pkg/harvester/edit/kubevirt.io.virtualmachine/index.vue
pkg/harvester/edit/kubevirt.io.virtualmachine-v1.3.0/index.vue
The server version can be specified with the
VUE_APP_SERVER_VERSION
env variable:If
VUE_APP_SERVER_VERSION
is null, the UI takes the server version from the settings (prod build).PR Checklists
Related Issue
Test screenshot/video
Extra technical notes summary