Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Grafana 9.4.7 #20

Merged
merged 7 commits into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

68 changes: 21 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,26 @@ jobs:

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'

- name: Setup Go environment
uses: actions/setup-go@v3
with:
go-version: '1.16'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Cache yarn cache
uses: actions/cache@v3
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@v3
with:
path: node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-nodemodules-

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build and test frontend
run: yarn build

- name: Sign plugin
run: yarn sign
env:
GRAFANA_API_KEY: ${{ secrets.GRAFANA_API_KEY }}

- name: Get plugin metadata
id: metadata
run: |
Expand All @@ -68,14 +54,6 @@ jobs:
echo "archive=${GRAFANA_PLUGIN_ARTIFACT}" >> $GITHUB_OUTPUT
echo "archive-checksum=${GRAFANA_PLUGIN_ARTIFACT_CHECKSUM}" >> $GITHUB_OUTPUT

echo "github-tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT

- name: Read changelog
id: changelog
run: |
awk '/^## / {s++} s == 1 {print}' CHANGELOG.md > release_notes.md
echo "path=release_notes.md" >> $GITHUB_OUTPUT

- name: Test backend
uses: magefile/mage-action@v1
with:
Expand All @@ -96,26 +74,22 @@ jobs:
md5sum ${{ steps.metadata.outputs.archive }} > ${{ steps.metadata.outputs.archive-checksum }}
echo "checksum=$(cat ./${{ steps.metadata.outputs.archive-checksum }} | cut -d' ' -f1)" >> $GITHUB_OUTPUT

- name: Lint plugin
continue-on-error: true
run: |
git clone https://github.com/grafana/plugin-validator
pushd ./plugin-validator/pkg/cmd/plugincheck2
go install
popd
plugincheck2 -config ./plugin-validator/config/default.yaml ${{ steps.metadata.outputs.archive }}

- name: Compatibility check
uses: grafana/plugin-actions/is-compatible@v1
with:
module: './src/module.ts'
comment-pr: 'yes'
fail-if-incompatible: 'no'

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
directory: ./coverage/
files: ./coverage/lcov.info,./coverage/backend.out
env_vars: OS,PYTHON
fail_ci_if_error: true
fail_ci_if_error: false

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.metadata.outputs.archive }}
path: ${{ steps.metadata.outputs.archive }}

- name: Upload artifact checksum
uses: actions/upload-artifact@v3
with:
name: ${{ steps.metadata.outputs.archive-checksum }}
path: ${{ steps.metadata.outputs.archive-checksum }}
75 changes: 16 additions & 59 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,15 @@ jobs:

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'yarn'

- name: Setup Go environment
uses: actions/setup-go@v3
with:
go-version: '1.16'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Cache yarn cache
uses: actions/cache@v3
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@v3
with:
path: node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-nodemodules-

- name: Install dependencies
run: yarn install --frozen-lockfile

Expand All @@ -63,7 +44,7 @@ jobs:
- name: Sign plugin
run: yarn sign
env:
GRAFANA_API_KEY: ${{ secrets.GRAFANA_API_KEY }} # Requires a Grafana API key from Grafana.com.
GRAFANA_API_KEY: ${{ secrets.GRAFANA_API_KEY }}

- name: Get plugin metadata
id: metadata
Expand All @@ -88,7 +69,12 @@ jobs:
id: changelog
run: |
awk '/^## / {s++} s == 1 {print}' CHANGELOG.md > release_notes.md
echo "path=release_notes.md" >> $GITHUB_OUTPUT
export RELEASE_TITLE=$(head -1 release_notes.md|sed 's/## //')
awk 'NR > 2 { print }' release_notes.md > release_body.md

echo "title=${RELEASE_TITLE}" >> $GITHUB_OUTPUT
echo "path=release_body.md" >> $GITHUB_OUTPUT
echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT

- name: Check package version
run: if [ "v${{ steps.metadata.outputs.plugin-version }}" != "${{ steps.metadata.outputs.github-tag }}" ]; then printf "\033[0;31mPlugin version doesn't match tag name\033[0m\n"; exit 1; fi
Expand All @@ -101,44 +87,15 @@ jobs:
md5sum ${{ steps.metadata.outputs.archive }} > ${{ steps.metadata.outputs.archive-checksum }}
echo "checksum=$(cat ./${{ steps.metadata.outputs.archive-checksum }} | cut -d' ' -f1)" >> $GITHUB_OUTPUT

- name: Lint plugin
continue-on-error: true
run: |
git clone https://github.com/grafana/plugin-validator
pushd ./plugin-validator/pkg/cmd/plugincheck2
go install
popd
plugincheck2 -config ./plugin-validator/config/default.yaml ${{ steps.metadata.outputs.archive }}

- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
name: ${{ steps.changelog.outputs.title }}
body_path: ${{ steps.changelog.outputs.path }}
token: ${{ secrets.GITHUB_TOKEN }}
draft: true

- name: Add plugin to release
id: upload-plugin-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ steps.metadata.outputs.archive }}
asset_name: ${{ steps.metadata.outputs.archive }}
asset_content_type: application/zip

