Skip to content

Commit

Permalink
ci: add validator config to handle version error
Browse files Browse the repository at this point in the history
The config-plugin-validator.yml is used to reduce the severity level of the wrong-plugin-version
rule to warning. This ensures passing the validation github action for casual push events. For the
release action the  validation should also check the plugin version.
  • Loading branch information
felix-mu committed Jun 4, 2024
1 parent fd85b3f commit c1c2e23
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
with:
args: zip -qr felixrelleum-geomapwms-panel.zip felixrelleum-geomapwms-panel
- name: Run validator
run: npx --yes @grafana/plugin-validator@latest -sourceCodeUri file://. felixrelleum-geomapwms-panel.zip # https://github.com/grafana/plugin-validator
run: npx --yes @grafana/plugin-validator@latest -config ./plugin-validator-config.yaml -sourceCodeUri file://. felixrelleum-geomapwms-panel.zip # https://github.com/grafana/plugin-validator
- name: Clean up
run: rm -r felixrelleum-geomapwms-panel.zip

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"lint:fix": "npm run lint -- --fix",
"server": "docker compose up --build",
"sign": "npx --yes @grafana/sign-plugin@latest --distDir ./felixrelleum-geomapwms-panel",
"validate": "zip -qr felixrelleum-geomapwms-panel.zip felixrelleum-geomapwms-panel && npx --yes @grafana/plugin-validator@latest -sourceCodeUri file://. felixrelleum-geomapwms-panel.zip; rm -r felixrelleum-geomapwms-panel.zip",
"validate": "npm run build && zip -qr felixrelleum-geomapwms-panel.zip felixrelleum-geomapwms-panel && npx --yes @grafana/plugin-validator@latest -config ./plugin-validator-config.yml -sourceCodeUri file://. felixrelleum-geomapwms-panel.zip; rm -r felixrelleum-geomapwms-panel.zip",
"start": "yarn watch",
"test:all": "jest --coverage",
"test": "jest --watch --onlyChanged",
Expand Down
13 changes: 13 additions & 0 deletions plugin-validator-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# global object from default.yaml https://github.com/grafana/plugin-validator/blob/main/config/default.yaml
global:
enabled: true
severity: warning
jsonOutput: false
reportAll: false

analyzers:
version:
rules:
wrong-plugin-version: # https://github.com/grafana/plugin-validator/blob/3419c5ee9c414b4a44284f8f88650d9ea9a6e4ad/pkg/analysis/passes/version/version.go#L14
enabled: true
severity: warning

0 comments on commit c1c2e23

Please sign in to comment.