Skip to content

frontend: plugin: Sync plugin version with backend #2578

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

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

skoeva
Copy link
Collaborator

@skoeva skoeva commented Nov 15, 2024

This change allows the frontend to update plugin fields from the backend, avoiding the case where a plugin is updated but the version number does not reflect this.

Fixes: #2535

Testing

Using the prometheus plugin as an example:

  • Open Headlamp and navigate to the plugin settings. Ensure the latest prometheus plugin version is installed (currently 0.2.2)
  • Downgrade the prometheus plugin version by changing the version in package.json to 0.0.1 and run rm -rf node_modules package-lock.json dist in the prometheus folder
  • Install the prometheus plugin at this downgraded version: npm install [email protected]
  • Refresh the page and ensure that the prometheus plugin version now reads as 0.0.1 without being disabled

@skoeva skoeva added kind/bug Categorizes issue or PR as related to a bug. plugins labels Nov 15, 2024
@skoeva skoeva self-assigned this Nov 15, 2024
This change allows the frontend to update plugin fields from the
backend, avoiding the case where a plugin is updated but the version
number does not reflect this.

Fixes: #2535

Signed-off-by: Evangelos Skopelitis <[email protected]>
@skoeva skoeva force-pushed the plugin-version-from-backend branch from 01e151e to bc829e4 Compare November 19, 2024 22:11
@skoeva skoeva marked this pull request as ready for review November 19, 2024 22:16
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Nov 19, 2024
Copy link
Collaborator

@illume illume left a comment

Choose a reason for hiding this comment

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

👍 RAD

@dosubot dosubot bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 21, 2024
@illume illume merged commit 32b1879 into main Nov 21, 2024
17 of 18 checks passed
@illume illume deleted the plugin-version-from-backend branch November 21, 2024 09:17
@joaquimrocha
Copy link
Contributor

I think this PR doesn't address why the versions were being wrongly displayed. The cause is that we are storing the package.json's contents in the local storage, but I don't understand why we need to do so.
If we have the plugins' info being loaded from the backend, why do we need to store it too in the local storage?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. plugins size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plugins version in the UI is not matching the actual versions
3 participants