Skip to content

Commit

Permalink
Merge pull request #223 from Altinity/make_release_2.0.2
Browse files Browse the repository at this point in the history
Make release 2.0.2
  • Loading branch information
Slach authored Jul 7, 2020
2 parents 3c5e0b5 + bcb7dda commit 8601b8f
Show file tree
Hide file tree
Showing 16 changed files with 369 additions and 120 deletions.
11 changes: 11 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[bumpversion]
commit = True
tag = False
current_version = 2.0.2

[bumpversion:file:package.json]

[bumpversion:file:src/plugin.json]

[bumpversion:file:dist/plugin.json]

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ npm-debug.log
yarn.lock
package-lock.json
.cache
.release_env
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# 2.0.2 (2020-07-06)

## Enhancements:
* add alerts support for Windows and MacOSX
* improve ad-hoc filters for query field values as `SELECT DISTINCT field AS value FROM db.table LIMIT 300`, https://github.com/Vertamedia/clickhouse-grafana/pull/222
* add ability to multiple JOIN parsing https://github.com/Vertamedia/clickhouse-grafana/pull/206
* multiple improvements for docker-compose environments, add automatic dashboards and datasource provisions which help to reproduce most of the corner cases which happens in Grafana + ClickHouse

## Fixes:
* apply a workaround for UTC timezone for Date and DateTime columns in grafana dashboards https://github.com/Vertamedia/clickhouse-grafana/issues/117
* clear documentation about timestamp term for $from and $to https://github.com/Vertamedia/clickhouse-grafana/issues/115
* fix AST parsing corner case in `WHERE [test, 'test']` "," was skipped, fix ah-doc ast FROM recursive parsing https://github.com/Vertamedia/clickhouse-grafana/issues/99
* fix corner cases for table functions parsing when adhoc filter applied https://github.com/Vertamedia/clickhouse-grafana/issues/130
* fix multiple grammar issues in README.md
* fix convert rules for Float, Decimal columns from Clickhouse to Grafana Table plugin https://github.com/Vertamedia/clickhouse-grafana/issues/199
* fix corner cases when Grafana Template variable value represented as array of strings https://github.com/Vertamedia/clickhouse-grafana/issues/169
* fix AST parsing corner cases for $macroFunctions correct position for FROM statement https://github.com/Vertamedia/clickhouse-grafana/issues/187

# 2.0.1 (2020-06-19)

## Fixes:
Expand Down
138 changes: 85 additions & 53 deletions README.md

Large diffs are not rendered by default.

