Skip to content

Handle UI plugins with chart version and appVersion not matching #14207

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jtomasek
Copy link
Contributor

@jtomasek jtomasek commented Apr 25, 2025

Summary

Fixes #14204

Occurred changes and/or fixed issues

This change adds handling for UIPlugins which are installed from charts where chart version and chart appVersion don't match.

  • Determine plugin upgradability by comparing UIPlugin version with chart appVersion with a fallback to chart version if appVersion is not available
  • Update PluginInfoPanel to handle plugin version not matching chart version by checking appVersion first
  • Update InstallDialog to handle plugin version not matching chart version by checking appVersion first

I've tested the PR with KubeVirt dashboard extension from the following Helm chart repository:
Type: git,
URL: https://github.com/jtomasek/dashboard-extensions,
Branch: ghp-test

Technical notes summary

Areas or cases that should be tested

Areas which could experience regressions

Screenshot/Video

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

@aalves08
Copy link
Member

@jtomasek this PR needs a rebase from master since the failing e2e test has been fixed there 🙏

Copy link
Member

@aalves08 aalves08 left a comment

Choose a reason for hiding this comment

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

Left a specific comment @jtomasek

Also, could you be clear on how I can reproduce this issue with the repo+branch you've mentioned on the PR? Where in the published extensions did you make the manual change?

@jtomasek
Copy link
Contributor Author

Also, could you be clear on how I can reproduce this issue with the repo+branch you've mentioned on the PR? Where in the published extensions did you make the manual change?

This is the change I did on the repository to reproduce the problem: jtomasek/dashboard-extensions@ab1829d

I am setting the chart version to be different from appVersion. Which matches the convention Edge team uses for releasing charts. In such case, when an extension is installed the UIPlugin version is populated form appVersion and when UI runs the logic to determine if an upgrade is available it finds a chart version which does not match the UIPlugin version and suggests an upgrade. This PR fixes the problem by checking the UIPlugin version against Chart appVersion (or Chart version if appVersion is not set).

@aalves08
Copy link
Member

@jtomasek I ran your branch and the update disappears, which I think it's fine to fit your usecase. Let's wait for @nwmac feedback as well.
Unless we manually change the appVersion, I think appVersion is always equal to version...

With this logic change you implemented, shouldn't the card also read 999.0.0+up1.3.1? There's a difference between what's displayed in the slidein panel when comparing with the extension card.

Screenshot 2025-04-29 at 09 32 58

@jtomasek
Copy link
Contributor Author

jtomasek commented Apr 29, 2025

With this logic change you implemented, shouldn't the card also read 999.0.0+up1.3.1? There's a difference between what's displayed in the slidein panel when comparing with the extension card.

Yeah, so if the extension is not installed, we are showing helm chart versions in both extension box and extension panel. If the extension is installed, the UIPlugin exists and in that case in the extension card we are showing UIPlugin version which equals Helm chart appVersion. In the extension panel we are always showing available Helm chart versions. That is why we are getting a mismatch (visible in your screenshot). Should we always show Helm chart appVersion (if present) in the extension box and extension panel?

@aalves08
Copy link
Member

aalves08 commented Apr 29, 2025

With this logic change you implemented, shouldn't the card also read 999.0.0+up1.3.1? There's a difference between what's displayed in the slidein panel when comparing with the extension card.

Yeah, so if the extension is not installed, we are showing helm chart versions in both extension box and extension panel. If the extension is installed, the UIPlugin exists and in that case in the extension card we are showing UIPlugin version which equals Helm chart appVersion. In the extension panel we are always showing available Helm chart versions. That is why we are getting a mismatch (visible in your screenshot). Should we always show Helm chart appVersion (if present) in the extension box and extension panel?

I think that the versions must match in all places where we convey that information to the user. If you look at the card when it's available for install, it says that the most up-to-date version to be installed is 999.0.0+up1.3.1:

Screenshot 2025-04-29 at 14 32 06

If you look at the card in the installed state, it's reading 1.3.1, as per:

Screenshot 2025-04-29 at 09 32 58

These are all taken from running your branch locally. We can't have this information inconsistency. I believe it should be an easy fix

@jtomasek
Copy link
Contributor Author

I agree, the question I am raising is whether to show an appVersion (the actual version of the extension, in my branch equal to 1.3.1) or a helm chart version (the version of the helm chart which installs the extension, in my branch equal to 999.0.0+up1.3.1).

My take is that it makes much more sense to show an extension version (= appVersion) because that is the information which the user is interested in when deciding to install the extension.

@aalves08
Copy link
Member

I agree, the question I am raising is whether to show an appVersion (the actual version of the extension, in my branch equal to 1.3.1) or a helm chart version (the version of the helm chart which installs the extension, in my branch equal to 999.0.0+up1.3.1).

My take is that it makes much more sense to show an extension version (= appVersion) because that is the information which the user is interested in when deciding to install the extension.

I would say just go for the same approach: appVersion falling back to version. 98% of the usecases they'll both be the same, so no harm no foul. It fits your usecase, so everything evens out in the end

@jtomasek jtomasek force-pushed the fix-14204 branch 2 times, most recently from 0471f37 to fea7a15 Compare July 4, 2025 15:15
This change adds handling for UIPlugins which are installed from charts
where chart version and chart appVersion don't match.

- Determine plugin upgradability by comparing UIPlugin version with chart appVersion
with a fallback to chart version if appVersion is not available
- Update PluginInfoPanel to handle plugin version not matching chart version by checking
appVersion first
- Update InstallDialog to handle plugin version not matching chart version by checking
appVersion first
- Display plugin versions in `appVersion (chart version)` format if appVersion differs
from chart version

Fixes issue rancher#14204
@jtomasek
Copy link
Contributor Author

jtomasek commented Jul 4, 2025

Screenshot 2025-07-04 at 17 10 16

aalves08
aalves08 previously approved these changes Jul 7, 2025
Copy link
Member

@aalves08 aalves08 left a comment

Choose a reason for hiding this comment

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

LGTM

@aalves08 aalves08 dismissed their stale review July 7, 2025 15:41

no tests on the PR

@aalves08
Copy link
Member

aalves08 commented Jul 7, 2025

@jtomasek could you add some tests for this, please?

FYI @richard-cox

@gaktive gaktive modified the milestones: v2.12.0, v2.13.0 Jul 11, 2025
@nwmac nwmac modified the milestones: v2.14.0, v2.13.0 Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shell: Chart version is expected to match AppVersion when determining extension upgrade availability
4 participants