Skip to content

Commit 06f189a

Browse files
authored
Merge pull request #102 from scalyr/go-rewrite-v2
Go rewrite v2
2 parents 0c4b160 + db00367 commit 06f189a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+2158
-17491
lines changed

.babelrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.circleci/config.yml

Lines changed: 0 additions & 95 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
9+
jobs:
10+
frontend:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/[email protected]
15+
with:
16+
node-version: "16.x"
17+
# Ref: https://github.com/actions/cache/blob/main/examples.md#node---yarn
18+
- name: Get yarn cache path
19+
id: yarn-cache-path
20+
run: echo "::set-output name=path::$(yarn cache dir)"
21+
- uses: actions/cache@v3
22+
with:
23+
path: ${{ steps.yarn-cache-path.outputs.path }}
24+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
25+
restore-keys: |
26+
${{ runner.os }}-yarn-
27+
# Not recommened to cache node_modules
28+
# Ref: https://github.com/actions/cache/blob/main/examples.md#node---npm
29+
- name: Install dependencies
30+
run: yarn install --frozen-lockfile
31+
- name: Build and test
32+
run: yarn build
33+
backend:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v2
37+
- uses: actions/setup-go@v3
38+
with:
39+
go-version: "1.16"
40+
# Ref: https://github.com/actions/cache/blob/main/examples.md#linux-1
41+
- uses: actions/cache@v3
42+
with:
43+
path: |
44+
~/.cache/go-build
45+
~/go/pkg/mod
46+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
47+
restore-keys: |
48+
${{ runner.os }}-go-
49+
- name: Run tests and generate coverage report
50+
uses: magefile/mage-action@v2
51+
with:
52+
version: latest
53+
args: coverage
54+
- uses: magefile/mage-action@v2
55+
with:
56+
version: latest
57+
args: buildAll

.github/workflows/release.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- [0-9]+.[0-9]+.[0-9]+
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/[email protected]
12+
with:
13+
node-version: "16.x"
14+
# Ref: https://github.com/actions/cache/blob/main/examples.md#node---yarn
15+
- name: Get yarn cache path
16+
id: yarn-cache-path
17+
run: echo "::set-output name=path::$(yarn cache dir)"
18+
- uses: actions/cache@v3
19+
with:
20+
path: ${{ steps.yarn-cache-path.outputs.path }}
21+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
22+
restore-keys: |
23+
${{ runner.os }}-yarn-
24+
# Not recommened to cache node_modules
25+
# Ref: https://github.com/actions/cache/blob/main/examples.md#node---npm
26+
- name: Install dependencies
27+
run: yarn install --frozen-lockfile
28+
- name: Build and test
29+
run: yarn build
30+
- uses: actions/setup-go@v3
31+
with:
32+
go-version: "1.16"
33+
# Ref: https://github.com/actions/cache/blob/main/examples.md#linux-1
34+
- uses: actions/cache@v3
35+
with:
36+
path: |
37+
~/.cache/go-build
38+
~/go/pkg/mod
39+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
40+
restore-keys: |
41+
${{ runner.os }}-go-
42+
- name: Run tests and generate coverage report
43+
uses: magefile/mage-action@v2
44+
with:
45+
version: latest
46+
args: coverage
47+
- uses: magefile/mage-action@v2
48+
with:
49+
version: latest
50+
args: buildAll
51+
- name: Sign plugin
52+
run: npx @grafana/toolkit plugin:sign
53+
env:
54+
GRAFANA_API_KEY: ${{ secrets.GRAFANA_API_KEY }}
55+
- name: Get version
56+
id: version
57+
run: |
58+
import json
59+
version = json.load(open('dist/plugin.json'))['info']['version']
60+
print(f'::set-output name=version::{version}')
61+
shell: python
62+
- name: Compare version and Github tag
63+
run: |
64+
[ "${{ steps.version.outputs.version }}" = "${GITHUB_REF#refs/tags/}" ] || { echo 'plugin version and github tag mismatch'; exit 1; }
65+
- name: Package plugin
66+
run: |
67+
mv dist sentinelone-dataset-datasource
68+
zip -r sentinelone-dataset-datasource-${{ steps.version.outputs.version }}.zip sentinelone-dataset-datasource
69+
sha256sum sentinelone-dataset-datasource-${{ steps.version.outputs.version }}.zip >SHA256SUMS
70+
- name: Validate plugin
71+
run: |
72+
# Avoid a git clone within another checkout
73+
pushd ~
74+
git clone https://github.com/grafana/plugin-validator
75+
pushd plugin-validator/pkg/cmd/plugincheck
76+
go install
77+
popd
78+
popd
79+
plugincheck sentinelone-dataset-datasource-${{ steps.version.outputs.version }}.zip
80+
- name: Generate changelog
81+
run: awk '/^## / {s++} s==1 {print} s==2 {exit}' CHANGELOG.md > RELEASE_CHANGELOG.md
82+
- uses: softprops/action-gh-release@v1
83+
with:
84+
draft: true
85+
body_path: RELEASE_CHANGELOG.md
86+
files: |
87+
sentinelone-dataset-datasource-${{ steps.version.outputs.version }}.zip
88+
SHA256SUMS
89+
# TODO Consider automating the grafana.com publish process here

