Hi all,
I am having difficulties with the plugin publisher CI (release.yml
) that came packaged with the starter plugin. It is getting stuck on the Lint Plugin
step, specifically it cannot find a valid license. My plugin does not use a typical license (GPL, MIT…) but I do have a modified BSD license called LICENSE
in the repository root folder. I am getting the following error from the workflow:
~/work/{repo}/{repo}
error: Valid license not found
detail: Could not find a license file inside the plugin archive or the provided license is not compatible with Grafana plugins. Please refer to https://grafana.com/licensing/ for more information.
Error: Process completed with exit code 1.
I am assuming the error arises because of the custom license. What should I do - can I skip the Lint Plugin
step or will I get problems when trying to publish to the Grafana plugin repository? Thanks!
Hi Ventura.
You can enable and disable analyzers and rules in the plugin validator by modifying the configuration file.
This is an example of a configuration file that disables the license check:
global:
enabled: true
jsonOutput: false
reportAll: false
analyzers:
license:
enabled: false
you can pass your own config file in the -config
option when you call the pluginvalidator.
I’ve submitted a PR in the plugin validator to update our README file and include this information.
Thanks @estebanbeltran - the problem was that I am using the default CI/CD that came with the Grafana starter plugin, which:
- Clones the plugin validator and
- Uses the
publishing.yaml
configuration file
- This enables license checking by default
Thank you for your advice. I think one solution is to create a new config file to use locally in my own GitHub CI/CD pipeline, but I think it would still fail when submitting to the plugin repository in Grafana.com. But, this might not be something I need to worry about.
FYI, from the default release.yml
file:
- name: Lint plugin
run: |
git clone https://github.com/grafana/plugin-validator
pushd ./plugin-validator/pkg/cmd/plugincheck2
go install
popd
plugincheck2 -config ./plugin-validator/config/publishing.yaml ${{ steps.metadata.outputs.archive }}
There are some artifacts in here from some bug I experienced where I was stuck using an older version of the create-plugin
tool, so many of my files were out of date. I re-built the starter plugin using npx @grafana/create-plugin@latest
and migrated my code to those files. Now, the CI uses default.yaml
as the configuration file by default. (Also, this step is now called Validate Plugin
.)
Regardless, I ended up using a custom config file using on the code you sent. (Replace {path-to-custom}
with the configuration file path.)
- name: Validate plugin
run: |
git clone https://github.com/grafana/plugin-validator
pushd ./plugin-validator/pkg/cmd/plugincheck2
go install
popd
plugincheck2 -config ./{path-to-custom}.yaml ${{ steps.metadata.outputs.archive }}
And this works perfectly on my end. I expect that I will still get errors for invalid license files when submitting this to Grafana.com, but this is a step in the direction I need! Thank you.