138 changes: 85 additions & 53 deletions dist/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
"url": "https://github.com/Vertamedia/clickhouse-grafana"
}
],
"version": "2.0.1"
"version": "2.0.2"
}
}
Binary file added dist/vertamedia-clickhouse-plugin_darwin_amd64
Binary file not shown.
Binary file modified dist/vertamedia-clickhouse-plugin_linux_amd64
Binary file not shown.
Binary file not shown.
6 changes: 4 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ services:
- ./.cache:/go-cache
command: |
bash -xec "
go build -gcflags=\"all=-N -l\" -o ./dist/vertamedia-clickhouse-plugin_linux_amd64 . && \
chmod +x ./dist/vertamedia-clickhouse-plugin_linux_amd64
GOOS=linux GOARCH=amd64 go build -o ./dist/vertamedia-clickhouse-plugin_linux_amd64 . && \
GOOS=windows GOARCH=amd64 go build -o ./dist/vertamedia-clickhouse-plugin_windows_amd64.exe . && \
GOOS=darwin GOARCH=amd64 go build -o ./dist/vertamedia-clickhouse-plugin_darwin_amd64 . && \
chmod +x ./dist/vertamedia-clickhouse-plugin*
"
131 changes: 131 additions & 0 deletions docker/grafana/dashboards/datetime_table_dashboard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 5,
"links": [],
"panels": [
{
"datasource": "clickhouse",
"description": "",
"fieldConfig": {
"defaults": {
"custom": {
"align": null
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "s"
},
"properties": [
{
"id": "decimals",
"value": 3
}
]
},
{
"matcher": {
"id": "byName",
"options": "t_local"
},
"properties": [
{
"id": "unit",
"value": "time: YYYY-MM-DD HH:mm:ss"
}
]
}
]
},
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 0
},
"id": 2,
"options": {
"frameIndex": 1,
"showHeader": true,
"sortBy": [
{
"desc": false,
"displayName": "t"
}
]
},
"pluginVersion": "7.0.5",
"targets": [
{
"database": "default",
"dateColDataType": "",
"dateLoading": false,
"dateTimeColDataType": "event_time",
"dateTimeType": "DATETIME",
"datetimeLoading": false,
"extrapolate": true,
"format": "table",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"interval": "",
"intervalFactor": 1,
"query": "SELECT\n toUInt64(event_time)*1000 as t_local,\n event_time as t_orig,\n count() c,\n sum(too_big_value) s\nFROM $table\nWHERE $timeFilter\nGROUP BY t_local, t_orig\nORDER BY t_local",
"rawQuery": "SELECT toUInt64(event_time)*1000 as t_local, event_time as t_orig, count() c, sum(too_big_value) s FROM default.test_grafana WHERE event_time >= toDateTime(1593417149) GROUP BY t_local, t_orig ORDER BY t_local",
"refId": "A",
"round": "0s",
"table": "test_grafana",
"tableLoading": false
}
],
"timeFrom": null,
"timeShift": null,
"title": "Table DateTime",
"type": "table"
}
],
"schemaVersion": 25,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-7d",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "datetime table dashboard",
"uid": "bwewNfGGz",
"version": 2
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vertamedia-clickhouse",
"version": "2.0.1",
"version": "2.0.2",
"description": "ClickHouse datasource for Grafana",
"scripts": {
"build:prod": "webpack --config webpack.config.prod.js",
Expand Down
22 changes: 22 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -xeuo pipefail
if [[ $# -lt 1 ]]; then
echo "release.sh [major|minor|patch]"
exit 1
fi
if [[ $OSTYPE == *linux* ]]; then
echo 1 > /proc/sys/vm/drop_caches
fi
source .release_env
git config core.eol lf
git config core.autocrlf input
git config user.name "$GITHUB_LOGIN"
git config user.email "$GITHUB_EMAIL"
docker-compose stop
docker-compose run frontend_builder
docker-compose run backend_builder
dos2unix ./dist/*
git add .
git commit -m "prepare to new release, $(grep current_version .bumpversion.cfg)"
bump2version --verbose $1
git push
16 changes: 8 additions & 8 deletions spec/datasource.jest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ResponseParser from "../src/response_parser";

describe("clickhouse sql series:", () => {
describe("SELECT $timeseries response WHERE $adhoc = 1", () => {
var response = {
let response = {
"meta":
[
{
Expand Down Expand Up @@ -38,12 +38,12 @@ describe("clickhouse sql series:", () => {
],
};

var sqlSeries = new SqlSeries({
let sqlSeries = new SqlSeries({
series: response.data,
meta: response.meta,
table: '',
});
var timeSeries = sqlSeries.toTimeSeries();
let timeSeries = sqlSeries.toTimeSeries();
it("expects two results", () => {
expect(size(timeSeries)).toBe(2);
});
Expand All @@ -55,7 +55,7 @@ describe("clickhouse sql series:", () => {
});

describe("SELECT $columns response", () => {
var response = {
let response = {
"meta":
[
{
Expand Down Expand Up @@ -89,12 +89,12 @@ describe("clickhouse sql series:", () => {
]
};

var sqlSeries = new SqlSeries({
let sqlSeries = new SqlSeries({
series: response.data,
meta: response.meta,
table: '',
});
var timeSeries = sqlSeries.toTimeSeries();
let timeSeries = sqlSeries.toTimeSeries();

it("expects four results", () => {
expect(size(timeSeries)).toBe(4);
Expand All @@ -109,7 +109,7 @@ describe("clickhouse sql series:", () => {
});

describe("When performing ad-hoc query", () => {
var response = {
let response = {
"meta":
[
{
Expand Down Expand Up @@ -163,7 +163,7 @@ describe("clickhouse sql series:", () => {
});

let data = rp.parse("", response);
adhocCtrl.processResponse(data);
adhocCtrl.processTagKeysResponse(data);
it('should return adhoc filter list', function() {
let results = adhocCtrl.tagKeys;
expect(results.length).toBe(6);
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
"url": "https://github.com/Vertamedia/clickhouse-grafana"
}
],
"version": "2.0.1"
"version": "2.0.2"
}
}
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = {
}
],
plugins: [
new CleanWebpackPlugin('dist', { exclude: ['vertamedia-clickhouse-plugin_linux_amd64']}),
new CleanWebpackPlugin('dist', { exclude: ['vertamedia-clickhouse-plugin_linux_amd64','vertamedia-clickhouse-plugin_darwin_amd64','vertamedia-clickhouse-plugin_windows_amd64.exe']}),
new webpack.optimize.OccurrenceOrderPlugin(),
new CopyWebpackPlugin([
{from: 'plugin.json', to: '.'},
Expand Down

0 comments on commit 8601b8f

Please sign in to comment.