- name: Add checksum to release
id: upload-checksum-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ steps.metadata.outputs.archive-checksum }}
asset_name: ${{ steps.metadata.outputs.archive-checksum }}
asset_content_type: text/plain
files: |
./${{ steps.metadata.outputs.archive }}
./${{ steps.metadata.outputs.archive-checksum }}
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Changelog

## 2.3.0 (IN PROGRESS)
## 2.3.0 (2023-04-04)

### Features / Enhancements

- Update README to explain how to use data source for a custom domain (#18)
- Add NGINX configuration example (#18)
- Update to Grafana 9.3.6 (#19)
- Update to Grafana 9.4.7 (#20)

## 2.2.0 (2022-11-06)

Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

![Dashboard](https://raw.githubusercontent.com/VolkovLabs/volkovlabs-env-datasource/main/src/img/dashboard.png)

[![Grafana](https://img.shields.io/badge/Grafana-9.2.2-orange)](https://www.grafana.com)
[![YouTube](https://img.shields.io/badge/YouTube-Playlist-red)](https://www.youtube.com/playlist?list=PLPow72ygztmSGfvGdXriFE-LVuS4Glg7w)
[![Grafana](https://img.shields.io/badge/Grafana-9.4.7-orange)](https://www.grafana.com)
![CI](https://github.com/volkovlabs/volkovlabs-env-datasource/workflows/CI/badge.svg)
[![codecov](https://codecov.io/gh/VolkovLabs/volkovlabs-env-datasource/branch/main/graph/badge.svg?token=2W9VR0PG5N)](https://codecov.io/gh/VolkovLabs/volkovlabs-env-datasource)
[![CodeQL](https://github.com/VolkovLabs/volkovlabs-env-datasource/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/VolkovLabs/volkovlabs-env-datasource/actions/workflows/codeql-analysis.yml)
Expand Down Expand Up @@ -34,7 +33,7 @@ grafana-cli --repo https://volkovlabs.io/plugins plugins install volkovlabs-env-

## Private plugin

Plugin is signed as a Private plugin for Grafana using the default domain `http://localhost:3000``. If you are using custom domain URL, there are various options depends on your deployment:
Plugin is signed as a Private plugin for Grafana using the default domain `http://localhost:3000`. If you are using custom domain URL, there are various options depends on your deployment:

### NGINX Reverse proxy

Expand Down Expand Up @@ -113,4 +112,4 @@ We love to hear from you. There are various ways to get in touch with us:

## License

- Apache License Version 2.0, see [LICENSE](https://github.com/volkovlabs/volkovlabs-env-datasource/blob/main/LICENSE).
Apache License Version 2.0, see [LICENSE](https://github.com/volkovlabs/volkovlabs-env-datasource/blob/main/LICENSE).
File renamed without changes.
6 changes: 5 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@
const standard = require('@grafana/toolkit/src/config/jest.plugin.config');

// This process will use the same config that `yarn test` is using
module.exports = standard.jestConfig();
module.exports = {
...standard.jestConfig(),
setupFilesAfterEnv: ['<rootDir>/jest-setup.js'],
collectCoverage: true,
};
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"author": "Volkov Labs",
"description": "Data Source to return environment variables for Grafana",
"devDependencies": {
"@grafana/data": "9.3.6",
"@grafana/runtime": "9.3.6",
"@grafana/toolkit": "9.3.6",
"@grafana/ui": "9.3.6",
"@grafana/data": "9.4.7",
"@grafana/runtime": "9.4.7",
"@grafana/toolkit": "9.4.7",
"@grafana/ui": "9.4.7",
"@types/enzyme": "^3.10.12",
"@types/enzyme-adapter-react-16": "^1.0.6",
"enzyme": "^3.11.0",
Expand All @@ -22,6 +22,7 @@
"build": "grafana-toolkit plugin:build --coverage",
"build:backend": "mage -v lint && mage -v coverage && mage -v",
"dev": "grafana-toolkit plugin:dev",
"levitate": "npx @grafana/levitate@latest is-compatible --path src/module.ts --target @grafana/data,@grafana/runtime,@grafana/ui",
"restart:docker:plugin": "docker exec -it grafana pkill -f volkovlabs-env-datasource",
"sign": "grafana-toolkit plugin:sign --rootUrls http://localhost:3000/",
"start": "docker-compose pull && docker-compose up",
Expand Down
12 changes: 4 additions & 8 deletions src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,12 @@
"keywords": ["environment", "variables"],
"links": [
{
"name": "Website",
"url": "https://github.com/VolkovLabs/volkovlabs-env-datasource"
},
{
"name": "YouTube Playlist",
"url": "https://www.youtube.com/playlist?list=PLPow72ygztmRCTyV2W5ghK2_5jLLsyGLc"
"name": "Documentation",
"url": "https://volkovlabs.io/plugins/volkovlabs-env-datasource/"
},
{
"name": "License",
"url": "https://github.com/VolkovLabs/volkovlabs-env-datasource/blob/main/LICENSE"
"name": "GitHub",
"url": "https://github.com/VolkovLabs/volkovlabs-env-datasource"
}
],
"logos": {
Expand Down
Loading