fix: make validate-backend work without webpack output - #1813
Open
ckbedwell wants to merge 1 commit into
Open
Conversation
Stage plugin.json into dist/ after mage buildAll so the script can verify backend load on a clean tree, and mount temp provisioning as a directory so nothing is left under dev/provisioning/datasources.
Script size changes
Totals
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
./scripts/validate-backendis meant to verify the Go backend loads in Grafana without running the full frontend dev setup. After #1806 it only ranmage buildAll, which writes the linux binary intodist/datasource/but not the plugin metadata Grafana needs to register the nested datasource. On a clean tree the health and registration checks fail even when the binary is fine.The script also bind-mounted its throwaway datasource YAML as a file onto a path inside
dev/provisioning/datasources/. Docker created that file on the host, and cleanup did not remove it — so a lateryarn servercould pick up an extra empty SM datasource.Solution
Stage
src/plugin.jsonandsrc/datasource/plugin.jsonintodist/after the build step, with fail-fast checks that both files exist before starting Grafana. Mount the temp provisioning directory over the container datasources path instead of a single file bind, so nothing is written underdev/provisioning/on the host.Test plan
./scripts/validate-backendpasses on a clean tree (mage output only)SKIP_BUILD=1 ./scripts/validate-backendpasses after removingdist/plugin.jsonfiles (staging copies them back)dev/provisioning/datasources/sm-backend-validate.yamlleft on the host after the script exits