Skip to content
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

[v10.2.x] Plugins: Don't auto prepend app sub url to plugin asset paths #82146

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

grafana-delivery-bot[bot]
Copy link
Contributor

Backport 99feb92 from #81658


What is this feature?

This moves the prefixing of appSubUrl for plugin assets to the frontend so it can be dynamically appended depending on the request.

This is required because under certain conditions the image renderer changes the config.appSubUrl before making the request to Grafana backend. This leads to frontend asset paths for Grafana and external plugins being mismatched as the base and module are set in the backend when the server boots. As such we need this to be prefixed dynamically which means the frontend is pretty much our only choice

Why do we need this feature?

Fixes a failed plugin loading bug with the Image Renderer plugin for instances of Grafana where requests are served from a sub path via proxy.

Who is this feature for?

Grafana Users

Which issue(s) does this PR fix?:

Fixes #76180

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

* don't prepend app sub url to paths

* simplify logo path

* fix(plugins): dynamically prepend appSubUrl for System module resolving to work

* fix(sandbox): support dynamic appSuburl prepend when loading plugin module.js

* fix tests

* update test name

* fix tests

* update fe + add some tests

* refactor(plugins): move wrangleurl to utils, rename to resolveModulePath, update usage

* chore: fix a typo

* test(plugins): add missing name to utils test

* reset test flag

---------

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
(cherry picked from commit 99feb92)
@grafana-delivery-bot grafana-delivery-bot bot requested review from a team as code owners February 8, 2024 11:20
@grafana-delivery-bot grafana-delivery-bot bot added this to the 10.2.x milestone Feb 8, 2024
@grafana-delivery-bot grafana-delivery-bot bot requested review from sunker and removed request for a team February 8, 2024 11:20
@grafana-delivery-bot grafana-delivery-bot bot removed the request for review from a team February 8, 2024 11:20
@grafana-delivery-bot grafana-delivery-bot bot requested review from wbrowne, marefr, oshirohugo, zserge, diegommm and mildwonkey and removed request for a team February 8, 2024 11:20
@wbrowne wbrowne enabled auto-merge (squash) February 8, 2024 11:21
@wbrowne wbrowne merged commit dfb6c28 into v10.2.x Feb 8, 2024
23 checks passed
@wbrowne wbrowne deleted the backport-81658-to-v10.2.x branch February 8, 2024 11:33
@aangelisc aangelisc modified the milestones: 10.2.x, 10.2.5 Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants