Skip to content

Commit

Permalink
Merge remote-tracking branch 'grafana/master' into anno-panel
Browse files Browse the repository at this point in the history
* grafana/master:
  Refactor: rename SeriesData to DataFrame (grafana#17854)
  devenv: switch OpenTSDB docker block (grafana#17849)
  Devenv:LDAP: couple simplifications for LDAP (grafana#17807)
  Login: divide login errors by pkg and service (grafana#17835)
  Auth Proxy: Respect auto_sign_up setting (grafana#17843)
  OAuth: return github teams as a part of user info (enable team sync) (grafana#17797)
  noImplicitAny: Sub 3000 errors (grafana#17821)
  TimePicker: Style and responsive fixes, restored dashboard settings (grafana#17822)
  Templating: Correctly display __text in multi-values variable (grafana#17840)
  Elasticsearch: Fix default max concurrent shard requests (grafana#17770)
  Explore: Fix filter by series level in logs graph (grafana#17798)
  Docs: Add v6.3 version notes and encryption format information (grafana#17825)
  Graphite: use POST for /metrics/find requests (grafana#17814)
  Dashboard: Force update after dashboard resize (grafana#17808)
  Toolkit: moved front end cli scripts to separate package and introduced very early version of plugin tools
  Explore: Uses new TimePicker from Grafana/UI (grafana#17793)
  Explore: Uses RFC3339Nano string to retrieve LogRow contexts from Loki API (grafana#17813)
  • Loading branch information
ryantxu committed Jul 1, 2019
2 parents c8ab779 + e7c3d0e commit cd89132
Show file tree
Hide file tree
Showing 197 changed files with 2,987 additions and 7,579 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
destination: expected-screenshots
- store_artifacts:
path: public/e2e-test/screenShots/theOutput
destination: output-screenshots
destination: output-screenshots

codespell:
docker:
Expand Down Expand Up @@ -653,7 +653,7 @@ workflows:
- mysql-integration-test
- postgres-integration-test
- build-oss-msi
filters: *filter-only-master
filters: *filter-only-master
- grafana-docker-master:
requires:
- build-all
Expand Down
2 changes: 2 additions & 0 deletions devenv/docker/blocks/openldap/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ EXPOSE 389

VOLUME ["/etc/ldap", "/var/lib/ldap"]

COPY ldap.conf /etc/ldap.dist/ldap.conf

COPY modules/ /etc/ldap.dist/modules
COPY prepopulate/ /etc/ldap.dist/prepopulate

Expand Down
1 change: 1 addition & 0 deletions devenv/docker/blocks/openldap/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
openldap:
container_name: ldap
build: docker/blocks/openldap
environment:
SLAPD_PASSWORD: grafana
Expand Down
4 changes: 0 additions & 4 deletions devenv/docker/blocks/openldap/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ EOF
dc_string="$dc_string,dc=$dc_part"
done

base_string="BASE ${dc_string:1}"

sed -i "s/^#BASE.*/${base_string}/g" /etc/ldap/ldap.conf

if [[ -n "$SLAPD_CONFIG_PASSWORD" ]]; then
password_hash=`slappasswd -s "${SLAPD_CONFIG_PASSWORD}"`

Expand Down
16 changes: 16 additions & 0 deletions devenv/docker/blocks/openldap/ldap.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#
# LDAP Defaults
#

# See ldap.conf(5) for details
# This file should be world readable but not world writable.

BASE dc=grafana,dc=org
#URI ldap://ldap.example.com ldap://ldap-master.example.com:666

SIZELIMIT 1000
#TIMELIMIT 15
#DEREF never

# TLS certificates (needed for GnuTLS)
TLS_CACERT /etc/ssl/certs/ca-certificates.crt
2 changes: 1 addition & 1 deletion devenv/docker/blocks/opentsdb/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
opentsdb:
image: opower/opentsdb:latest
image: petergrace/opentsdb-docker:latest
ports:
- "4242:4242"

Expand Down
2 changes: 2 additions & 0 deletions docs/sources/alerting/notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ Notification services which need public image access are marked as 'external onl

# Use alert rule tags in notifications {#alert-rule-tags}

> Only available in Grafana v6.3+.
Grafana can include a list of tags (key/value) in the notification.
It's called alert rule tags to contrast with tags parsed from timeseries.
It currently supports only the Prometheus Alertmanager notifier.
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/auth/auth-proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ldap_sync_ttl = 60
# Example `whitelist = 192.168.1.1, 192.168.1.0/24, 2001::23, 2001::0/120`
whitelist =
# Optionally define more headers to sync other user attributes
# Example `headers = Name:X-WEBAUTH-NAME Email:X-WEBAUTH-EMAIL`
# Example `headers = Name:X-WEBAUTH-NAME Email:X-WEBAUTH-EMAIL Groups:X-WEBAUTH-GROUPS`
headers =
```

Expand Down
2 changes: 2 additions & 0 deletions docs/sources/features/panels/graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ Repeat a panel for each value of a variable. Repeating panels are described in

### Data link

> Only available in Grafana v6.3+.
Data link in graph settings allows adding dynamic links to the visualization. Those links can link to either other dashboard or to an external URL.

{{< docs-imagebox img="/img/docs/data_link.png" max-width= "800px" >}}
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/installation/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ The number of days the keep me logged in / remember me cookie lasts.

### secret_key

Used for signing some datasource settings like secrets and passwords. Cannot be changed without requiring an update
Used for signing some datasource settings like secrets and passwords, the encryption format used is AES-256 in CFB mode. Cannot be changed without requiring an update
to datasource settings to re-encode them.

### disable_gravatar
Expand Down
9 changes: 8 additions & 1 deletion docs/sources/installation/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ The default cookie name for storing the auth token is `grafana_session`. you can

### Ensure encryption of datasource secrets

Datasources store passwords and basic auth passwords in secureJsonData encrypted by default. Existing datasource
Datasources store passwords and basic auth passwords in secureJsonData encrypted (AES-256 in CFB mode) by default. Existing datasource
will keep working with unencrypted passwords. If you want to migrate to encrypted storage for your existing datasources
you can do that by:

Expand All @@ -175,3 +175,10 @@ this new setting.
In 6.2 we completely removed the backend session storage since we replaced the previous login session implementation with an auth token.
If you are using Auth proxy with LDAP an shared cached is used in Grafana so you might want configure [remote_cache] instead. If not
Grafana will fallback to using the database as an shared cache.

### Upgrading Elasticsearch to v7.0+

The semantics of `max concurrent shard requests` changed in Elasticsearch v7.0, see [release notes](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/breaking-changes-7.0.html#semantics-changed-max-concurrent-shared-requests) for reference.

If you upgrade Elasticsearch to v7.0+ you should make sure to update the datasource configuration in Grafana so that version
is `7.0+` and `max concurrent shard requests` properly configured. 256 was the default in pre v7.0 versions. In v7.0 and above 5 is the default.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require (
github.com/bradfitz/gomemcache v0.0.0-20180710155616-bc664df96737
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd // indirect
github.com/codegangsta/cli v1.20.0
github.com/davecgh/go-spew v1.1.1
github.com/denisenkom/go-mssqldb v0.0.0-20190315220205-a8ed825ac853
github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51 // indirect
github.com/facebookgo/inject v0.0.0-20180706035515-f23751cae28b
Expand Down
27 changes: 8 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,11 @@
"@emotion/core": "10.0.10",
"@rtsao/plugin-proposal-class-properties": "7.0.1-patch.1",
"@types/angular": "1.6.54",
"@types/chalk": "2.2.0",
"@types/classnames": "2.2.7",
"@types/clipboard": "2.0.1",
"@types/commander": "2.12.2",
"@types/d3": "4.13.1",
"@types/enzyme": "3.9.0",
"@types/expect-puppeteer": "3.3.1",
"@types/inquirer": "0.0.43",
"@types/jest": "24.0.13",
"@types/jquery": "1.10.35",
"@types/lodash": "4.14.123",
Expand All @@ -49,16 +46,13 @@
"babel-jest": "24.8.0",
"babel-loader": "8.0.5",
"babel-plugin-angularjs-annotate": "0.10.0",
"chalk": "2.4.2",
"clean-webpack-plugin": "2.0.0",
"concurrently": "4.1.0",
"css-loader": "2.1.1",
"enzyme": "3.9.0",
"enzyme-adapter-react-16": "1.11.2",
"enzyme-to-json": "3.3.5",
"es6-promise": "3.3.1",
"es6-shim": "0.35.5",
"execa": "1.0.0",
"expect-puppeteer": "4.1.1",
"expect.js": "0.2.0",
"expose-loader": "0.7.5",
Expand All @@ -83,7 +77,6 @@
"html-webpack-harddisk-plugin": "1.0.1",
"html-webpack-plugin": "3.2.0",
"husky": "1.3.1",
"inquirer": "6.2.2",
"jest": "24.8.0",
"jest-date-mock": "1.0.7",
"lint-staged": "8.1.5",
Expand All @@ -98,7 +91,6 @@
"node-sass": "4.11.0",
"npm": "6.9.0",
"optimize-css-assets-webpack-plugin": "5.0.1",
"ora": "3.2.0",
"phantomjs-prebuilt": "2.1.16",
"pixelmatch": "4.0.2",
"pngjs": "3.4.0",
Expand All @@ -115,8 +107,6 @@
"rimraf": "2.6.3",
"sass-lint": "1.12.1",
"sass-loader": "7.1.0",
"semver": "5.7.0",
"simple-git": "^1.112.0",
"sinon": "1.17.6",
"style-loader": "0.23.1",
"systemjs": "0.20.19",
Expand All @@ -140,9 +130,9 @@
},
"scripts": {
"dev": "webpack --progress --colors --mode development --config scripts/webpack/webpack.dev.js",
"start": "npm run cli -- core:start --watchTheme",
"start:hot": "npm run cli -- core:start --hot --watchTheme",
"start:ignoreTheme": "npm run cli -- core:start --hot",
"start": "grafana-toolkit core:start --watchTheme",
"start:hot": "grafana-toolkit core:start --hot --watchTheme",
"start:ignoreTheme": "grafana-toolkit core:start --hot",
"watch": "yarn start -d watch,start core:start --watchTheme ",
"build": "grunt build",
"test": "grunt test",
Expand All @@ -153,16 +143,15 @@
"api-tests": "jest --notify --watch --config=devenv/e2e-api-tests/jest.js",
"storybook": "cd packages/grafana-ui && yarn storybook",
"storybook:build": "cd packages/grafana-ui && yarn storybook:build",
"themes:generate": "ts-node --project ./scripts/cli/tsconfig.json ./scripts/cli/generateSassVariableFiles.ts",
"prettier:check": "prettier --list-different \"**/*.{ts,tsx,scss}\"",
"prettier:write": "prettier --list-different \"**/*.{ts,tsx,scss}\" --write",
"cli": "ts-node --project ./scripts/cli/tsconfig.json ./scripts/cli/index.ts",
"gui:tslint": "tslint -c ./packages/grafana-ui/tslint.json --project ./packages/grafana-ui/tsconfig.json",
"gui:build": "npm run cli -- gui:build",
"gui:releasePrepare": "npm run cli -- gui:release",
"gui:build": "grafana-toolkit gui:build",
"gui:releasePrepare": "grafana-toolkit gui:release",
"gui:publish": "cd packages/grafana-ui/dist && npm publish --access public",
"gui:release": "npm run cli -- gui:release -p --createVersionCommit",
"precommit": "npm run cli -- precommit"
"gui:release": "grafana-toolkit gui:release -p --createVersionCommit",
"precommit": "grafana-toolkit precommit",
"themes:generate": "ts-node --project ./scripts/cli/tsconfig.json ./scripts/cli/generateSassVariableFiles.ts"
},
"husky": {
"hooks": {
Expand Down
Empty file.
52 changes: 52 additions & 0 deletions packages/grafana-toolkit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Grafana Toolkit

Make sure to run `yarn install` before trying anything! Otherwise you may see unknown command grafana-toolkit and spend a while tracking that down.

## Internal development
For development use `yarn link`. First, navigate to `packages/grafana-toolkit` and run `yarn link`. Then, in your project use `yarn link @grafana/toolkit` to use linked version.

## Grafana extensions development with grafana-toolkit overview

### Typescript
To configure Typescript create `tsconfig.json` file in the root dir of your app. grafana-toolkit comes with default tsconfig located in `packages/grafana-toolkit/src/config/tsconfig.plugin.ts`. In order for Typescript to be able to pickup your source files you need to extend that config as follows:

```json
{
"extends": "./node_modules/@grafana/toolkit/src/config/tsconfig.plugin.json",
"include": ["src"],
"compilerOptions": {
"rootDir": "./src",
"typeRoots": ["./node_modules/@types"]
}
}
```

### TSLint
grafana-toolkit comes with default config for TSLint, that's located in `packages/grafana-toolkit/src/config/tslint.plugin.ts`. As for now there is now way to customise TSLint config.

### Tests
grafana-toolkit comes with Jest as a test runner. It runs tests according to common config locted in `packages/grafana-toolkit/src/config/jest.plugin.config.ts`.

For now the config is not extendable, but our goal is to enable custom jest config via jest.config or package.json file. This might be required in the future if you want to use i.e. `enzyme-to-json` snapshots serializer. For that particular serializer we can also utilise it's API and add initialisation in the setup files (https://github.com/adriantoine/enzyme-to-json#serializer-in-unit-tests). We need to test that approach first.

#### Jest setup
We are not opinionated about tool used for implmenting tests. Internally at Grafana we use Enzyme. If you want to configure Enzyme as a testing utility, you need to configure enzyme-adapter-react. To do so, you need to create `[YOUR_APP]/config/jest-setup.ts` file that will provide React/Enzyme setup. Simply copy following code into that file to get Enzyme working with React:

```ts
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';

configure({ adapter: new Adapter() });
```

grafana-toolkit will use that file as Jest's setup file. You can also setup Jest with shims of your needs by creating `jest-shim.ts` file in the same directory: `[YOUR_APP]/config/jest-shim.ts`

Adidtionaly, you can also provide additional Jest config via package.json file. For more details please refer to [Jest docs](https://jest-bot.github.io/jest/docs/configuration.html#verbose-boolean). Currently we support following properties:
- [`snapshotSerializers`](https://jest-bot.github.io/jest/docs/configuration.html#snapshotserializers-array-string)

## Prettier [todo]

## Development mode [todo]
TODO
- Enable rollup watch on extension sources

5 changes: 5 additions & 0 deletions packages/grafana-toolkit/bin/grafana-toolkit.dist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env node

// This bin is used for cli installed from npm

require('../src/cli/index.js').run();
13 changes: 13 additions & 0 deletions packages/grafana-toolkit/bin/grafana-toolkit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env node

var path = require('path') ;

// This bin is used for cli executed internally

var tsProjectPath = path.resolve(__dirname, '../tsconfig.json');

require('ts-node').register({
project: tsProjectPath
});

require('../src/cli/index.ts').run(true);
71 changes: 71 additions & 0 deletions packages/grafana-toolkit/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"name": "@grafana/toolkit",
"version": "6.3.0-alpha.2",
"description": "Grafana Toolkit",
"keywords": [
"typescript",
"react",
"react-component"
],
"bin": {
"grafana-toolkit": "./bin/grafana-toolkit.js"
},
"scripts": {
"tslint": "tslint -c tslint.json --project tsconfig.json",
"typecheck": "tsc --noEmit",
"precommit": "npm run tslint & npm run typecheck",
"clean": "rimraf ./dist ./compiled"
},
"author": "Grafana Labs",
"license": "Apache-2.0",
"dependencies": {
"@types/execa": "^0.9.0",
"@types/inquirer": "^6.0.3",
"@types/jest": "24.0.13",
"@types/jest-cli": "^23.6.0",
"@types/node": "^12.0.4",
"@types/prettier": "^1.16.4",
"@types/semver": "^6.0.0",
"axios": "0.19.0",
"chalk": "^2.4.2",
"commander": "^2.20.0",
"concurrently": "4.1.0",
"execa": "^1.0.0",
"glob": "^7.1.4",
"inquirer": "^6.3.1",
"jest-cli": "^24.8.0",
"lodash": "4.17.11",
"ora": "^3.4.0",
"prettier": "^1.17.1",
"replace-in-file": "^4.1.0",
"rollup": "^1.14.2",
"rollup-plugin-commonjs": "^10.0.0",
"rollup-plugin-copy-glob": "^0.3.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-builtins": "^2.1.2",
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-node-resolve": "^5.1.0",
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-terser": "^5.0.0",
"rollup-plugin-typescript2": "^0.21.1",
"rollup-plugin-visualizer": "^1.1.1",
"semver": "^6.1.1",
"simple-git": "^1.112.0",
"ts-node": "^8.2.0",
"tslint": "5.14.0"
},
"peerDependencies": {
"jest": "24.8.0",
"ts-jest": "24.0.2",
"tslib": "1.10.0",
"typescript": "3.5.1"
},
"resolutions": {
"@types/lodash": "4.14.119",
"rollup-plugin-typescript2": "0.21.1"
},
"devDependencies": {
"@types/glob": "^7.1.1",
"rollup-watch": "^4.3.1"
}
}
File renamed without changes.
Loading

0 comments on commit cd89132

Please sign in to comment.