From 19a5858da91d044d6202e7c6cd70c985dc9439dd Mon Sep 17 00:00:00 2001 From: eduardo aleixo Date: Tue, 21 Mar 2023 09:22:59 +0000 Subject: [PATCH] build: fix linter (#12) After a lot of debugging I noticed that the `envstub` call wasn't working properly (couldn't figure out why), replaced for an action that does the same thing. Also disable `strict` mode, since now we have warnings. --- .github/actions/lint-plugin/action.yaml | 11 ++++++++--- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 1 - CONTRIBUTING.md | 2 +- lint.config.yaml | 8 -------- lint.config.yaml.tmpl | 12 ++++++++++++ 6 files changed, 22 insertions(+), 14 deletions(-) delete mode 100644 lint.config.yaml create mode 100644 lint.config.yaml.tmpl diff --git a/.github/actions/lint-plugin/action.yaml b/.github/actions/lint-plugin/action.yaml index 4ca6ebf..c77bdb4 100644 --- a/.github/actions/lint-plugin/action.yaml +++ b/.github/actions/lint-plugin/action.yaml @@ -9,18 +9,23 @@ inputs: runs: using: "composite" steps: + - name: Render Deployment YAML + uses: nowactions/envsubst@v1 + with: + input: ./lint.config.yaml.tmpl + output: ./lint.config.yaml + env: + ENABLE_VERSION_ANALYZER: ${{ inputs.enable-version-analyzer }} - name: Lint plugin shell: bash run: | export PATH="$(go env GOPATH)/bin/:$PATH" - envsubst < lint.config.yaml > lint.config.yaml git clone https://github.com/grafana/plugin-validator pushd ./plugin-validator/pkg/cmd/plugincheck2 go install popd - plugincheck2 -strict -config lint.config.yaml -sourceCodeUri=file://./ ${{ inputs.file }} + plugincheck2 -config lint.config.yaml -sourceCodeUri=file://./ ${{ inputs.file }} env: - ENABLE_VERSION_ANALYZER: ${{ inputs.enable-version-analyzer }} DEBUG: 1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7aed1b..de1ec8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./.github/actions/setup-node/ - - run: yarn sign - uses: ./.github/actions/package-plugin/ id: package-plugin with: @@ -21,4 +20,5 @@ jobs: - uses: ./.github/actions/lint-plugin/ with: file: ${{ steps.package-plugin.outputs.archive }} + # in PRs the version won't be correct, so there's no point checking it enable-version-analyzer: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f49c6dc..8477a41 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./.github/actions/setup-node/ - - run: yarn sign - uses: ./.github/actions/package-plugin/ id: package-plugin with: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 31055b6..28df611 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ ## Releasing new versions 1. Merge the PR created by `Release Please` -2. Open [https://grafana.com/orgs/pyroscope/plugin-submissions/pyroscope-panel](https://grafana.com/orgs/pyroscope/plugin-submissions/pyroscope-datasource) and submit the plugin, copying the links from this repository's releases. +2. Open [https://grafana.com/orgs/pyroscope/plugin-submissions/pyroscope-panel](https://grafana.com/orgs/pyroscope/plugin-submissions/pyroscope-panel) and submit the plugin, copying the links from this repository's releases. ## Fixing releases After submitting to Grafana, they may find issues. diff --git a/lint.config.yaml b/lint.config.yaml deleted file mode 100644 index 80f4ff0..0000000 --- a/lint.config.yaml +++ /dev/null @@ -1,8 +0,0 @@ -global: - enabled: true - jsonOutput: false - reportAll: true - -analyzers: - version: - enabled: ${ENABLE_VERSION_ANALYZER} diff --git a/lint.config.yaml.tmpl b/lint.config.yaml.tmpl new file mode 100644 index 0000000..35a0586 --- /dev/null +++ b/lint.config.yaml.tmpl @@ -0,0 +1,12 @@ +global: + enabled: true + jsonOutput: false + reportAll: false + +analyzers: + version: + enabled: ${ENABLE_VERSION_ANALYZER} + trackingscripts: + # there's a false positive happening + # TODO: update after https://github.com/grafana/plugin-validator/issues/105 is fixed + enabled: false