This repository has been archived by the owner on Apr 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: don't crash when an invalid
flamebearer
is passed (#10)
Handles when the pyroscope panel is used alongside a different datasource, which previously would crash the panel, but now we display a better (but simple) message: <img width="1186" alt="Screenshot 2023-03-16 at 17 54 51" src="https://user-images.githubusercontent.com/6951209/225710290-50b819cb-8429-461f-8ce2-0291a839432c.png"> Also moves the code from the main repo to this one.
- Loading branch information
Showing
25 changed files
with
608 additions
and
316 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: 'lint-plugin' | ||
inputs: | ||
enable-version-analyzer: | ||
description: 'Whether to analyze the version or not' | ||
required: true | ||
file: | ||
description: 'the plugin file (.zip)' | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- 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 }} | ||
env: | ||
ENABLE_VERSION_ANALYZER: ${{ inputs.enable-version-analyzer }} | ||
DEBUG: 1 | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: 'package-plugin' | ||
inputs: | ||
grafana-token: | ||
description: 'Token to be used when signing (from grafana.com)' | ||
required: true | ||
outputs: | ||
archive: | ||
description: "The plugin zip file" | ||
value: ${{ steps.metadata.outputs.archive }} | ||
checksum: | ||
description: "The checksum of the zip file" | ||
value: ${{ steps.metadata.outputs.archive-checksum }} | ||
runs: | ||
using: "composite" | ||
steps: | ||
- run: yarn sign | ||
shell: bash | ||
env: | ||
GRAFANA_API_KEY: ${{ inputs.grafana-token }} | ||
- name: Get plugin metadata | ||
id: metadata | ||
shell: bash | ||
run: | | ||
sudo apt-get install jq | ||
export GRAFANA_PLUGIN_ID=$(cat dist/plugin.json | jq -r .id) | ||
export GRAFANA_PLUGIN_VERSION=$(cat dist/plugin.json | jq -r .info.version) | ||
export GRAFANA_PLUGIN_TYPE=$(cat dist/plugin.json | jq -r .type) | ||
export GRAFANA_PLUGIN_ARTIFACT=${GRAFANA_PLUGIN_ID}-${GRAFANA_PLUGIN_VERSION}.zip | ||
export GRAFANA_PLUGIN_ARTIFACT_CHECKSUM=${GRAFANA_PLUGIN_ARTIFACT}.md5 | ||
echo "::set-output name=plugin-id::${GRAFANA_PLUGIN_ID}" | ||
echo "::set-output name=plugin-version::${GRAFANA_PLUGIN_VERSION}" | ||
echo "::set-output name=plugin-type::${GRAFANA_PLUGIN_TYPE}" | ||
echo "::set-output name=archive::${GRAFANA_PLUGIN_ARTIFACT}" | ||
echo "::set-output name=archive-checksum::${GRAFANA_PLUGIN_ARTIFACT_CHECKSUM}" | ||
echo ::set-output name=github-tag::${GITHUB_REF#refs/*/} | ||
- name: Package plugin | ||
id: packag- | ||
shell: bash | ||
run: | | ||
mv dist ${{ steps.metadata.outputs.plugin-id }} | ||
zip ${{ steps.metadata.outputs.archive }} ${{ steps.metadata.outputs.plugin-id }} -r | ||
md5sum ${{ steps.metadata.outputs.archive }} > ${{ steps.metadata.outputs.archive-checksum }} | ||
echo "::set-output name=checksum::$(cat ./${{ steps.metadata.outputs.archive-checksum }} | cut -d' ' -f1)" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: 'setup-node' | ||
description: 'Sets up nodejs' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: "14.17" | ||
|
||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
shell: bash | ||
|
||
- name: Cache yarn cache | ||
uses: actions/cache@v2 | ||
id: cache-yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Cache node_modules | ||
id: cache-node-modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-${{ matrix.node-version }}-node-modules-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.node-version }}-node-modules- | ||
- run: yarn --frozen-lockfile | ||
shell: bash | ||
- name: Build | ||
run: yarn build | ||
shell: bash |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: conventional-pr | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
jobs: | ||
lint-pr: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: CondeNast/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
commitTitleMatch: "false" | ||
ignoreCommits: "true" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Cypress | ||
|
||
env: | ||
CYPRESS_CACHE_FOLDER: cypress/cache | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
jobs: | ||
cypress: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/setup-node/ | ||
- name: Cache Cypress Binary | ||
id: cache-cypress-binary | ||
uses: actions/cache@v2 | ||
with: | ||
path: cypress/cache | ||
key: cypress-binary-${{ hashFiles('yarn.lock') }} | ||
- run: yarn cypress install | ||
- name: Run grafana server | ||
run: docker-compose -f docker-compose.yml up -d | ||
- name: Run tests | ||
run: yarn cy:ci | ||
env: | ||
CYPRESS_VIDEO: true | ||
- uses: actions/upload-artifact@v2 | ||
if: always() | ||
with: | ||
name: cypress-screenshots | ||
path: pyroscope/cypress/screenshots | ||
- uses: actions/upload-artifact@v2 | ||
if: always() | ||
with: | ||
name: cypress-videos | ||
path: pyroscope/cypress/videos |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
name: release-please | ||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: google-github-actions/release-please-action@v3 | ||
with: | ||
release-type: node | ||
package-name: release-please-action | ||
token: ${{ secrets.RELEASE_PLEASE_TOKEN }} |
Oops, something went wrong.