.gitignore

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
1-
/node_modules
2-
.idea/
3-
.vscode/
4-
.jshintrc
5-
.nvmrc
6-
.DS_Store
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
node_modules/
9+
10+
# Runtime data
11+
pids
12+
*.pid
13+
*.seed
14+
*.pid.lock
15+
16+
# Directory for instrumented libs generated by jscoverage/JSCover
17+
lib-cov
18+
19+
# Coverage directory used by tools like istanbul
20+
coverage
21+
22+
# Compiled binary addons (https://nodejs.org/api/addons.html)
23+
dist/
24+
artifacts/
25+
work/
26+
ci/
27+
e2e-results/
28+
29+
# Editor
30+
.idea
31+
.*.swp

.prettierrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
...require('./node_modules/@grafana/toolkit/src/config/prettier.plugin.config.json'),
2+
...require("./node_modules/@grafana/toolkit/src/config/prettier.plugin.config.json"),
33
};

CHANGELOG.md

Lines changed: 15 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,26 @@
11
# Changelog
22

3-
## 2.3.7
3+
## 3.0.4
44

5-
Improve support for visualizing Power Query results on newer versions of Grafana.
5+
- Minor README.md fixes
6+
- Minor default server url fix
7+
- Support breakdown graphs with empty standard queries
8+
- Removed an unnecessary hardcoded field in top-facet requests
9+
- Minor change to support Grafana 8.2.x
10+
- Support for future LRQ api change
611

7-
## 2.3.6
12+
## 3.0.3
813

9-
Fix issue with annotations where configured query would be ignored. (#78) (Yan Shnayder)
14+
Minor client fix and set Grafana dependency to >=8.3.0.
1015

11-
## 2.3.5
16+
## 3.0.2
1217

13-
Have Datalink generation prepend "add." to EU hosts to avoid permissions issue. (#71) (Yan Shnayder)
14-
Bump a variety of dependencies to newer versions (Dependabot)
18+
Minor changes based on Grafana support feedback.
1519

16-
## 2.3.4
20+
## 3.0.1
1721

18-
Bump `ua-parser-js` dependency to version 0.7.28 (#68) (Dependabot)
22+
Minor cleanups/changes.
1923

20-
## 2.3.3
24+
## 3.0.0 (Unreleased)
2125

22-
Fix issue with power queries not sending proper data in the request (#65) (Yan Shnayder)
23-
24-
## 2.3.2
25-
26-
Fix issue with migrating panels from versions 2.3.0 and older to version 2.3.1 (#63) (Yan Shnayder)
27-
28-
## 2.3.1
29-
30-
Align terminology with Scalyr API (#59) (Rein Achten)
31-
32-
## 2.3.0
33-
34-
Obscure the API key on the configuration page on subsequent visits (#62) (Yan Shnayder)
35-
Releases will now also be made in `.zip` format for use with `grafana-cli`
36-
37-
## 2.2.0
38-
39-
Support variable substitution in Power Queries (#54) (Yan Shnayder)
40-
41-
## 2.1.0
42-
43-
Support for annotation queries (#52) (Yan Shnayder)
44-
45-
## 2.0.0
46-
47-
Support variable substitution (#29) (Yan Shnayder)
48-
49-
Show all columns when graphing a PowerQuery (#39) (Yan Shnayder)
50-
51-
DataLink generation (Yan Shnayder)
52-
53-
## 1.0.0
54-
55-
Initial release
26+
Initial release.

0 commit comments

Comments
 (0)