Compare commits

..

1 Commits

Author SHA1 Message Date
Torkel Ödegaard
03773a0cb0 QueryOptions: Add resolution option / factor that multiplies with MaxDataPoints 2022-07-04 09:05:13 +02:00
9677 changed files with 273465 additions and 705535 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,18 +1,28 @@
import { regexp } from '@betterer/regexp';
import { eslint } from '@betterer/eslint';
import { BettererFileTest } from '@betterer/betterer';
import { ESLint, Linter } from 'eslint';
import { existsSync } from 'fs';
import path from 'path';
import glob from 'glob';
export default {
'better eslint': () => countEslintErrors().include('**/*.{ts,tsx}'),
'no undocumented stories': () => countUndocumentedStories().include('**/*.story.tsx'),
'no enzyme tests': () => regexp(/from 'enzyme'/g).include('**/*.test.*'),
'better eslint': () =>
eslint({
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/consistent-type-assertions': [
'error',
{
assertionStyle: 'never',
},
],
}).include('**/*.{ts,tsx}'),
'no undocumented stories': () => countUndocumentedStories().include('**/*.{story.tsx,mdx}'),
};
function countUndocumentedStories() {
return new BettererFileTest(async (filePaths, fileTestResult) => {
filePaths.forEach((filePath) => {
if (!existsSync(filePath.replace(/\.story.tsx$/, '.mdx'))) {
const storyFilePaths = filePaths.filter((filePath) => filePath.endsWith('story.tsx'));
const mdxFilePaths = filePaths.filter((filePath) => filePath.endsWith('mdx'));
storyFilePaths.forEach((filePath) => {
if (!mdxFilePaths.includes(filePath.replace(/\.story.tsx$/, '.mdx'))) {
// In this case the file contents don't matter:
const file = fileTestResult.addFile(filePath, '');
// Add the issue to the first character of the file:
@@ -21,81 +31,3 @@ function countUndocumentedStories() {
});
});
}
async function findEslintConfigFiles(): Promise<string[]> {
return new Promise((resolve, reject) => {
glob('**/.eslintrc', (err, files) => {
if (err) {
reject(err);
}
resolve(files);
});
});
}
function countEslintErrors() {
return new BettererFileTest(async (filePaths, fileTestResult, resolver) => {
const { baseDirectory } = resolver;
const cli = new ESLint({ cwd: baseDirectory });
const eslintConfigFiles = await findEslintConfigFiles();
const eslintConfigMainPaths = eslintConfigFiles.map((file) => path.resolve(path.dirname(file)));
const baseRules: Partial<Linter.RulesRecord> = {
'@typescript-eslint/no-explicit-any': 'error',
'@grafana/no-aria-label-selectors': 'error',
};
const nonTestFilesRules: Partial<Linter.RulesRecord> = {
...baseRules,
'@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'never' }],
};
// group files by eslint config file
// this will create two file groups for each eslint config file
// one for test files and one for non-test files
const fileGroups: Record<string, string[]> = {};
for (const filePath of filePaths) {
let configPath = eslintConfigMainPaths.find((configPath) => filePath.startsWith(configPath)) ?? '';
const isTestFile =
filePath.endsWith('.test.tsx') ||
filePath.endsWith('.test.ts') ||
filePath.includes('__mocks__') ||
filePath.includes('public/test/');
if (isTestFile) {
configPath += '-test';
}
if (!fileGroups[configPath]) {
fileGroups[configPath] = [];
}
fileGroups[configPath].push(filePath);
}
for (const configPath of Object.keys(fileGroups)) {
const rules = configPath.endsWith('-test') ? baseRules : nonTestFilesRules;
// this is by far the slowest part of this code. It takes eslint about 2 seconds just to find the config
const linterOptions = (await cli.calculateConfigForFile(fileGroups[configPath][0])) as Linter.Config;
const runner = new ESLint({
baseConfig: {
...linterOptions,
rules: rules,
},
useEslintrc: false,
cwd: baseDirectory,
});
const lintResults = await runner.lintFiles(fileGroups[configPath]);
lintResults
.filter((lintResult) => lintResult.source)
.forEach((lintResult) => {
const { messages } = lintResult;
const filePath = lintResult.filePath;
const file = fileTestResult.addFile(filePath, '');
messages.forEach((message, index) => {
file.addIssue(0, 0, message.message, `${index}`);
});
});
}
});
}

View File

@@ -1,4 +1,4 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.8. DO NOT EDIT.
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.6. DO NOT EDIT.
# All tools are designed to be build inside $GOBIN.
BINGO_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
GOPATH ?= $(shell go env GOPATH)
@@ -21,41 +21,29 @@ BRA := $(GOBIN)/bra-v0.0.0-20200517080246-1e3013ecaff8
$(BRA): $(BINGO_DIR)/bra.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/bra-v0.0.0-20200517080246-1e3013ecaff8"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=bra.mod -o=$(GOBIN)/bra-v0.0.0-20200517080246-1e3013ecaff8 "github.com/unknwon/bra"
CUE := $(GOBIN)/cue-v0.5.0-beta.2
$(CUE): $(BINGO_DIR)/cue.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/cue-v0.5.0-beta.2"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=cue.mod -o=$(GOBIN)/cue-v0.5.0-beta.2 "cuelang.org/go/cmd/cue"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=bra.mod -o=$(GOBIN)/bra-v0.0.0-20200517080246-1e3013ecaff8 "github.com/unknwon/bra"
DRONE := $(GOBIN)/drone-v1.5.0
$(DRONE): $(BINGO_DIR)/drone.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/drone-v1.5.0"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=drone.mod -o=$(GOBIN)/drone-v1.5.0 "github.com/drone/drone-cli/drone"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=drone.mod -o=$(GOBIN)/drone-v1.5.0 "github.com/drone/drone-cli/drone"
GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.51.2
$(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/golangci-lint-v1.51.2"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.51.2 "github.com/golangci/golangci-lint/cmd/golangci-lint"
JB := $(GOBIN)/jb-v0.5.1
$(JB): $(BINGO_DIR)/jb.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/jb-v0.5.1"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=jb.mod -o=$(GOBIN)/jb-v0.5.1 "github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb"
SWAGGER := $(GOBIN)/swagger-v0.30.2
SWAGGER := $(GOBIN)/swagger-v0.29.0
$(SWAGGER): $(BINGO_DIR)/swagger.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/swagger-v0.30.2"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=swagger.mod -o=$(GOBIN)/swagger-v0.30.2 "github.com/go-swagger/go-swagger/cmd/swagger"
@echo "(re)installing $(GOBIN)/swagger-v0.29.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=swagger.mod -o=$(GOBIN)/swagger-v0.29.0 "github.com/go-swagger/go-swagger/cmd/swagger"
GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.40.1
$(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/golangci-lint-v1.40.1"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.40.1 "github.com/golangci/golangci-lint/cmd/golangci-lint"
WIRE := $(GOBIN)/wire-v0.5.0
$(WIRE): $(BINGO_DIR)/wire.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/wire-v0.5.0"
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=wire.mod -o=$(GOBIN)/wire-v0.5.0 "github.com/google/wire/cmd/wire"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=wire.mod -o=$(GOBIN)/wire-v0.5.0 "github.com/google/wire/cmd/wire"

View File

@@ -2,6 +2,6 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.17
replace golang.org/x/sys => golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c
require github.com/unknwon/bra v0.0.0-20200517080246-1e3013ecaff8
replace golang.org/x/sys => golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c

View File

@@ -1,5 +0,0 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.19
require cuelang.org/go v0.5.0-beta.2 // cmd/cue

View File

@@ -1,30 +0,0 @@
cuelang.org/go v0.4.3 h1:W3oBBjDTm7+IZfCKZAmC8uDG0eYfJL4Pp/xbbCMKaVo=
cuelang.org/go v0.4.3/go.mod h1:7805vR9H+VoBNdWFdI7jyDR3QLUPp4+naHfbcgp55HI=
cuelang.org/go v0.5.0-beta.2 h1:am5M7jGvNTJ0rnjrFNyvE7fucL/wRqb0emK4XxdThQI=
cuelang.org/go v0.5.0-beta.2/go.mod h1:okjJBHFQFer+a41sAe2SaGm1glWS8oEb6CmJvn5Zdws=
github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=
github.com/cockroachdb/apd/v2 v2.0.1 h1:y1Rh3tEU89D+7Tgbw+lp52T6p/GJLpDmNvr10UWqLTE=
github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E=
github.com/emicklei/proto v1.6.15 h1:XbpwxmuOPrdES97FrSfpyy67SSCV/wBIKXqgJzh6hNw=
github.com/emicklei/proto v1.10.0 h1:pDGyFRVV5RvV+nkBK9iy3q67FBy9Xa7vwrOTE+g5aGw=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs=
github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=
github.com/mpvl/unique v0.0.0-20150818121801-cbe035fff7de h1:D5x39vF5KCwKQaw+OC9ZPiLVHXz3UFw2+psEX+gYcto=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/protocolbuffers/txtpbfmt v0.0.0-20201118171849-f6a6b3f636fc h1:gSVONBi2HWMFXCa9jFdYvYk7IwW/mTLxWOF7rXS4LO0=
github.com/protocolbuffers/txtpbfmt v0.0.0-20220428173112-74888fd59c2b h1:zd/2RNzIRkoGGMjE+YIsZ85CnDIz672JK2F3Zl4vux4=
github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449 h1:xUIPaMhvROX9dhPvRCenIJtU78+lbEenGbgqB5hfHCQ=
golang.org/x/mod v0.6.0-dev.0.20220818022119-ed83ed61efb9 h1:VtCrPQXM5Wo9l7XN64SjBMczl48j8mkP+2e3OhYlz+0=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY=
golang.org/x/tools v0.0.0-20200612220849-54c614fe050c h1:g6oFfz6Cmw68izP3xsdud3Oxu145IPkeFzyRg58AKHM=
golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

View File

@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.19
go 1.17
require github.com/golangci/golangci-lint v1.51.2 // cmd/golangci-lint
require github.com/golangci/golangci-lint v1.40.1 // cmd/golangci-lint

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +0,0 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.18
require github.com/jsonnet-bundler/jsonnet-bundler v0.5.1 // cmd/jb

View File

@@ -1,50 +0,0 @@
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc=
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE=
github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/jsonnet-bundler/jsonnet-bundler v0.5.1 h1:eUd6EA1Qzz73Q4NLNLOrNkMb96+6NTTERbX9lqaxVwk=
github.com/jsonnet-bundler/jsonnet-bundler v0.5.1/go.mod h1:Qrdw/7mOFS2SKCOALKFfEH8gdvXJi8XZjw9g5ilpf4I=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.4/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c h1:aFV+BgZ4svzjfabn8ERpuB4JI4N6/rdy1iusx77G3oU=
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View File

@@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.18
require github.com/go-swagger/go-swagger v0.30.2 // cmd/swagger
require github.com/go-swagger/go-swagger v0.29.0 // cmd/swagger

View File

@@ -1,86 +1,48 @@
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8=
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ=
github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o=
github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk=
github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI=
github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI=
github.com/go-openapi/analysis v0.21.2 h1:hXFrOYFHUAMQdu6zwAiKKJHJQ8kqZs1ux/ru1P1wLJU=
github.com/go-openapi/analysis v0.21.4 h1:ZDFLvSNxpDaomuCueM0BlSXxpANBlFYiBvr+GXrvIHc=
github.com/go-openapi/errors v0.20.2 h1:dxy7PGTqEh94zj2E3h1cUmQQWiM1+aeCROfAr02EmK8=
github.com/go-openapi/errors v0.20.3 h1:rz6kiC84sqNQoqrtulzaL/VERgkoCyB6WdEkc2ujzUc=
github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4=
github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=
github.com/go-openapi/jsonreference v0.19.6 h1:UBIxjkht+AWIgYzCDSv2GN+E/togfwXUJFRTWhl2Jjs=
github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA=
github.com/go-openapi/loads v0.21.0 h1:jYtUO4wwP7psAweisP/MDoOpdzsYEESdoPcsWjHDR68=
github.com/go-openapi/loads v0.21.2 h1:r2a/xFIYeZ4Qd2TnGpWDIQNcP80dIaZgf704za8enro=
github.com/go-openapi/runtime v0.21.1 h1:/KIG00BzA2x2HRStX2tnhbqbQdPcFlkgsYCiNY20FZs=
github.com/go-openapi/runtime v0.24.1 h1:Sml5cgQKGYQHF+M7yYSHaH1eOjvTykrddTE/KtQVjqo=
github.com/go-openapi/spec v0.20.4 h1:O8hJrt0UMnhHcluhIdUgCLRWyM2x7QkBXRvOs7m+O1M=
github.com/go-openapi/spec v0.20.7 h1:1Rlu/ZrOCCob0n+JKKJAWhNWMPW8bOZRg8FJaY+0SKI=
github.com/go-openapi/strfmt v0.21.1 h1:G6s2t5V5kGCHLVbSdZ/6lI8Wm4OzoPFkc3/cjAsKQrM=
github.com/go-openapi/strfmt v0.21.3 h1:xwhj5X6CjXEZZHMWy1zKJxvW9AfHC9pkyUjLvHtKG7o=
github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM=
github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
github.com/go-openapi/validate v0.20.3 h1:GZPPhhKSZrE8HjB4eEkoYAZmoWA4+tCemSgINH1/vKw=
github.com/go-openapi/validate v0.22.0 h1:b0QecH6VslW/TxtpKgzpO1SNG7GU2FsaqKdP1E2T50Y=
github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw=
github.com/go-swagger/go-swagger v0.29.0 h1:z3YoZtLvS1Y8TE/PCat1VypcZxM0IgKLt0NvZxQyNl8=
github.com/go-swagger/go-swagger v0.29.0/go.mod h1:Z4GJzI+bHKKkGB2Ji1rawpi3/ldXX8CkzGIa9HAC5EE=
github.com/go-swagger/go-swagger v0.30.2 h1:23odPUyQZdkNFZZSBJ3mqYYcdh+LnuReEbdWN18OMRo=
github.com/go-swagger/go-swagger v0.30.2/go.mod h1:neDPes8r8PCz2JPvHRDj8BTULLh4VJUt7n6MpQqxhHM=
github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw=
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls=
github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=
github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM=
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
github.com/spf13/afero v1.8.0 h1:5MmtuhAgYeU6qpa7w7bP0dv6MBYuup0vekhSpSkoq60=
github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo=
github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA=
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/viper v1.10.1 h1:nuJZuYpG7gTj/XqiUwg8bA0cp1+M2mC3J4g5luUYBKk=
github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.3.0 h1:mjC+YW8QpAdXibNi+vNWgzmgBH4+5l5dCXv8cNysBLI=
github.com/toqueteos/webbrowser v1.2.0 h1:tVP/gpK69Fx+qMJKsLE7TD8LuGWPnEV71wBN9rrstGQ=
go.mongodb.org/mongo-driver v1.8.2 h1:8ssUXufb90ujcIvR6MyE1SchaNj0SFxsakiZgxIyrMk=
go.mongodb.org/mongo-driver v1.10.1 h1:NujsPveKwHaWuKUer/ceo9DzEe7HIj1SlJ6uvXZG0S4=
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM=
golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
golang.org/x/net v0.0.0-20220121210141-e204ce36a2ba h1:6u6sik+bn/y7vILcYkK3iwTBWN7WtBvB0+SZswQnbf8=
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0=
golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 h1:v6hYoSR9T5oet+pMXwUWkbiVqx/63mlHjefrHmxwfeY=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/tools v0.1.8 h1:P1HhGGuLW4aAclzjtmJdf0mJOjVUZUzOTqkAkWL+l6w=
golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
gopkg.in/ini.v1 v1.66.3 h1:jRskFVxYaMGAMUbN0UZ7niA9gzL9B49DOqE78vg0k3w=
gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

View File

@@ -1,4 +1,4 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.8. DO NOT EDIT.
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.6. DO NOT EDIT.
# All tools are designed to be build inside $GOBIN.
# Those variables will work only until 'bingo get' was invoked, or if tools were installed via Makefile's Variables.mk.
GOBIN=${GOBIN:=$(go env GOBIN)}
@@ -10,15 +10,11 @@ fi
BRA="${GOBIN}/bra-v0.0.0-20200517080246-1e3013ecaff8"
CUE="${GOBIN}/cue-v0.5.0-beta.2"
DRONE="${GOBIN}/drone-v1.5.0"
GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.51.2"
SWAGGER="${GOBIN}/swagger-v0.29.0"
JB="${GOBIN}/jb-v0.5.1"
SWAGGER="${GOBIN}/swagger-v0.30.2"
GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.40.1"
WIRE="${GOBIN}/wire-v0.5.0"

View File

@@ -1,9 +1,9 @@
[run]
init_cmds = [
["make", "gen-go"],
["make", "gen-jsonnet"],
["GO_BUILD_DEV=1", "make", "build-go"],
["./bin/grafana", "server", "-packaging=dev", "cfg:app_mode=development"]
["GO_BUILD_DEV=1", "make", "build-cli"],
["GO_BUILD_DEV=1", "make", "build-server"],
["./bin/grafana-server", "-packaging=dev", "cfg:app_mode=development"]
]
watch_all = true
follow_symlinks = true
@@ -11,14 +11,12 @@ watch_dirs = [
"$WORKDIR/pkg",
"$WORKDIR/public/views",
"$WORKDIR/conf",
"$WORKDIR/devenv/dev-dashboards",
]
watch_exts = [".go", ".ini", ".toml", ".template.html"]
ignore_files = [".*_gen.go"]
build_delay = 1500
cmds = [
["make", "gen-go"],
["make", "gen-jsonnet"],
["GO_BUILD_DEV=1", "make", "build-go"],
["./bin/grafana", "server", "-packaging=dev", "cfg:app_mode=development"]
["GO_BUILD_DEV=1", "make", "build-server"],
["./bin/grafana-server", "-packaging=dev", "cfg:app_mode=development"]
]

View File

@@ -2,6 +2,7 @@
.dockerignore
.git
.gitignore
.github
.vscode
bin
data*

View File

@@ -3,62 +3,19 @@
# 2. Login to drone and export the env variables (token and server) shown here: https://drone.grafana.net/account
# 3. Run `make drone`
# More information about this process here: https://github.com/grafana/deployment_tools/blob/master/docs/infrastructure/drone/signing.md
"""
This module returns a Drone configuration including pipelines and secrets.
"""
load("scripts/drone/events/pr.star", "pr_pipelines")
load("scripts/drone/events/main.star", "main_pipelines")
load(
"scripts/drone/events/release.star",
"artifacts_page_pipeline",
"enterprise2_pipelines",
"enterprise_pipelines",
"integration_test_pipelines",
"oss_pipelines",
"publish_artifacts_pipelines",
"publish_npm_pipelines",
"publish_packages_pipeline",
)
load(
"scripts/drone/pipelines/publish_images.star",
"publish_image_pipelines_public",
"publish_image_pipelines_security",
)
load(
"scripts/drone/pipelines/ci_images.star",
"publish_ci_windows_test_image_pipeline",
)
load("scripts/drone/pipelines/github.star", "publish_github_pipeline")
load("scripts/drone/pipelines/aws_marketplace.star", "publish_aws_marketplace_pipeline")
load("scripts/drone/version.star", "version_branch_pipelines")
load("scripts/drone/events/cron.star", "cronjobs")
load("scripts/drone/vault.star", "secrets")
load('scripts/drone/pipelines/pr.star', 'pr_pipelines')
load('scripts/drone/pipelines/main.star', 'main_pipelines')
load('scripts/drone/pipelines/docs.star', 'docs_pipelines')
load('scripts/drone/pipelines/release.star', 'release_pipelines', 'publish_image_pipelines', 'publish_artifacts_pipelines', 'publish_npm_pipelines', 'publish_packages_pipeline')
load('scripts/drone/version.star', 'version_branch_pipelines')
load('scripts/drone/pipelines/cron.star', 'cronjobs')
load('scripts/drone/vault.star', 'secrets')
def main(_ctx):
return (
pr_pipelines() +
main_pipelines() +
oss_pipelines() +
enterprise_pipelines() +
enterprise2_pipelines() +
enterprise2_pipelines(
prefix = "custom-",
trigger = {"event": ["custom"]},
) +
publish_image_pipelines_public() +
publish_image_pipelines_security() +
publish_github_pipeline("public") +
publish_github_pipeline("security") +
publish_aws_marketplace_pipeline("public") +
publish_artifacts_pipelines("security") +
publish_artifacts_pipelines("public") +
publish_npm_pipelines() +
publish_packages_pipeline() +
artifacts_page_pipeline() +
version_branch_pipelines() +
integration_test_pipelines() +
publish_ci_windows_test_image_pipeline() +
cronjobs() +
secrets()
)
def main(ctx):
edition = 'oss'
return pr_pipelines(edition=edition) + main_pipelines(edition=edition) + release_pipelines() + \
publish_image_pipelines('public') + publish_image_pipelines('security') + \
publish_artifacts_pipelines('security') + publish_artifacts_pipelines('public') + \
publish_npm_pipelines('public') + publish_packages_pipeline() + \
version_branch_pipelines() + cronjobs(edition=edition) + secrets()

5215
.drone.yml

File diff suppressed because it is too large Load Diff

View File

@@ -17,7 +17,7 @@ vendor
# TS generate from cue by cuetsy
**/*.gen.ts
# Auto-generated internationalization files
# Auto-generated localisation files
public/locales/_build/
public/locales/**/*.js

View File

@@ -1,15 +1,13 @@
{
"extends": ["@grafana/eslint-config"],
"root": true,
"plugins": ["@emotion", "lodash", "jest", "import", "jsx-a11y", "@grafana"],
"plugins": ["@emotion", "lodash", "jest", "import"],
"settings": {
"import/internal-regex": "^(app/)|(@grafana)",
"import/external-module-folders": ["node_modules", ".yarn"]
},
"rules": {
"react/prop-types": "off",
// need to ignore emotion's `css` prop, see https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md#rule-options
"react/no-unknown-property": ["error", { "ignore": ["css"] }],
"@emotion/jsx-import": "error",
"lodash/import-scope": [2, "member"],
"jest/no-focused-tests": "error",
@@ -20,36 +18,9 @@
"newlines-between": "always",
"alphabetize": { "order": "asc" }
}
],
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "react-redux",
"importNames": ["useDispatch", "useSelector"],
"message": "Please import from app/types instead."
},
{
"name": "react-i18next",
"importNames": ["Trans", "t"],
"message": "Please import from app/core/internationalization instead"
}
]
}
],
// Use typescript's no-redeclare for compatibility with overrides
"no-redeclare": "off",
"@typescript-eslint/no-redeclare": ["error"]
]
},
"overrides": [
{
"files": ["public/app/features/scenes/**/*.{ts,tsx}"],
"rules": {
"@typescript-eslint/explicit-member-accessibility": ["error", { "accessibility": "explicit" }]
}
},
{
"files": ["packages/grafana-ui/src/components/uPlot/**/*.{ts,tsx}"],
"rules": {
@@ -64,38 +35,6 @@
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off"
}
},
{
"files": ["public/dashboards/scripted*.js"],
"rules": {
"no-redeclare": "error",
"@typescript-eslint/no-redeclare": "off"
}
},
{
"extends": ["plugin:jsx-a11y/recommended"],
"files": ["**/*"],
"excludedFiles": ["**/*.{spec,test}.{ts,tsx}"],
"rules": {
// rules marked "off" are those left in the recommended preset we need to fix
// we should remove the corresponding line and fix them one by one
// any marked "error" contain specific overrides we'll need to keep
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-autofocus": [
"error",
{
"ignoreNonDOM": true
}
],
"jsx-a11y/no-static-element-interactions": "off",
"jsx-a11y/label-has-associated-control": [
"error",
{
"controlComponents": ["NumberInput"],
"depth": 2
}
]
}
}
]
}

700
.github/CODEOWNERS vendored
View File

@@ -11,611 +11,173 @@
# In each subsection folders are ordered first by depth, then alphabetically.
# This should make it easy to add new rules without breaking existing ones.
# Documentation
/docs/ @grafana/docs-grafana
/contribute/ @grafana/docs-grafana
/docs/sources/developers/plugins/ @grafana/docs-grafana @grafana/plugins-platform-frontend @grafana/plugins-platform-backend
/docs/sources/developers/plugins/backend/ @grafana/docs-grafana @grafana/plugins-platform-backend
/.changelog-archive @grafana/docs-grafana
CHANGELOG.md @grafana/docs-grafana
CODE_OF_CONDUCT.md @grafana/docs-grafana
CONTRIBUTING.md @grafana/docs-grafana
GOVERNANCE.md @RichiH
HALL_OF_FAME.md @grafana/docs-grafana
ISSUE_TRIAGE.md @grafana/grafana-community-support
LICENSE @torkelo
LICENSING.md @torkelo
MAINTAINERS.md @RichiH
NOTICE.md @torkelo
README.md @grafana/docs-grafana
ROADMAP.md @torkelo
SECURITY.md @grafana/security-team
SUPPORT.md @torkelo
UPGRADING_DEPENDENCIES.md @grafana/docs-grafana
WORKFLOW.md @torkelo
# Technical documentation
/docs/ @Eve832 @jdbaldry
/docs/sources/ @Eve832
/docs/sources/administration/ @Eve832 @GrafanaWriter
/docs/sources/alerting/ @brendamuir
/docs/sources/dashboards/ @imatwawana
/docs/sources/datasources/ @Eve832 @GrafanaWriter
/docs/sources/explore/ @Eve832 @GrafanaWriter
/docs/sources/fundamentals @chri2547
/docs/sources/getting-started/ @chri2547
/docs/sources/introduction/ @chri2547
/docs/sources/old-alerting/ @brendamuir
/docs/sources/panels-visualizations/ @imatwawana
/docs/sources/release-notes/ @Eve832 @GrafanaWriter
/docs/sources/setup-grafana/ @chri2547
/docs/sources/upgrade-guide/ @chri2547 @imatwawana
/docs/sources/whatsnew/ @chri2547 @imatwawana
/docs/sources/developers/plugins/ @Eve832 @josmperez @grafana/plugins-platform-frontend @grafana/plugins-platform-backend
/docs/sources/developers/plugins/backend/ @Eve832 @grafana/plugins-platform-backend
# Documentation owner: Jita Chatterjee
/docs/ @grafana/docs-squad
/contribute/ @marcusolsson @grafana/docs-squad
/docs/sources/developers/plugins/ @marcusolsson @grafana/docs-squad @grafana/plugins-platform-frontend @grafana/plugins-platform-backend
/docs/sources/developers/plugins/backend @marcusolsson @grafana/docs-squad @grafana/plugins-platform-backend
/docs/sources/enterprise/ @osg-grafana @grafana/docs-squad
# Backend code
/go.mod @grafana/backend-platform
/go.sum @grafana/backend-platform
/.bingo/ @grafana/backend-platform
/pkg/README.md @grafana/backend-platform
/pkg/ruleguard.rules.go @grafana/backend-platform
/.bra.toml @grafana/backend-platform
/.golangci.toml @grafana/backend-platform
/build.go @grafana/backend-platform
/pkg/api/ @grafana/backend-platform
/pkg/bus/ @grafana/backend-platform
/pkg/cmd/ @grafana/backend-platform
/pkg/components/apikeygen/ @grafana/grafana-authnz-team
/pkg/components/apikeygenprefixed/ @grafana/grafana-authnz-team
/pkg/components/dashdiffs/ @grafana/backend-platform
/pkg/components/imguploader/ @grafana/backend-platform
/pkg/components/loki/ @grafana/backend-platform
/pkg/components/null/ @grafana/backend-platform
/pkg/components/simplejson/ @grafana/backend-platform
/pkg/events/ @grafana/backend-platform
/pkg/extensions/ @grafana/backend-platform
/pkg/ifaces/ @grafana/backend-platform
/pkg/infra/appcontext/ @grafana/backend-platform
/pkg/infra/db/ @grafana/backend-platform
/pkg/infra/grn/ @grafana/backend-platform
/pkg/infra/localcache/ @grafana/backend-platform
/pkg/infra/log/ @grafana/backend-platform
/pkg/infra/metrics/ @grafana/backend-platform
/pkg/infra/network/ @grafana/backend-platform
/pkg/infra/process/ @grafana/backend-platform
/pkg/infra/remotecache/ @grafana/backend-platform
/pkg/infra/serverlock/ @grafana/backend-platform
/pkg/infra/slugify/ @grafana/backend-platform
/pkg/infra/tracing/ @grafana/backend-platform
/pkg/infra/usagestats/ @grafana/backend-platform
/pkg/middleware/ @grafana/backend-platform
/pkg/mocks/ @grafana/backend-platform
/pkg/models/ @grafana/backend-platform
/pkg/server/ @grafana/backend-platform
/pkg/services/annotations/ @grafana/backend-platform
/pkg/services/apikey/ @grafana/backend-platform
/pkg/services/cleanup/ @grafana/backend-platform
/pkg/services/comments/ @grafana/backend-platform
/pkg/services/contexthandler/ @grafana/backend-platform
/pkg/services/correlations/ @grafana/backend-platform
/pkg/services/dashboardimport/ @grafana/backend-platform
/pkg/services/dashboards/ @grafana/backend-platform
/pkg/services/dashboardsnapshots/ @grafana/backend-platform
/pkg/services/dashboardversion/ @grafana/backend-platform
/pkg/services/encryption/ @grafana/backend-platform
/pkg/services/featuremgmt/ @grafana/backend-platform
/pkg/services/folder/ @grafana/backend-platform
/pkg/services/hooks/ @grafana/backend-platform
/pkg/services/kmsproviders/ @grafana/backend-platform
/pkg/services/licensing/ @grafana/backend-platform
/pkg/services/navtree/ @grafana/backend-platform
/pkg/services/notifications/ @grafana/backend-platform
/pkg/services/org/ @grafana/backend-platform
/pkg/services/playlist/ @grafana/backend-platform
/pkg/services/plugindashboards/ @grafana/backend-platform
/pkg/services/pluginsettings/ @grafana/backend-platform
/pkg/services/preference/ @grafana/backend-platform
/pkg/services/provisioning/ @grafana/backend-platform
/pkg/services/publicdashboards/ @grafana/dashboards-squad
/pkg/services/query/ @grafana/backend-platform
/pkg/services/queryhistory/ @grafana/backend-platform
/pkg/services/quota/ @grafana/backend-platform
/pkg/services/rendering/ @grafana/backend-platform
/pkg/services/screenshot/ @grafana/backend-platform
/pkg/services/search/ @grafana/backend-platform
/pkg/services/searchusers/ @grafana/backend-platform
/pkg/services/secrets/ @grafana/backend-platform
/pkg/services/shorturls/ @grafana/backend-platform
/pkg/services/sqlstore/ @grafana/backend-platform
/pkg/services/star/ @grafana/backend-platform
/pkg/services/stats/ @grafana/backend-platform
/pkg/services/tag/ @grafana/backend-platform
/pkg/services/team/ @grafana/grafana-authnz-team
/pkg/services/temp_user/ @grafana/backend-platform
/pkg/services/updatechecker/ @grafana/backend-platform
/pkg/services/user/ @grafana/backend-platform
/pkg/services/validations/ @grafana/backend-platform
/pkg/setting/ @grafana/backend-platform
/pkg/tests/ @grafana/backend-platform
/pkg/tests/api/correlations/ @grafana/explore-squad
/pkg/tsdb/grafanads/ @grafana/backend-platform
/pkg/tsdb/intervalv2/ @grafana/backend-platform
/pkg/tsdb/legacydata/ @grafana/backend-platform
/pkg/tsdb/opentsdb/ @grafana/backend-platform
/pkg/tsdb/sqleng/ @grafana/backend-platform
/pkg/util/ @grafana/backend-platform
/pkg/web/ @grafana/backend-platform
/pkg/services/grpcserver/ @grafana/backend-platform
/pkg/infra/kvstore/ @grafana/backend-platform
/pkg/infra/fs/ @grafana/backend-platform
/pkg/infra/x/ @grafana/backend-platform
# devenv
# Backend code, developers environment
/devenv/docker/blocks/auth/ @grafana/grafana-authnz-team
# Logs code, developers environment
/devenv/docker/blocks/loki* @grafana/observability-logs
/devenv/docker/blocks/elastic* @grafana/observability-logs
# Performance tests
/devenv/docker/loadtest-ts/ @grafana/multitenancy-squad
/devenv/bulk-dashboards/ @grafana/dashboards-squad
/devenv/bulk_alerting_dashboards/ @grafana/alerting-squad-backend
/devenv/create_docker_compose.sh @grafana/backend-platform
/devenv/dashboards.yaml @grafana/dashboards-squad
/devenv/datasources.yaml @grafana/backend-platform
/devenv/datasources_docker.yaml @grafana/backend-platform
/devenv/dev-dashboards-without-uid/ @grafana/dashboards-squad
/devenv/dev-dashboards/ @grafana/dashboards-squad
/devenv/docker/blocks/alert_webhook_listener/ @grafana/alerting-squad-backend
/devenv/docker/blocks/clickhouse/ @grafana/partner-plugins
/devenv/docker/blocks/collectd/ @grafana/observability-metrics
/devenv/docker/blocks/grafana/ @grafana/grafana-as-code
/devenv/docker/blocks/graphite/ @grafana/observability-metrics
/devenv/docker/blocks/graphite09/ @grafana/observability-metrics
/devenv/docker/blocks/graphite1/ @grafana/observability-metrics
/devenv/docker/blocks/influxdb/ @grafana/observability-metrics
/devenv/docker/blocks/influxdb1/ @grafana/observability-metrics
/devenv/docker/blocks/jaeger/ @grafana/observability-traces-and-profiling
/devenv/docker/blocks/maildev/ @grafana/alerting-squad-frontend
/devenv/docker/blocks/memcached/ @grafana/backend-platform
/devenv/docker/blocks/mssql/ @grafana/grafana-bi-squad
/devenv/docker/blocks/mssql_arm64/ @grafana/grafana-bi-squad
/devenv/docker/blocks/mssql_tests/ @grafana/grafana-bi-squad
/devenv/docker/blocks/mssql_tls/ @grafana/grafana-bi-squad
/devenv/docker/blocks/mysql/ @grafana/grafana-bi-squad
/devenv/docker/blocks/mysql_exporter/ @grafana/grafana-bi-squad
/devenv/docker/blocks/mysql_opendata/ @grafana/grafana-bi-squad
/devenv/docker/blocks/mysql_tests/ @grafana/grafana-bi-squad
/devenv/docker/blocks/opentsdb/ @grafana/observability-metrics
/devenv/docker/blocks/phlare/ @grafana/observability-traces-and-profiling
/devenv/docker/blocks/postgres/ @grafana/grafana-bi-squad
/devenv/docker/blocks/postgres_tests/ @grafana/grafana-bi-squad
/devenv/docker/blocks/prometheus/ @grafana/observability-metrics
/devenv/docker/blocks/prometheus_random_data/ @grafana/observability-metrics
/devenv/docker/blocks/redis/ @bergquist
/devenv/docker/blocks/sensugo/ @grafana/backend-platform
/devenv/docker/blocks/slow_proxy/ @bergquist
/devenv/docker/blocks/smtp/ @bergquist
/devenv/docker/blocks/tempo/ @grafana/observability-traces-and-profiling
/devenv/docker/blocks/traefik/ @mckn
/devenv/docker/blocks/zipkin/ @grafana/observability-traces-and-profiling
/devenv/docker/buildcontainer/ @bergquist
/devenv/docker/compose_header.yml @grafana/backend-platform
/devenv/docker/debtest/ @bergquist
/devenv/docker/ha-test-unified-alerting/ @grafana/alerting-squad-backend
/devenv/docker/ha_test/ @grafana/backend-platform
/devenv/docker/loadtest/ @grafana/backend-platform
/devenv/docker/rpmtest/ @grafana/backend-platform
/devenv/jsonnet/ @grafana/grafana-edge-squad
/devenv/local-npm/ @grafana/frontend-ops
/devenv/vscode/ @grafana/frontend-ops
/devenv/setup.sh @grafana/backend-platform
# Emails
/emails/ @grafana/alerting-squad-frontend
#Packaging
/packaging/ @DanCech
*.go @grafana/backend-platform
go.mod @grafana/backend-platform
go.sum @grafana/backend-platform
/.bingo @grafana/backend-platform
# Continuous Integration
.drone.yml @grafana/grafana-delivery
.drone.star @grafana/grafana-delivery
/scripts/drone/ @grafana/grafana-delivery
/pkg/build/ @grafana/grafana-delivery
/.dockerignore @grafana/grafana-delivery
/Dockerfile @grafana/grafana-delivery
/Makefile @grafana/grafana-delivery
/scripts/build/ @grafana/grafana-delivery
.drone.yml @grafana/grafana-release-eng
.drone.star @grafana/grafana-release-eng
/scripts/drone/ @grafana/grafana-release-eng
/pkg/build/ @grafana/grafana-release-eng
# OSS Plugin Partnerships backend code
/pkg/tsdb/cloudwatch/ @grafana/aws-plugins
/pkg/tsdb/azuremonitor/ @grafana/partner-plugins
/pkg/tsdb/cloudmonitoring/ @grafana/partner-plugins
# Cloud Datasources backend code
/pkg/tsdb/cloudwatch @grafana/aws-plugins
/pkg/tsdb/azuremonitor @grafana/cloud-provider-plugins
/pkg/tsdb/cloudmonitoring @grafana/cloud-provider-plugins
# Observability backend code
/pkg/tsdb/prometheus/ @grafana/observability-metrics
/pkg/tsdb/influxdb/ @grafana/observability-metrics
/pkg/tsdb/elasticsearch/ @grafana/observability-logs
/pkg/tsdb/graphite/ @grafana/observability-metrics
/pkg/tsdb/loki/ @grafana/observability-logs
/pkg/tsdb/tempo/ @grafana/observability-traces-and-profiling
/pkg/tsdb/phlare/ @grafana/observability-traces-and-profiling
/pkg/tsdb/parca/ @grafana/observability-traces-and-profiling
/pkg/tsdb/prometheus @grafana/observability-metrics
/pkg/tsdb/influxdb @grafana/observability-metrics
/pkg/tsdb/elasticsearch @grafana/observability-logs-and-traces
/pkg/tsdb/graphite @grafana/observability-metrics
/pkg/tsdb/jaeger @grafana/observability-logs-and-traces
/pkg/tsdb/loki @grafana/observability-logs-and-traces
/pkg/tsdb/zipkin @grafana/observability-logs-and-traces
/pkg/tsdb/tempo @grafana/observability-logs-and-traces
# BI backend code
/pkg/tsdb/mysql/ @grafana/grafana-bi-squad
/pkg/tsdb/postgres/ @grafana/grafana-bi-squad
/pkg/tsdb/mssql/ @grafana/grafana-bi-squad
/pkg/tsdb/mysql @grafana/grafana-bi-squad
/pkg/tsdb/postgres @grafana/grafana-bi-squad
/pkg/tsdb/mssql @grafana/grafana-bi-squad
# Database migrations
/pkg/services/sqlstore/migrations/ @grafana/backend-platform @grafana/hosted-grafana-team
/pkg/services/sqlstore/migrations @grafana/backend-platform @grafana/hosted-grafana-team
*_mig.go @grafana/backend-platform @grafana/hosted-grafana-team
# Grafana multitenancy
/pkg/services/live/ @grafana/multitenancy-squad
/pkg/services/searchV2/ @grafana/multitenancy-squad
/pkg/services/store/ @grafana/multitenancy-squad
/pkg/services/querylibrary/ @grafana/multitenancy-squad
/pkg/services/export/ @grafana/multitenancy-squad
/pkg/infra/filestorage/ @grafana/multitenancy-squad
/pkg/util/converter/ @grafana/multitenancy-squad
# Grafana edge
/pkg/services/live/ @grafana/grafana-edge-squad
/pkg/services/searchV2/ @grafana/grafana-edge-squad
/pkg/services/store/ @grafana/grafana-edge-squad
/pkg/services/export/ @grafana/grafana-edge-squad
/pkg/infra/filestore/ @grafana/grafana-edge-squad
pkg/tsdb/testdatasource/sims/ @grafana/grafana-edge-squad
# Alerting
/pkg/services/ngalert/ @grafana/alerting-squad-backend
/pkg/services/sqlstore/migrations/ualert/ @grafana/alerting-squad-backend
/pkg/services/alerting/ @grafana/alerting-squad-backend
/pkg/tests/api/alerting/ @grafana/alerting-squad-backend
/public/app/features/alerting/ @grafana/alerting-squad-frontend
/pkg/services/ngalert @grafana/alerting-squad-backend
/pkg/services/sqlstore/migrations/ualert @grafana/alerting-squad-backend
/pkg/services/alerting @grafana/alerting-squad-backend
/pkg/tests/api/alerting @grafana/alerting-squad-backend
/public/app/features/alerting @grafana/alerting-squad-frontend
# Library Services
/pkg/services/libraryelements/ @grafana/user-essentials
/pkg/services/librarypanels/ @grafana/user-essentials
/pkg/services/libraryelements @grafana/user-essentials
/pkg/services/librarypanels @grafana/user-essentials
# Plugins
/pkg/api/pluginproxy/ @grafana/plugins-platform-backend
/pkg/infra/httpclient/ @grafana/plugins-platform-backend
/pkg/plugins/ @grafana/plugins-platform-backend
/pkg/services/datasourceproxy/ @grafana/plugins-platform-backend
/pkg/services/datasources/ @grafana/plugins-platform-backend
/pkg/services/pluginsintegration/ @grafana/plugins-platform-backend
/pkg/plugins/pfs/ @grafana/plugins-platform-backend @grafana/grafana-as-code
/pkg/tsdb/testdatasource/ @grafana/plugins-platform-backend
/pkg/api/pluginproxy @grafana/plugins-platform-backend
/pkg/plugins @grafana/plugins-platform-backend
/pkg/services/datasourceproxy @grafana/plugins-platform-backend
/pkg/services/datasources @grafana/plugins-platform-backend
# Dashboard previews / crawler (behind feature flag)
/pkg/services/thumbs/ @grafana/multitenancy-squad
/pkg/services/thumbs @grafana/grafana-edge-squad
# Backend code docs
/contribute/backend/ @grafana/backend-platform
/contribute/style-guides/backend.md @grafana/backend-platform
/contribute/architecture/backend @grafana/backend-platform
/contribute/engineering/backend @grafana/backend-platform
/crowdin.yml @grafana/user-essentials
/public/locales/ @grafana/user-essentials
/public/app/core/internationalization/ @grafana/user-essentials
/e2e/ @grafana/user-essentials
/e2e/cloud-plugins-suite/ @grafana/partner-plugins
/packages/ @grafana/user-essentials @grafana/plugins-platform-frontend @grafana/grafana-bi-squad
/packages/grafana-e2e-selectors/ @grafana/user-essentials
/packages/grafana-e2e/ @grafana/user-essentials
/packages/grafana-toolkit/ @grafana/plugins-platform-frontend
/packages/grafana-ui/.storybook/ @grafana/plugins-platform-frontend
/packages/grafana-ui/src/components/DateTimePickers/ @grafana/user-essentials
/packages/grafana-ui/src/components/GraphNG/ @grafana/grafana-bi-squad
/packages/grafana-ui/src/components/Logs/ @grafana/observability-logs
/packages/grafana-ui/src/components/Table/ @grafana/grafana-bi-squad
/packages/grafana-ui/src/components/TimeSeries/ @grafana/grafana-bi-squad
/packages/grafana-ui/src/components/uPlot/ @grafana/grafana-bi-squad
/packages/grafana-ui/src/utils/storybook/ @grafana/plugins-platform-frontend
/packages/grafana-data/src/**/*logs* @grafana/observability-logs
/plugins-bundled/ @grafana/plugins-platform-frontend
# root files, mostly frontend
.browserslistrc @grafana/frontend-ops
/e2e @grafana/user-essentials
/packages @grafana/user-essentials @grafana/plugins-platform-frontend @grafana/grafana-bi-squad
/packages/grafana-e2e-selectors @grafana/user-essentials
/packages/grafana-e2e @grafana/user-essentials
/packages/grafana-toolkit @grafana/plugins-platform-frontend
/packages/grafana-ui/.storybook @grafana/plugins-platform-frontend
/packages/grafana-ui/src/components/DateTimePickers @grafana/grafana-bi-squad
/packages/grafana-ui/src/components/GraphNG @grafana/grafana-bi-squad
/packages/grafana-ui/src/components/Table @grafana/grafana-bi-squad
/packages/grafana-ui/src/components/TimeSeries @grafana/grafana-bi-squad
/packages/grafana-ui/src/components/uPlot @grafana/grafana-bi-squad
/packages/grafana-ui/src/utils/storybook @grafana/plugins-platform-frontend
/packages/jaeger-ui-components/ @grafana/observability-logs-and-traces
/plugins-bundled @grafana/plugins-platform-frontend
# public folder
/public/app/core/components/TimePicker @grafana/grafana-bi-squad
/public/app/core/components/Layers @grafana/grafana-edge-squad
/public/app/features/canvas/ @grafana/grafana-edge-squad
/public/app/features/comments/ @grafana/grafana-edge-squad
/public/app/features/dimensions/ @grafana/grafana-edge-squad
/public/app/features/geo/ @grafana/grafana-edge-squad
/public/app/features/live/ @grafana/grafana-edge-squad
/public/app/features/explore/ @grafana/observability-experience-squad
/public/app/features/plugins @grafana/plugins-platform-frontend
/public/app/features/transformers/spatial @grafana/grafana-edge-squad
/public/app/plugins/panel/alertlist @grafana/alerting-squad-frontend
/public/app/plugins/panel/barchart @grafana/grafana-bi-squad
/public/app/plugins/panel/heatmap @grafana/grafana-bi-squad
/public/app/plugins/panel/histogram @grafana/grafana-bi-squad
/public/app/plugins/panel/logs @grafana/observability-logs-and-traces
/public/app/plugins/panel/nodeGraph @grafana/observability-logs-and-traces
/public/app/plugins/panel/piechart @grafana/grafana-bi-squad
/public/app/plugins/panel/state-timeline @grafana/grafana-bi-squad
/public/app/plugins/panel/status-history @grafana/grafana-bi-squad
/public/app/plugins/panel/table @grafana/grafana-bi-squad
/public/app/plugins/panel/timeseries @grafana/grafana-bi-squad
/public/app/plugins/panel/geomap @grafana/grafana-edge-squad
/public/app/plugins/panel/canvas @grafana/grafana-edge-squad
/public/app/plugins/panel/candlestick @grafana/grafana-edge-squad
/public/app/plugins/panel/icon @grafana/grafana-edge-squad
/scripts/build/release-packages.sh @grafana/plugins-platform-frontend
/scripts/circle-release-next-packages.sh @grafana/plugins-platform-frontend
/scripts/ci-frontend-metrics.sh @grafana/user-essentials @grafana/plugins-platform-frontend @grafana/grafana-bi-squad
/scripts/ci-reference-docs-build.sh @grafana/plugins-platform-frontend
/scripts/ci-reference-docs-lint.sh @grafana/plugins-platform-frontend
/scripts/grunt @grafana/frontend-ops
/scripts/webpack @grafana/frontend-ops
/scripts/generate-a11y-report.sh @grafana/user-essentials
package.json @grafana/frontend-ops
tsconfig.json @grafana/frontend-ops
/.editorconfig @grafana/frontend-ops
/.eslintignore @grafana/frontend-ops
/.gitattributes @grafana/frontend-ops
/.gitignore @grafana/frontend-ops
/.husky/pre-commit @grafana/frontend-ops
/.nvmrc @grafana/frontend-ops
/.prettierignore @grafana/frontend-ops
/.yarn @grafana/frontend-ops
/.yarnrc.yml @grafana/frontend-ops
/yarn.lock @grafana/frontend-ops
/.linguirc @grafana/user-essentials
/babel.config.json @grafana/frontend-ops
lerna.json @grafana/frontend-ops
/.prettierrc.js @grafana/frontend-ops
/.eslintrc @grafana/frontend-ops
/.vim @zoltanbedi
/jest.config.js @grafana/frontend-ops
/latest.json @grafana/frontend-ops
/metadata.md @grafana/plugins-platform
/stylelint.config.js @grafana/frontend-ops
/tools/ @grafana/frontend-ops
# public folder
/public/app/core/ @grafana/user-essentials
/public/app/core/components/TimePicker/ @grafana/user-essentials
/public/app/core/components/Layers/ @grafana/grafana-edge-squad
/public/app/features/all.ts @grafana/user-essentials
/public/app/features/admin/ @grafana/grafana-authnz-team
/public/app/features/annotations/ @grafana/user-essentials
/public/app/features/api-keys/ @grafana/user-essentials
/public/app/features/canvas/ @grafana/grafana-edge-squad
/public/app/features/commandPalette/ @grafana/user-essentials
/public/app/features/comments/ @grafana/grafana-edge-squad
/public/app/features/connections/ @grafana/plugins-platform-frontend
/public/app/features/correlations/ @grafana/explore-squad
/public/app/features/dashboard/ @grafana/dashboards-squad
/public/app/features/datasources/ @grafana/user-essentials
/public/app/features/dimensions/ @grafana/grafana-edge-squad
/public/app/features/explore/ @grafana/explore-squad
/public/app/features/expressions/ @grafana/observability-metrics
/public/app/features/folders/ @grafana/user-essentials
/public/app/features/inspector/ @grafana/user-essentials
/public/app/features/invites/ @grafana/user-essentials
/public/app/features/geo/ @grafana/grafana-edge-squad
/public/app/features/library-panels/ @grafana/user-essentials
/public/app/features/logs/ @grafana/observability-logs
/public/app/features/live/ @grafana/multitenancy-squad
/public/app/features/manage-dashboards/ @grafana/dashboards-squad
/public/app/features/notifications/ @grafana/user-essentials
/public/app/features/org/ @grafana/user-essentials
/public/app/features/panel/ @grafana/user-essentials
/public/app/features/playlist/ @grafana/dashboards-squad
/public/app/features/plugins/ @grafana/plugins-platform-frontend
/public/app/features/profile/ @grafana/user-essentials
/public/app/features/runtime/ @ryantxu
/public/app/features/query/ @grafana/dashboards-squad
/public/app/features/query-library/ @grafana/grafana-edge-squad
/public/app/features/sandbox/ @grafana/user-essentials
/public/app/features/scenes/ @grafana/dashboards-squad
/public/app/features/search/ @grafana/user-essentials
/public/app/features/serviceaccounts/ @grafana/grafana-authnz-team
/public/app/features/storage/ @grafana/multitenancy-squad
/public/app/features/teams/ @grafana/grafana-authnz-team
/public/app/features/templating/ @grafana/dashboards-squad
/public/app/features/transformers/ @grafana/grafana-edge-squad
/public/app/features/users/ @grafana/grafana-authnz-team
/public/app/features/variables/ @grafana/dashboards-squad
/public/app/plugins/panel/alertGroups/ @grafana/alerting-squad-frontend
/public/app/plugins/panel/alertlist/ @grafana/alerting-squad-frontend
/public/app/plugins/panel/annolist/ @grafana/user-essentials
/public/app/plugins/panel/barchart/ @grafana/grafana-bi-squad
/public/app/plugins/panel/bargauge/ @grafana/user-essentials
/public/app/plugins/panel/dashlist/ @grafana/user-essentials
/public/app/plugins/panel/debug/ @ryantxu
/public/app/plugins/panel/gauge/ @grafana/user-essentials
/public/app/plugins/panel/gettingstarted/ @grafana/user-essentials
/public/app/plugins/panel/graph/ @grafana/user-essentials
/public/app/plugins/panel/heatmap/ @grafana/grafana-bi-squad
/public/app/plugins/panel/histogram/ @grafana/grafana-bi-squad
/public/app/plugins/panel/logs/ @grafana/observability-logs
/public/app/plugins/panel/nodeGraph/ @grafana/observability-traces-and-profiling
/public/app/plugins/panel/traces/ @grafana/observability-traces-and-profiling
/public/app/plugins/panel/flamegraph/ @grafana/observability-traces-and-profiling
/public/app/plugins/panel/piechart/ @grafana/grafana-bi-squad
/public/app/plugins/panel/state-timeline/ @grafana/grafana-bi-squad
/public/app/plugins/panel/status-history/ @grafana/grafana-bi-squad
/public/app/plugins/panel/table/ @grafana/grafana-bi-squad
/public/app/plugins/panel/table-old/ @grafana/grafana-bi-squad
/public/app/plugins/panel/timeseries/ @grafana/grafana-bi-squad
/public/app/plugins/panel/geomap/ @grafana/grafana-edge-squad
/public/app/plugins/panel/canvas/ @grafana/grafana-edge-squad
/public/app/plugins/panel/candlestick/ @grafana/grafana-edge-squad
/public/app/plugins/panel/icon/ @grafana/grafana-edge-squad
/public/app/plugins/panel/live/ @grafana/multitenancy-squad
/public/app/plugins/panel/news/ @grafana/user-essentials
/public/app/plugins/panel/stat/ @grafana/user-essentials
/public/app/plugins/panel/text/ @grafana/user-essentials
/public/app/plugins/panel/welcome/ @grafana/user-essentials
/public/app/plugins/panel/xychart/ @grafana/grafana-bi-squad
/public/app/plugins/sdk.ts @grafana/plugins-platform-frontend
/public/app/polyfills/old-mediaquerylist.ts @grafana/user-essentials
/public/app/routes/ @grafana/user-essentials
/public/app/store/ @grafana/user-essentials
/public/app/types/ @grafana/user-essentials
/public/dashboards/ @grafana/dashboards-squad
/public/fonts/ @grafana/alerting-squad-frontend
/public/emails/ @grafana/user-essentials
/public/gazetteer/ @ryantxu
/public/img/ @grafana/user-essentials
/public/lib/ @grafana/user-essentials
/public/maps/ @ryantxu
/public/robots.txt @grafana/frontend-ops
/public/sass/ @grafana/user-essentials
/public/test/ @grafana/user-essentials
/public/testdata/ @grafana/user-essentials
/public/views/ @grafana/user-essentials
/public/app/features/explore/Logs.tsx @grafana/observability-logs
/public/app/features/explore/LogsContainer.tsx @grafana/observability-logs
/public/app/features/explore/TraceView/ @grafana/observability-traces-and-profiling
/public/api-merged.json @grafana/backend-platform
/public/api-spec.json @grafana/backend-platform
/public/openapi3.json @grafana/backend-platform
/public/app/angular/ @torkelo
/public/app/app.ts @grafana/frontend-ops
/public/app/dev.ts @grafana/frontend-ops
/public/app/index.ts @grafana/frontend-ops
/public/app/AppWrapper.tsx @grafana/frontend-ops
/public/app/partials/ @grafana/user-essentials
/scripts/benchmark-access-control.sh @grafana/grafana-authnz-team
/scripts/check-breaking-changes.sh @grafana/plugins-platform-frontend
/scripts/ci-* @grafana/grafana-delivery
/scripts/circle-* @grafana/grafana-delivery
/scripts/ci-frontend-metrics.sh @grafana/user-essentials @grafana/plugins-platform-frontend @grafana/grafana-bi-squad
/scripts/cli/ @grafana/user-essentials
/scripts/clean-git-or-error.sh @grafana/grafana-as-code
/scripts/grafana-server/ @grafana/user-essentials
/scripts/helpers/ @grafana/grafana-delivery
/scripts/import_many_dashboards.sh @torkelo
/scripts/mixin-check.sh @bergquist
/scripts/openapi3/ @grafana/grafana-partnerships-team
/scripts/prepare-packagejson.js @grafana/frontend-ops
/scripts/protobuf-check.sh @grafana/plugins-platform-backend
/scripts/stripnulls.sh @grafana/grafana-as-code
/scripts/tag_release.sh @grafana/grafana-delivery
/scripts/trigger_docker_build.sh @grafana/grafana-delivery
/scripts/trigger_grafana_packer.sh @grafana/grafana-delivery
/scripts/trigger_windows_build.sh @grafana/grafana-delivery
/scripts/validate-devenv-dashboards.sh @grafana/grafana-delivery
/scripts/verify-repo-update/ @grafana/grafana-delivery
/scripts/webpack/ @grafana/frontend-ops
/scripts/generate-a11y-report.sh @grafana/user-essentials
.babelrc @grafana/frontend-ops
.prettierrc.js @grafana/frontend-ops
.eslintrc @grafana/frontend-ops
.pa11yci.conf.js @grafana/user-essentials
.pa11yci-pr.conf.js @grafana/user-essentials
.betterer.results @joshhunt
.betterer.ts @joshhunt
# @grafana/ui component documentation
*.mdx @grafana/plugins-platform-frontend
# Design system
/public/img/icons/unicons/ @grafana/design-system
*.mdx @marcusolsson @jessover9000 @grafana/plugins-platform-frontend
# Core datasources
/public/app/plugins/datasource/dashboard/ @grafana/dashboards-squad
/public/app/plugins/datasource/cloudwatch/ @grafana/aws-plugins
/public/app/plugins/datasource/elasticsearch/ @grafana/observability-logs
/public/app/plugins/datasource/grafana/ @grafana/user-essentials
/public/app/plugins/datasource/testdata/ @grafana/plugins-platform-frontend
/public/app/plugins/datasource/grafana-azure-monitor-datasource/ @grafana/partner-plugins
/public/app/plugins/datasource/graphite/ @grafana/observability-metrics
/public/app/plugins/datasource/influxdb/ @grafana/observability-metrics
/public/app/plugins/datasource/jaeger/ @grafana/observability-traces-and-profiling
/public/app/plugins/datasource/loki/ @grafana/observability-logs
/public/app/plugins/datasource/mixed/ @grafana/dashboards-squad
/public/app/plugins/datasource/mssql/ @grafana/grafana-bi-squad
/public/app/plugins/datasource/mysql/ @grafana/grafana-bi-squad
/public/app/plugins/datasource/opentsdb/ @grafana/backend-platform
/public/app/plugins/datasource/postgres/ @grafana/grafana-bi-squad
/public/app/plugins/datasource/prometheus/ @grafana/observability-metrics
/public/app/plugins/datasource/cloud-monitoring/ @grafana/partner-plugins
/public/app/plugins/datasource/zipkin/ @grafana/observability-traces-and-profiling
/public/app/plugins/datasource/tempo/ @grafana/observability-traces-and-profiling
/public/app/plugins/datasource/phlare/ @grafana/observability-traces-and-profiling
/public/app/plugins/datasource/parca/ @grafana/observability-traces-and-profiling
/public/app/plugins/datasource/alertmanager/ @grafana/alerting-squad
# SSE - Server Side Expressions
/pkg/expr/ @grafana/observability-metrics
/public/app/plugins/datasource/cloudwatch @grafana/aws-plugins
/public/app/plugins/datasource/elasticsearch @grafana/observability-logs-and-traces
/public/app/plugins/datasource/grafana-azure-monitor-datasource @grafana/cloud-provider-plugins
/public/app/plugins/datasource/graphite @grafana/observability-metrics
/public/app/plugins/datasource/influxdb @grafana/observability-metrics
/public/app/plugins/datasource/jaeger @grafana/observability-logs-and-traces
/public/app/plugins/datasource/loki @grafana/observability-logs-and-traces
/public/app/plugins/datasource/mssql @grafana/grafana-bi-squad
/public/app/plugins/datasource/mysql @grafana/grafana-bi-squad
/public/app/plugins/datasource/opentsdb @grafana/backend-platform
/public/app/plugins/datasource/postgres @grafana/grafana-bi-squad
/public/app/plugins/datasource/prometheus @grafana/observability-metrics
/public/app/plugins/datasource/cloud-monitoring @grafana/cloud-provider-plugins
/public/app/plugins/datasource/zipkin @grafana/observability-logs-and-traces
/public/app/plugins/datasource/tempo @grafana/observability-logs-and-traces
/public/app/plugins/datasource/alertmanager @grafana/alerting-squad
# Cloud middleware
/grafana-mixin/ @grafana/hosted-grafana-team
# Grafana authentication and authorization
/pkg/login/ @grafana/grafana-authnz-team
/pkg/services/accesscontrol/ @grafana/grafana-authnz-team
/pkg/services/anonymous/ @grafana/grafana-authnz-team
/pkg/services/auth/ @grafana/grafana-authnz-team
/pkg/services/authn/ @grafana/grafana-authnz-team
/pkg/services/accesscontrol @grafana/grafana-authnz-team
/pkg/services/auth @grafana/grafana-authnz-team
/pkg/services/dashboards/accesscontrol.go @grafana/grafana-authnz-team
/pkg/services/datasources/permissions/ @grafana/grafana-authnz-team
/pkg/services/guardian/ @grafana/grafana-authnz-team
/pkg/services/ldap/ @grafana/grafana-authnz-team
/pkg/services/login/ @grafana/grafana-authnz-team
/pkg/services/multildap/ @grafana/grafana-authnz-team
/pkg/services/loginattempt/ @grafana/grafana-authnz-team
/pkg/services/oauthtoken/ @grafana/grafana-authnz-team
/pkg/services/serviceaccounts/ @grafana/grafana-authnz-team
/pkg/services/teamguardian/ @grafana/grafana-authnz-team
# Support bundles
/public/app/features/support-bundles/ @grafana/grafana-authnz-team
/pkg/services/supportbundles/ @grafana/grafana-authnz-team
# Grafana Partnerships Team
/pkg/infra/httpclient/httpclientprovider/sigv4_middleware.go @grafana/grafana-partnerships-team
/pkg/infra/httpclient/httpclientprovider/sigv4_middleware_test.go @grafana/grafana-partnerships-team
# Kind definitions
/kinds/dashboard @grafana/dashboards-squad
/kinds/ @grafana/grafana-as-code
# Kind system and code generation
embed.go @grafana/grafana-as-code
/pkg/kinds/ @grafana/grafana-as-code
/pkg/cuectx/ @grafana/grafana-as-code
/pkg/registry/ @grafana/grafana-as-code
/pkg/codegen/ @grafana/grafana-as-code
/pkg/kindsys/ @grafana/grafana-as-code
/pkg/kindsys/kindcat_custom.cue @grafana/apps-platform-core
/pkg/kinds/*/*_gen.go @grafana/grafana-as-code
/pkg/registry/corekind/ @grafana/grafana-as-code
/public/app/plugins/*gen.go @grafana/grafana-as-code
/cue.mod/ @grafana/grafana-as-code
# GitHub Workflows and Templates
/.github/CODEOWNERS @tolzhabayev
/.github/ISSUE_TEMPLATE/ @torkelo
/.github/PULL_REQUEST_TEMPLATE.md @torkelo
/.github/bot.md @torkelo
/.github/commands.json @torkelo
/.github/dependabot.yml @grafana/frontend-ops
/.github/metrics-collector.json @torkelo
/.github/pr-checks.json @marefr
/.github/pr-commands.json @marefr
/.github/renovate.json5 @grafana/frontend-ops
/.github/teams.yml @armandgrillet
/.github/workflows/backport.yml @grafana/grafana-delivery
/.github/workflows/bump-version.yml @grafana/grafana-delivery
/.github/workflows/close-milestone.yml @grafana/grafana-delivery
/.github/workflows/cloud-data-sources-code-coverage.yml @grafana/partner-plugins @grafana/aws-plugins
/.github/workflows/codeowners-validator.yml @tolzhabayev
/.github/workflows/codeql-analysis.yml @DanCech
/.github/workflows/commands.yml @torkelo
/.github/workflows/detect-breaking-changes-* @grafana/plugins-platform-frontend
/.github/workflows/doc-validator.yml @grafana/docs-grafana
/.github/workflows/enterprise-pr-check.yml @grafana/grafana-release-eng
/.github/workflows/epic-add-to-platform-ux-parent-project.yml @meanmina
/.github/workflows/github-release.yml @torkelo
/.github/workflows/issue-labeled.yml @armandgrillet
/.github/workflows/metrics-collector.yml @torkelo
/.github/workflows/milestone.yml @marefr
/.github/workflows/ox-code-coverage.yml @grafana/explore-squad
/.github/workflows/pr-checks.yml @marefr
/.github/workflows/pr-codeql-analysis-go.yml @DanCech
/.github/workflows/pr-codeql-analysis-javascript.yml @DanCech
/.github/workflows/pr-codeql-analysis-python.yml @DanCech
/.github/workflows/pr-commands-closed.yml @tolzhabayev
/.github/workflows/pr-commands.yml @marefr
/.github/workflows/publish-technical-documentation-next.yml @grafana/docs-grafana
/.github/workflows/publish-technical-documentation-release.yml @grafana/docs-grafana
/.github/workflows/remove-milestone.yml @grafana/user-essentials
/.github/workflows/sbom-report.yml @grafana/security-team
/.github/workflows/scripts/json-file-to-job-output.js @grafana/plugins-platform-frontend
/.github/workflows/scripts/pr-get-job-link.js @grafana/plugins-platform-frontend
/.github/workflows/stale.yml @grafana/user-essentials
/.github/workflows/update-changelog.yml @grafana/grafana-delivery
/.github/workflows/snyk.yml @grafana/security-team
# Conf
/conf/defaults.ini @torkelo
/conf/sample.ini @torkelo
/conf/ldap.toml @grafana/grafana-authnz-team
/conf/ldap_multiple.toml @grafana/grafana-authnz-team
/conf/provisioning/access-control/ @grafana/grafana-authnz-team
/conf/provisioning/alerting/ @grafana/alerting-squad-backend
/conf/provisioning/dashboards/ @grafana/dashboards-squad
/conf/provisioning/datasources/ @grafana/plugins-platform-backend
/conf/provisioning/notifiers/ @bergquist
/conf/provisioning/plugins/ @grafana/plugins-platform-backend
/pkg/services/datasources/permissions @grafana/grafana-authnz-team
/pkg/services/datasources/permissions/accesscontrol.go @grafana/grafana-authnz-team
/pkg/services/guardian @grafana/grafana-authnz-team
/pkg/services/ldap @grafana/grafana-authnz-team
/pkg/services/login @grafana/grafana-authnz-team
/pkg/services/multildap @grafana/grafana-authnz-team
/pkg/services/oauthtoken @grafana/grafana-authnz-team
/pkg/services/teamguardian @grafana/grafana-authnz-team
/pkg/services/serviceaccounts @grafana/grafana-authnz-team

View File

@@ -14,23 +14,11 @@ Thank you for sending a pull request! Here are some tips:
6. Name your PR as "<FeatureArea>: Describe your change", e.g. Alerting: Prevent race condition. If it's a fix or feature relevant for the changelog describe the user impact in the title. The PR title is used to auto-generate the changelog for issues marked with the "add to changelog" label.
7. If your PR content should be added to the What's New document for the next major or minor release, add the **add to what's new** label to your PR. Note that you should add this label to the main PR that introduces the feature; do not add this label to smaller PRs for the feature.
-->
**What is this feature?**
**What this PR does / why we need it**:
[Add a brief description of what the feature or update does.]
**Why do we need this feature?**
[Add a description of the problem the feature is trying to solve.]
**Who is this feature for?**
[Add information on what kind of user the feature is for.]
**Which issue(s) does this PR fix?**:
**Which issue(s) this PR fixes**:
<!--

47
.github/commands.json vendored
View File

@@ -41,7 +41,6 @@
"type":"label",
"name":"bot/no new info",
"action":"close",
"removeLabel":"needs more info",
"comment":"We've closed this issue since it needs more information and hasn't had any activity recently. We can re-open it after you you add more information. To avoid having your issue closed in the future, please read our [CONTRIBUTING](https://github.com/grafana/grafana/blob/main/CONTRIBUTING.md) guidelines.\n\nHappy graphing!"
},
{
@@ -80,7 +79,7 @@
"name":"datasource/Azure",
"action":"addToProject",
"addToProject":{
"url":"https://github.com/orgs/grafana/projects/190"
"url":"https://github.com/orgs/grafana/projects/97"
}
},
{
@@ -104,7 +103,7 @@
"name":"datasource/GoogleCloudMonitoring",
"action":"addToProject",
"addToProject":{
"url":"https://github.com/orgs/grafana/projects/190"
"url":"https://github.com/orgs/grafana/projects/97"
}
},
{
@@ -139,12 +138,20 @@
"url":"https://github.com/orgs/grafana/projects/112"
}
},
{
"type":"label",
"name":"datasource/OpenSearch",
"action":"addToProject",
"addToProject":{
"url":"https://github.com/orgs/grafana/projects/110"
}
},
{
"type":"label",
"name":"datasource/Loki",
"action":"addToProject",
"addToProject":{
"url":"https://github.com/orgs/grafana/projects/203"
"url":"https://github.com/orgs/grafana/projects/110"
}
},
{
@@ -152,23 +159,7 @@
"name":"datasource/Tempo",
"action":"addToProject",
"addToProject":{
"url":"https://github.com/orgs/grafana/projects/221"
}
},
{
"type":"label",
"name":"datasource/Phlare",
"action":"addToProject",
"addToProject":{
"url":"https://github.com/orgs/grafana/projects/221"
}
},
{
"type":"label",
"name":"datasource/Parca",
"action":"addToProject",
"addToProject":{
"url":"https://github.com/orgs/grafana/projects/221"
"url":"https://github.com/orgs/grafana/projects/110"
}
},
{
@@ -176,7 +167,7 @@
"name":"datasource/Elasticsearch",
"action":"addToProject",
"addToProject":{
"url":"https://github.com/orgs/grafana/projects/203"
"url":"https://github.com/orgs/grafana/projects/110"
}
},
{
@@ -184,7 +175,7 @@
"name":"datasource/Jaeger",
"action":"addToProject",
"addToProject":{
"url":"https://github.com/orgs/grafana/projects/221"
"url":"https://github.com/orgs/grafana/projects/110"
}
},
{
@@ -192,7 +183,7 @@
"name":"datasource/Zipkin",
"action":"addToProject",
"addToProject":{
"url":"https://github.com/orgs/grafana/projects/221"
"url":"https://github.com/orgs/grafana/projects/110"
}
},
{
@@ -314,13 +305,5 @@
"addToProject": {
"url": "https://github.com/orgs/grafana/projects/86"
}
},
{
"type": "label",
"name": "area/internationalization",
"action": "addToProject",
"addToProject": {
"url": "https://github.com/orgs/grafana/projects/78"
}
}
]

View File

@@ -16,10 +16,6 @@
"name": "needs_more_info",
"query": "label:\"needs more info\" is:open"
},
{
"name": "triage_needs_confirmation",
"query": "label:\"triage/needs-confirmation\" is:open"
},
{
"name": "unlabeled",
"query": "is:open is:issue no:label"
@@ -27,6 +23,10 @@
{
"name": "open_prs",
"query": "is:open is:pr"
},
{
"name": "milestone_7_4_open",
"query": "is:open is:issue milestone:7.4"
}
]
}

View File

@@ -66,7 +66,8 @@
"scripts/build/**/*",
"scripts/*.sh",
"Makefile",
"Dockerfile"
"Dockerfile",
"Dockerfile.ubuntu"
],
"action": "updateLabel",
"addLabel": "type/build-packaging"

View File

@@ -4,27 +4,34 @@
],
"enabledManagers": ["npm"],
"ignoreDeps": [
"@grafana/slate-react", // should be updated when the `slate` package is updated
"@types/systemjs",
"@types/d3-force", // we should bump this once we move to esm modules
"@types/d3-interpolate", // we should bump this once we move to esm modules
"@types/d3-scale-chromatic", // we should bump this once we move to esm modules
"@types/grafana__slate-react", // should be updated when the `slate` package is updated
"@types/react-icons", // jaeger-ui-components is being refactored to use @grafana/ui icons instead
"commander", // we are planning to remove this, so no need to update it
"d3",
"d3-force", // we should bump this once we move to esm modules
"d3-interpolate", // we should bump this once we move to esm modules
"d3-scale-chromatic", // we should bump this once we move to esm modules
"execa", // we should bump this once we move to esm modules
"history", // we should bump this together with react-router-dom
"@mdx-js/react", // storybook peer-depends on its 1.x version, we should upgrade this when we upgrade storybook
"@mdx-js/react", // storybook peer-depends on it's 1.x version, we should upgrade this when we upgrade storybook
"monaco-editor", // due to us exposing this via @grafana/ui/CodeEditor's props bumping can break plugins
"node-fetch", // we should bump this once we move to esm modules
"react-hook-form", // due to us exposing these hooks via @grafana/ui form components bumping can break plugins
"react-icons", // jaeger-ui-components is being refactored to use @grafana/ui icons instead
"react-redux", // react-beautiful-dnd depends on react-redux 7.x, we need to update that one first
"react-router-dom", // we should bump this together with history
"slate",
"slate-plain-serializer",
"systemjs",
"copy-webpack-plugin", // try to upgrade with newer yarn release. Not working with 3.1.1
"ts-loader", // we should remove ts-loader and use babel-loader instead
"ora", // we should bump this once we move to esm modules
// Sentry deprecated in favor of Grafana Faro for frontend logging.
// Major effort required to upgrade to latest Sentry, not worthwhile
"@sentry/browser",
"@sentry/types",
"@sentry/utils",
// dep updates blocked by React 18
"@testing-library/react",
"@types/react",
@@ -34,7 +41,6 @@
"react-dom",
"react-test-renderer"
],
"includePaths": ["package.json", "packages/**"],
"ignorePaths": ["packages/grafana-toolkit/package.json", "emails/**", "plugins-bundled/**", "**/mocks/**"],
"labels": ["area/frontend", "dependencies", "no-backport", "no-changelog"],
"packageRules": [
@@ -48,49 +54,12 @@
"matchPackagePatterns": ["@storybook"],
"extends": ["schedule:monthly"],
"groupName": "Storybook updates"
},
{
"groupName": "React Aria",
"matchPackagePrefixes": [
"@react-aria/",
"@react-stately/"
]
},
{
"groupName": "Moveable",
"matchPackageNames": [
"moveable",
"react-moveable"
]
},
{
"groupName": "Slate",
"matchPackageNames": [
"@types/slate",
"@types/slate-react",
"slate",
"slate-react"
]
},
{
"groupName": "d3",
"matchPackagePrefixes": [
"d3",
"@types/d3"
]
},
{
"groupName": "visx",
"matchPackagePrefixes": [
"@visx/"
]
}
],
"pin": {
"enabled": false
},
"prConcurrentLimit": 10,
"rebaseWhen": "conflicted",
"reviewers": ["team:grafana/frontend-ops"],
"separateMajorMinor": false,
"vulnerabilityAlerts": {

1
.github/teams.yml vendored
View File

@@ -7,5 +7,4 @@ test:
# Alerting team
area/alerting:
github-board: 52
channel-label: C02B9MXQE0J

View File

@@ -3,8 +3,19 @@ on:
workflow_dispatch:
inputs:
version:
description: 'Needs to match, exactly, the name of a milestone. The version to be released please respect: major.minor.patch or major.minor.patch-beta<number> format. example: 7.4.3 or 7.4.3-beta1'
required: true
default: '7.x.x'
workflow_call:
inputs:
version_call:
description: Needs to match, exactly, the name of a version
required: true
type: string
secrets:
token:
required: true
metricsWriteAPIKey:
required: true
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
jobs:
@@ -17,7 +28,7 @@ jobs:
id: regex-match
with:
text: ${{ github.event.inputs.version }}
regex: '^(\d+.\d+).\d+(?:-beta\d+)?$'
regex: '^(\d+.\d+).\d+(?:-beta.\d+)?$'
- uses: actions-ecosystem/action-regex-match@v2.0.2
if: ${{ inputs.version_call != '' }}
id: regex-match-version-call
@@ -29,7 +40,7 @@ jobs:
run: |
echo "The input version format is not correct, please respect:\
major.minor.patch or major.minor.patch-beta.number format. \
example: 7.4.3 or 7.4.3-beta1"
example: 7.4.3 or 7.4.3-beta.1"
exit 1
- name: Validate input version call
if: ${{ inputs.version_call != '' && steps.regex-match-version-call.outputs.match == '' }}
@@ -44,10 +55,10 @@ jobs:
- name: Set intermedia variables
id: intermedia
run: |
echo "short_ref=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
echo "check_passed=false" >> $GITHUB_OUTPUT
echo "branch_name=v${{steps.regex-match.outputs.group1}}" >> $GITHUB_OUTPUT
echo "branch_exist=$(git ls-remote --heads https://github.com/grafana/grafana.git v${{ steps.regex-match.outputs.group1 }}.x | wc -l)" >> $GITHUB_OUTPUT
echo "::set-output name=short_ref::${GITHUB_REF#refs/*/}"
echo "::set-output name=check_passed::false"
echo "::set-output name=branch_name::v${{steps.regex-match.outputs.group1}}"
echo "::set-output name=branch_exist::$(git ls-remote --heads https://github.com/grafana/grafana.git v${{ steps.regex-match.outputs.group1 }}.x | wc -l)"
- name: Check input version is aligned with branch(main)
if: ${{ github.event.inputs.version != '' && steps.intermedia.outputs.branch_exist == '0' && !contains(steps.intermedia.outputs.short_ref, 'main') }}
@@ -63,13 +74,21 @@ jobs:
repository: "grafana/grafana-github-actions"
path: ./actions
ref: main
- uses: actions/setup-node@v3.5.1
- uses: actions/setup-node@v3.3.0
with:
node-version: '16'
- name: Install Actions
run: npm install --production --prefix ./actions
- name: Run bump version (manually invoked)
- name: Run bump version (manually invoked)
if: ${{ github.event.inputs.version != '' }}
uses: ./actions/bump-version
with:
token: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
metricsWriteAPIKey: ${{ secrets.GRAFANA_MISC_STATS_API_KEY }}
- name: Run bump version (workflow invoked)
if: ${{ inputs.version_call != '' }}
uses: ./actions/bump-version
with:
version_call: ${{ inputs.version_call }}
token: ${{ secrets.token }}
metricsWriteAPIKey: ${{ secrets.metricsWriteAPIKey }}

View File

@@ -14,7 +14,4 @@ on:
jobs:
workflow-call:
uses: grafana/code-coverage/.github/workflows/code-coverage.yml@v0.1.18
with:
frontend-path-regexp: public\/app\/plugins\/datasource\/(grafana-azure-monitor-datasource|cloud-monitoring|cloudwatch)
backend-path-regexp: pkg\/tsdb\/(azuremonitor|cloudmonitoring|cloudwatch)
uses: grafana/code-coverage/.github/workflows/code-coverage.yml@v0.1.2

View File

@@ -1,38 +0,0 @@
name: "Codeowners Validator"
on:
pull_request:
branches: [ main ]
jobs:
codeowners-validator:
runs-on: ubuntu-latest
steps:
# Checks-out your repository, which is validated in the next step
- uses: actions/checkout@v2
- name: GitHub CODEOWNERS Validator
uses: mszostok/codeowners-validator@v0.7.4
# input parameters
with:
# ==== GitHub Auth ====
# "The list of checks that will be executed. By default, all checks are executed. Possible values: files,owners,duppatterns,syntax"
checks: "files,duppatterns,syntax"
# "The comma-separated list of experimental checks that should be executed. By default, all experimental checks are turned off. Possible values: notowned,avoid-shadowing"
experimental_checks: "notowned,avoid-shadowing"
# The repository path in which CODEOWNERS file should be validated."
repository_path: "."
# Defines the level on which the application should treat check issues as failures. Defaults to warning, which treats both errors and warnings as failures, and exits with error code 3. Possible values are error and warning. Default: warning"
check_failure_level: "error"
# The comma-separated list of patterns that should be ignored by not-owned-checker. For example, you can specify * and as a result, the * pattern from the CODEOWNERS file will be ignored and files owned by this pattern will be reported as unowned unless a later specific pattern will match that path. It's useful because often we have default owners entry at the begging of the CODOEWNERS file, e.g. * @global-owner1 @global-owner2"
not_owned_checker_skip_patterns: ""
# Specifies whether CODEOWNERS may have unowned files. For example, `/infra/oncall-rotator/oncall-config.yml` doesn't have owner and this is not reported.
owner_checker_allow_unowned_patterns: "false"
# Specifies whether only teams are allowed as owners of files.
owner_checker_owners_must_be_teams: "false"

View File

@@ -6,7 +6,6 @@
name: "CodeQL"
on:
workflow_dispatch:
push:
branches: [main, v1.8.x, v2.0.x, v2.1.x, v2.6.x, v3.0.x, v3.1.x, v4.0.x, v4.1.x, v4.2.x, v4.3.x, v4.4.x, v4.5.x, v4.6.x, v4.7.x, v5.0.x, v5.1.x, v5.2.x, v5.3.x, v5.4.x, v6.0.x, v6.1.x, v6.2.x, v6.3.x, v6.4.x, v6.5.x, v6.6.x, v6.7.x, v7.0.x, v7.1.x, v7.2.x]
paths-ignore:
@@ -40,12 +39,6 @@ jobs:
# a pull request then we can checkout the head.
fetch-depth: 2
- if: matrix.language == 'go'
name: Set go version
uses: actions/setup-go@v3
with:
go-version: '1.19.2'
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
@@ -56,11 +49,5 @@ jobs:
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
- if: matrix.language == 'go'
name: Build go files
run: |
go mod verify
make build-go
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

View File

@@ -1,34 +0,0 @@
# Workflow for skipping the Levitate detection
# (This is needed because workflows that are skipped due to path filtering will show up as pending in Github.
# As this has the same name as the one in detect-breaking-changes-build.yml it will take over in these cases and succeed quickly.)
name: Levitate / Detect breaking changes
on:
pull_request:
paths-ignore:
- "packages/**"
branches:
- 'main'
jobs:
detect:
name: Detect breaking changes
runs-on: ubuntu-latest
steps:
- name: Skipping
run: echo "No modifications in the public API (packages/), skipping."
# Build and persist output as a JSON (we need to tell the report workflow that the check has been skipped)
- name: Persisting the check output
run: |
mkdir -p ./levitate
echo "{ \"shouldSkip\": true }" > ./levitate/result.json
# Upload artifact (so it can be used in the more privileged "report" workflow)
- name: Upload check output as artifact
uses: actions/upload-artifact@v3
with:
name: levitate
path: levitate/

View File

@@ -1,14 +1,6 @@
# Only runs if anything under the packages/ directory changes.
# (Otherwise detect-breaking-changes-build-skip.yml takes over)
name: Levitate / Detect breaking changes
on:
pull_request:
paths:
- 'packages/**'
branches:
- 'main'
on: pull_request
jobs:
buildPR:
@@ -20,36 +12,30 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
with:
path: './pr'
- uses: actions/setup-node@v3.5.1
with:
node-version: 16.16.0
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Restore yarn cache
uses: actions/cache@v3.0.11
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
restore-keys: |
yarn-cache-folder-
- name: Install dependencies
run: yarn install --immutable
- name: Build packages
run: yarn packages:build
- name: Pack packages
run: yarn packages:pack --out ./%s.tgz
- name: Zip built tarballed packages
run: zip -r ./pr_built_packages.zip ./packages/**/*.tgz
- name: Zip built packages
run: zip -r ./pr_built_packages.zip ./packages/**/dist
- name: Upload build output as artifact
uses: actions/upload-artifact@v3
@@ -66,38 +52,31 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
with:
path: './base'
ref: ${{ github.event.pull_request.base.ref }}
- uses: actions/setup-node@v3.5.1
with:
node-version: 16.16.0
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Restore yarn cache
uses: actions/cache@v3.0.11
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
restore-keys: |
yarn-cache-folder-
- name: Install dependencies
run: yarn install --immutable
- name: Build packages
run: yarn packages:build
- name: Pack packages
run: yarn packages:pack --out ./%s.tgz
- name: Zip built tarballed packages
run: zip -r ./base_built_packages.zip ./packages/**/*.tgz
- name: Zip built packages
run: zip -r ./base_built_packages.zip ./packages/**/dist
- name: Upload build output as artifact
uses: actions/upload-artifact@v3
@@ -110,7 +89,7 @@ jobs:
runs-on: ubuntu-latest
needs: ['buildPR', 'buildBase']
env:
GITHUB_STEP_NUMBER: 8
GITHUB_STEP_NUMBER: 7
steps:
- uses: actions/checkout@v3
@@ -124,25 +103,24 @@ jobs:
uses: actions/download-artifact@v3
with:
name: buildBase
- name: Unzip artifact from pr
run: unzip -j pr_built_packages.zip -d ./pr && rm pr_built_packages.zip
run: unzip pr_built_packages.zip -d ./pr && rm pr_built_packages.zip
- name: Unzip artifact from base
run: unzip -j base_built_packages.zip -d ./base && rm base_built_packages.zip
run: unzip base_built_packages.zip -d ./base && rm base_built_packages.zip
- name: Get link for the Github Action job
id: job
uses: actions/github-script@v6
with:
script: |
const name = 'Detect breaking changes';
const script = require('./.github/workflows/scripts/pr-get-job-link.js')
await script({name, github, context, core})
await script({github, context, core})
- name: Detect breaking changes
id: breaking-changes
run: ./scripts/check-breaking-changes.sh
run: ./scripts/check-breaking-changes.sh
env:
FORCE_COLOR: 3
GITHUB_JOB_LINK: ${{ steps.job.outputs.link }}
@@ -157,7 +135,7 @@ jobs:
with:
name: levitate
path: levitate/
- name: Exit
run: exit ${{ steps.breaking-changes.outputs.is_breaking }}
shell: bash

View File

@@ -10,13 +10,12 @@ jobs:
name: Report
runs-on: ubuntu-latest
env:
ARTIFACT_NAME: 'levitate' # The name of the artifact that we would like to download
ARTIFACT_FOLDER: '${{ github.workspace }}/tmp' # The name of the folder where we will download the artifact to
ARTIFACT_FOLDER: '${{ github.workspace }}/tmp'
ARTIFACT_NAME: 'levitate'
steps:
- uses: actions/checkout@v3
# Download artifact (as a .zip archive)
- name: 'Download artifact'
uses: actions/github-script@v6
env:
@@ -50,12 +49,9 @@ jobs:
fs.mkdirSync(artifactFolder, { recursive: true });
fs.writeFileSync(`${ artifactFolder }/${ artifactName }.zip`, Buffer.from(download.data));
# Unzip artifact
- name: Unzip artifact
run: unzip "${ARTIFACT_FOLDER}/${ARTIFACT_NAME}.zip" -d "${ARTIFACT_FOLDER}"
# Parse the artifact and register fields as step output variables
# (All fields in the JSON will be available as ${{ steps.levitate-run.outputs.<field-name> }}
- name: Parsing levitate result
uses: actions/github-script@v6
id: levitate-run
@@ -65,15 +61,8 @@ jobs:
const script = require('./.github/workflows/scripts/json-file-to-job-output.js');
await script({ core, filePath });
# Skip - print a message if the "Detect" workflow was skipped
- name: Check if the workflow should be skipped
if: steps.levitate-run.outputs.shouldSkip == 'true'
run: echo "Skipping."
# Check if label exists
- name: Check if "levitate breaking change" label exists
id: does-label-exist
if: steps.levitate-run.outputs.shouldSkip != 'true'
uses: actions/github-script@v6
env:
PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }}
@@ -89,9 +78,8 @@ jobs:
return doesExist ? 1 : 0;
# Comment on the PR
- name: Comment on PR
if: steps.levitate-run.outputs.exit_code == 1 && steps.levitate-run.outputs.shouldSkip != 'true'
if: ${{ steps.levitate-run.outputs.exit_code == 1 }}
uses: marocchino/sticky-pull-request-comment@v2
with:
number: ${{ steps.levitate-run.outputs.pr_number }}
@@ -105,9 +93,8 @@ jobs:
[Console output](${{ steps.levitate-run.outputs.job_link }})
[Read our guideline](https://github.com/grafana/grafana/blob/main/contribute/breaking-changes-guide.md)
# Remove comment from the PR (no more breaking changes)
- name: Remove comment from PR
if: steps.levitate-run.outputs.exit_code == 0 && steps.levitate-run.outputs.shouldSkip != 'true'
- name: Remove comment on PR
if: ${{ steps.levitate-run.outputs.exit_code == 0 }}
uses: marocchino/sticky-pull-request-comment@v2
with:
number: ${{ steps.levitate-run.outputs.pr_number }}
@@ -116,8 +103,8 @@ jobs:
# Posts a notification to Slack if a PR has a breaking change and it did not have a breaking change before
- name: Post to Slack
id: slack
if: steps.levitate-run.outputs.exit_code == 1 && steps.does-label-exist.outputs.result == 0 && steps.levitate-run.outputs.shouldSkip != 'true'
uses: slackapi/slack-github-action@v1.23.0
if: ${{ steps.levitate-run.outputs.exit_code == 1 && steps.does-label-exist.outputs.result == 0 }}
uses: slackapi/slack-github-action@v1.19.0
with:
payload: |
{
@@ -130,9 +117,8 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_LEVITATE_WEBHOOK_URL }}
# Add the label
- name: Add "levitate breaking change" label
if: steps.levitate-run.outputs.exit_code == 1 && steps.does-label-exist.outputs.result == 0 && steps.levitate-run.outputs.shouldSkip != 'true'
if: ${{ steps.levitate-run.outputs.exit_code == 1 && steps.does-label-exist.outputs.result == 0 }}
uses: actions/github-script@v6
env:
PR_NUMBER: ${{ steps.levitate-run.outputs.pr_number }}
@@ -146,9 +132,8 @@ jobs:
labels: ['levitate breaking change']
})
# Remove label (no more breaking changes)
- name: Remove "levitate breaking change" label
if: steps.levitate-run.outputs.exit_code == 0 && steps.does-label-exist.outputs.result == 1 && steps.levitate-run.outputs.shouldSkip != 'true'
if: ${{ steps.levitate-run.outputs.exit_code == 0 && steps.does-label-exist.outputs.result == 1 }}
uses: actions/github-script@v6
env:
PR_NUMBER: ${{ steps.levitate-run.outputs.pr_number }}
@@ -162,11 +147,10 @@ jobs:
name: 'levitate breaking change'
})
# Add reviewers
# This is very weird, the actual request goes through (comes back with a 201), but does not assign the team.
# Related issue: https://github.com/renovatebot/renovate/issues/1908
- name: Add "grafana/plugins-platform-frontend" as a reviewer
if: steps.levitate-run.outputs.exit_code && steps.levitate-run.outputs.shouldSkip != 'true'
if: ${{ steps.levitate-run.outputs.exit_code == 1 }}
uses: actions/github-script@v6
env:
PR_NUMBER: ${{ steps.levitate-run.outputs.pr_number }}
@@ -181,9 +165,8 @@ jobs:
team_reviewers: ['grafana/plugins-platform-frontend']
});
# Remove reviewers (no more breaking changes)
- name: Remove "grafana/plugins-platform-frontend" from the list of reviewers
if: steps.levitate-run.outputs.exit_code == 0 && steps.levitate-run.outputs.shouldSkip != 'true'
if: ${{ steps.levitate-run.outputs.exit_code == 0 }}
uses: actions/github-script@v6
env:
PR_NUMBER: ${{ steps.levitate-run.outputs.pr_number }}

View File

@@ -1,16 +0,0 @@
name: "doc-validator"
on:
pull_request:
paths: ["docs/sources/**"]
workflow_dispatch:
jobs:
doc-validator:
runs-on: "ubuntu-latest"
container:
image: "grafana/doc-validator:v1.9.0"
steps:
- name: "Checkout code"
uses: "actions/checkout@v3"
- name: "Run doc-validator tool"
# Ensure that the CI always passes until all errors are resolved.
run: "doc-validator --skip-image-validation ./docs/sources /docs/grafana/latest || true"

View File

@@ -23,4 +23,4 @@ jobs:
repository: grafana/grafana-enterprise
event_type: oss-pull-request
client_payload:
'{"source_sha": "${{ github.event.pull_request.head.sha }}", "source_branch": "${{ github.head_ref }}", "target_branch": "${{ github.base_ref }}", "pr_number": "${{ github.event.number }}"}'
'{"source_branch": "${{ github.head_ref }}", "target_branch": "${{ github.base_ref }}", "pr_number": "${{ github.event.number }}"}'

View File

@@ -1,134 +0,0 @@
name: When epic issues changed in Platform UX squad projects, check if epic is part of specified child projects and update on Platform UX parent project
on:
issues:
types: [opened, closed, edited, reopened, assigned, unassigned, labeled, unlabeled]
labels:
- 'type/epic'
env:
GITHUB_TOKEN: ${{ secrets.GH_BOT_PROJECTS_ACCESS_TOKEN }}
ORGANIZATION: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
PARENT_PROJECT: 304
CHILD_PROJECT_1: 78
CHILD_PROJECT_2: 111
CHILD_PROJECT_3: 202
concurrency:
group: issue-add-to-parent-project-${{ github.event.number }}
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Check if issue is in child or parent projects
run: |
gh api graphql -f query='
query($org: String!, $repo: String!) {
repository(name: $repo, owner: $org) {
issue (number: ${{ github.event.issue.number }}) {
projectItems(first:20) {
nodes {
id,
project {
number,
title
},
fieldValueByName(name:"Status") {
... on ProjectV2ItemFieldSingleSelectValue {
optionId
name
}
}
}
}
}
}
}' -f org=$ORGANIZATION -f repo=$REPO > projects_data.json
echo 'IN_PARENT_PROJ='$(jq '.data.repository.issue.projectItems.nodes[] | select(.project.number==${{ env.PARENT_PROJECT }}) | .project != null' projects_data.json) >> $GITHUB_ENV
echo 'PARENT_PROJ_STATUS_ID='$(jq '.data.repository.issue.projectItems.nodes[] | select(.project.number==${{ env.PARENT_PROJECT }}) | select(.fieldValueByName != null) | .fieldValueByName.optionId' projects_data.json) >> $GITHUB_ENV
echo 'ITEM_ID='$(jq '.data.repository.issue.projectItems.nodes[] | select(.project.number==${{ env.PARENT_PROJECT }}) | .id' projects_data.json) >> $GITHUB_ENV
echo 'IN_CHILD_PROJ='$(jq 'first(.data.repository.issue.projectItems.nodes[] | select(.project.number==${{ env.CHILD_PROJECT_1 }} or .project.number==${{ env.CHILD_PROJECT_2 }} or .project.number==${{ env.CHILD_PROJECT_3 }}) | .project != null)' projects_data.json) >> $GITHUB_ENV
echo 'CHILD_PROJ_STATUS='$(jq -r '.data.repository.issue.projectItems.nodes[] | select(.project.number==${{ env.CHILD_PROJECT_1 }} or .project.number==${{ env.CHILD_PROJECT_2 }} or .project.number==${{ env.CHILD_PROJECT_3 }}) | select(.fieldValueByName != null) | .fieldValueByName.name' projects_data.json) >> $GITHUB_ENV
- name: Get parent project project data
if: env.IN_CHILD_PROJ
run: |
gh api graphql -f query='
query($org: String!, $number: Int!) {
organization(login: $org){
projectV2(number: $number) {
id
fields(first:20) {
nodes {
... on ProjectV2Field {
id
name
}
... on ProjectV2SingleSelectField {
id
name
options {
id
name
}
}
}
}
}
}
}' -f org=$ORGANIZATION -F number=$PARENT_PROJECT > project_data.json
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
echo 'TODO_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="Todo") |.id' project_data.json) >> $GITHUB_ENV
echo 'PROGRESS_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="In Progress") |.id' project_data.json) >> $GITHUB_ENV
echo 'DONE_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="Done") |.id' project_data.json) >> $GITHUB_ENV
- name: Add issue to parent project
if: env.IN_CHILD_PROJ && !env.IN_PARENT_PROJ
run: |
item_id="$( gh api graphql -f query='
mutation($project:ID!, $issue:ID!) {
addProjectV2ItemById(input: {projectId: $project, contentId: $issue}) {
item {
id
}
}
}' -f project=$PROJECT_ID -f issue=${{ github.event.issue.node_id }} --jq '.data.addProjectV2ItemById.item.id')"
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
- name: Set parent project status Done
if: contains(env.CHILD_PROJ_STATUS, 'Done')
run: |
echo 'OPTION_ID='$DONE_OPTION_ID >> $GITHUB_ENV
- name: Set parent project status In Progress
if: contains(env.CHILD_PROJ_STATUS, 'In ') || contains(env.CHILD_PROJ_STATUS, 'Blocked')
run: |
echo 'OPTION_ID='$PROGRESS_OPTION_ID >> $GITHUB_ENV
- name: Set parent project status To do
if: env.CHILD_PROJ_STATUS && !contains(env.CHILD_PROJ_STATUS, 'In ') && !contains(env.CHILD_PROJ_STATUS, 'Blocked') && ! contains(env.CHILD_PROJ_STATUS, 'Done')
run: |
echo 'OPTION_ID='$TODO_OPTION_ID >> $GITHUB_ENV
- name: Set issue status in parent project
if: env.OPTION_ID && (env.OPTION_ID != env.PARENT_PROJ_STATUS_ID)
run: |
gh api graphql -f query='
mutation (
$project: ID!
$item: ID!
$status_field: ID!
$status_value: String!
) {
set_status: updateProjectV2ItemFieldValue(input: {
projectId: $project
itemId: $item
fieldId: $status_field
value: {
singleSelectOptionId: $status_value
}
}) {
projectV2Item {
id
}
}
}' -f project=$PROJECT_ID -f item=$ITEM_ID -f status_field=$STATUS_FIELD_ID -f status_value=${{ env.OPTION_ID }} --silent

View File

@@ -14,37 +14,23 @@ jobs:
- name: "Determine which team to notify"
run: |
# Default to null values.
BOARD="null"
CHANNEL="null"
echo "${{ github.event.label.name }} label added"
export CURRENT_LABEL="${{ github.event.label.name }}" # Enable the use of the label in yq evaluations
# yq is installed by default in ubuntu-latest
if [[ $(yq e 'keys | .[] | select(. == env(CURRENT_LABEL))' teams.yml ) ]]; then
# Check if we have a board set to use.
if [[ $(yq '.[env(CURRENT_LABEL)] | has("github-board")' teams.yml ) == true ]]; then
BOARD=$(yq '.[env(CURRENT_LABEL)].github-board' teams.yml)
echo "Ready to add issue to Grafana board ${BOARD}"
fi
# Check if we have a channel set to notify on comments.
if [[ $(yq '.[env(CURRENT_LABEL)] | has("channel-label")' teams.yml ) == true ]]; then
CHANNEL=$(yq '.[env(CURRENT_LABEL)].channel-label' teams.yml)
echo "Ready to send issue to channel ID ${CHANNEL}"
fi
fi
# set environment for next step
echo "BOARD=${BOARD}" >> $GITHUB_ENV
echo "CHANNEL=${CHANNEL}" >> $GITHUB_ENV
- name: "Add to GitHub board"
if: ${{ env.BOARD != 'null' }}
uses: leonsteinhaeuser/project-beta-automations@v1.3.0
with:
project_id: ${{ env.BOARD }}
organization: grafana
resource_node_id: ${{ github.event.issue.node_id }}
gh_token: ${{ secrets.GITHUB_TOKEN }}
# Debug logging
echo "Ready to send issue to channel ID ${CHANNEL}"
- name: "Prepare payload"
uses: frabert/replace-string-action@v2.0
@@ -57,8 +43,7 @@ jobs:
flags: 'g'
- name: "Send Slack notification"
if: ${{ env.CHANNEL != 'null' }}
uses: slackapi/slack-github-action@v1.23.0
uses: slackapi/slack-github-action@v1.14.0
with:
payload: >
{

View File

@@ -1,21 +0,0 @@
name: Observability Experience test code coverage
on:
pull_request:
paths:
- 'pkg/services/queryhistory/**'
- 'pkg/tsdb/loki/**'
- 'pkg/tsdb/elasticsearch/**'
- 'public/app/features/explore/**'
- 'public/app/features/correlations/**'
- 'public/app/plugins/datasource/loki/**'
- 'public/app/plugins/datasource/elasticsearch/**'
branches-ignore:
- dependabot/**
- backport-*
jobs:
workflow-call:
uses: grafana/code-coverage/.github/workflows/code-coverage.yml@v0.1.18
with:
frontend-path-regexp: public\/app\/features\/(explore|correlations)|public\/app\/plugins\/datasource\/(loki|elasticsearch)
backend-path-regexp: pkg\/services\/(queryhistory)|pkg\/tsdb\/(loki|elasticsearch)

View File

@@ -1,7 +1,6 @@
name: "CodeQL for PR / go"
on:
workflow_dispatch:
pull_request:
branches: [main]
paths:
@@ -20,21 +19,11 @@ jobs:
# a pull request then we can checkout the head.
fetch-depth: 2
- name: Set go version
uses: actions/setup-go@v3
with:
go-version: '1.19.2'
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: "go"
- name: Build go files
run: |
go mod verify
make build-go
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

View File

@@ -1,7 +1,6 @@
name: "CodeQL for PR / javascript"
on:
workflow_dispatch:
pull_request:
branches: [main]
paths:

View File

@@ -1,7 +1,6 @@
name: "CodeQL for PR / python"
on:
workflow_dispatch:
pull_request:
branches: [main]
paths:

23
.github/workflows/prepare-release.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: Prepare release
on:
workflow_dispatch:
inputs:
version_input:
description: 'The version to be released please respect: major.minor.patch or major.minor.patch-beta<number> format. example: 7.4.3 or 7.4.3-beta1'
required: true
jobs:
call-bump-version:
uses: grafana/grafana/.github/workflows/bump-version.yml@main
with:
version_call: ${{ github.event.inputs.version_input }}
secrets:
token: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
metricsWriteAPIKey: ${{ secrets.GRAFANA_MISC_STATS_API_KEY }}
call-update-changelog:
uses: grafana/grafana/.github/workflows/update-changelog.yml@main
with:
version_call: ${{ github.event.inputs.version_input }}
secrets:
token: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
metricsWriteAPIKey: ${{ secrets.GRAFANA_MISC_STATS_API_KEY }}
needs: call-bump-version

View File

@@ -1,38 +0,0 @@
name: "publish-technical-documentation-next"
on:
push:
branches:
- "main"
paths:
- "docs/sources/**"
workflow_dispatch:
jobs:
sync:
if: "github.repository == 'grafana/grafana'"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout Grafana repo"
uses: "actions/checkout@v3"
- name: "Clone website-sync Action"
# WEBSITE_SYNC_TOKEN is a fine-grained GitHub Personal Access Token that expires.
# It must be regenerated in the grafanabot GitHub account and requires a Grafana organization
# GitHub administrator to update the organization secret.
# The IT helpdesk can update the organization secret.
run: "git clone --single-branch --no-tags --depth 1 -b master https://grafanabot:${{ secrets.WEBSITE_SYNC_TOKEN }}@github.com/grafana/website-sync ./.github/actions/website-sync"
- name: "Publish to website repository (next)"
uses: "./.github/actions/website-sync"
id: "publish-next"
with:
repository: "grafana/website"
branch: "master"
host: "github.com"
# PUBLISH_TO_WEBSITE_TOKEN is a fine-grained GitHub Personal Access Token that expires.
# It must be regenerated in the grafanabot GitHub account and requires a Grafana organization
# GitHub administrator to update the organization secret.
# The IT helpdesk can update the organization secret.
github_pat: "grafanabot:${{ secrets.PUBLISH_TO_WEBSITE_TOKEN }}"
source_folder: "docs/sources"
target_folder: "content/docs/grafana/next"

View File

@@ -1,68 +0,0 @@
name: "publish-technical-documentation-release"
on:
push:
branches:
- v[0-9]+.[0-9]+.x
tags:
- v[0-9]+.[0-9]+.[0-9]+
paths:
- "docs/sources/**"
workflow_dispatch:
jobs:
sync:
if: "github.repository == 'grafana/grafana'"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout Grafana repo"
uses: "actions/checkout@v3"
with:
fetch-depth: 0
- name: "Checkout Actions library"
uses: "actions/checkout@v3"
with:
repository: "grafana/grafana-github-actions"
path: "./actions"
- name: "Install Actions from library"
run: "npm install --production --prefix ./actions"
- name: "Determine if there is a matching release tag"
id: "has-matching-release-tag"
uses: "./actions/has-matching-release-tag"
with:
ref_name: "${{ github.ref_name }}"
release_tag_regexp: "^v(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
release_branch_regexp: "^v(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.x$"
- name: "Determine technical documentation version"
if: "steps.has-matching-release-tag.outputs.bool == 'true'"
uses: "./actions/docs-target"
id: "target"
with:
ref_name: "${{ github.ref_name }}"
- name: "Clone website-sync Action"
if: "steps.has-matching-release-tag.outputs.bool == 'true'"
# WEBSITE_SYNC_TOKEN is a fine-grained GitHub Personal Access Token that expires.
# It must be regenerated in the grafanabot GitHub account and requires a Grafana organization
# GitHub administrator to update the organization secret.
# The IT helpdesk can update the organization secret.
run: "git clone --single-branch --no-tags --depth 1 -b master https://grafanabot:${{ secrets.WEBSITE_SYNC_TOKEN }}@github.com/grafana/website-sync ./.github/actions/website-sync"
- name: "Publish to website repository (release)"
if: "steps.has-matching-release-tag.outputs.bool == 'true'"
uses: "./.github/actions/website-sync"
id: "publish-release"
with:
repository: "grafana/website"
branch: "master"
host: "github.com"
# PUBLISH_TO_WEBSITE_TOKEN is a fine-grained GitHub Personal Access Token that expires.
# It must be regenerated in the grafanabot GitHub account and requires a Grafana organization
# GitHub administrator to update the organization secret.
# The IT helpdesk can update the organization secret.
github_pat: "grafanabot:${{ secrets.PUBLISH_TO_WEBSITE_TOKEN }}"
source_folder: "docs/sources"
target_folder: "content/docs/grafana/${{ steps.target.outputs.target }}"

49
.github/workflows/publish.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: publish_docs
on:
push:
branches:
- main
paths:
- 'docs/sources/**'
- 'packages/grafana-*/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: git clone --single-branch --no-tags --depth 1 -b master https://grafanabot:${{ secrets.GH_BOT_ACCESS_TOKEN }}@github.com/grafana/website-sync ./.github/actions/website-sync
- name: generate-packages-docs
uses: actions/setup-node@v3.3.0
id: generate-docs
with:
node-version: '16'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: actions/cache@v2.1.7
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-
- run: yarn install --immutable
- run: ./scripts/ci-reference-docs-build.sh
- name: publish-to-git
uses: ./.github/actions/website-sync
id: publish
with:
repository: grafana/website
branch: master
host: github.com
github_pat: '${{ secrets.GH_BOT_ACCESS_TOKEN }}'
source_folder: docs/sources
target_folder: content/docs/grafana/next
allow_no_changes: 'true'
- shell: bash
run: |
test -n "${{ steps.publish.outputs.commit_hash }}"
test -n "${{ steps.publish.outputs.working_directory }}"

View File

@@ -1,20 +0,0 @@
name: syft-sbom-ci
on:
release:
types: [created]
jobs:
syft-sbom:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Anchore SBOM Action
uses: anchore/sbom-action@v0.12.0
with:
artifact-name: ${{ github.event.repository.name }}-spdx.json

View File

@@ -1,9 +1,9 @@
module.exports = async ({ name, github, context, core }) => {
module.exports = async ({ github, context, core }) => {
const { owner, repo } = context.repo;
const url = `https://api.github.com/repos/${owner}/${repo}/actions/runs/${context.runId}/jobs`
const result = await github.request(url);
const job = result.data.jobs.find(j => j.name === name);
core.setOutput('link', `${job.html_url}?check_suite_focus=true`);
}
const result = await github.request(url)
const link = `https://github.com/grafana/grafana/runs/${result.data.jobs[0].id}?check_suite_focus=true`;
core.setOutput('link', link);
}

View File

@@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v6
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
# Number of days of inactivity before a stale Issue or Pull Request is closed.

View File

@@ -4,7 +4,18 @@ on:
inputs:
version:
required: true
description: 'Needs to match, exactly, the name of a milestone. The version to be released please respect: major.minor.patch or major.minor.patch-beta<number> format. example: 7.4.3 or 7.4.3-beta1'
description: Needs to match, exactly, the name of a milestone
workflow_call:
inputs:
version_call:
description: Needs to match, exactly, the name of a milestone
required: true
type: string
secrets:
token:
required: true
metricsWriteAPIKey:
required: true
jobs:
main:
runs-on: ubuntu-latest
@@ -17,8 +28,16 @@ jobs:
ref: main
- name: Install Actions
run: npm install --production --prefix ./actions
- name: Run update changelog (manually invoked)
- name: Run update changelog (manually invoked)
if: ${{ github.event.inputs.version != '' }}
uses: ./actions/update-changelog
with:
token: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
metricsWriteAPIKey: ${{ secrets.GRAFANA_MISC_STATS_API_KEY }}
- name: Run update changelog (workflow invoked)
if: ${{ inputs.version_call != '' }}
uses: ./actions/update-changelog
with:
version_call: ${{ inputs.version_call }}
token: ${{ secrets.token }}
metricsWriteAPIKey: ${{ secrets.metricsWriteAPIKey }}

31
.gitignore vendored
View File

@@ -40,8 +40,6 @@ tsconfig.tsbuildinfo
# Enterprise devenv
/devenv/docker/blocks/grafana-enterprise
/devenv/docker/blocks/saml-enterprise
# This is the new place of the block, but I leave the previous here for a while
/devenv/docker/blocks/auth/saml-enterprise
/tmp
tools/phantomjs/phantomjs
@@ -61,7 +59,6 @@ public/css/*.min.css
*.sublime-workspace
*.swp
.idea/
.fleet/
*.iml
*.tmp
.DS_Store
@@ -76,11 +73,7 @@ public/css/*.min.css
# devenv
/devenv/docker-compose.yaml
/devenv/docker-compose.override.yaml
/devenv/.env
/devenv/docker/blocks/tempo/tempo-data/
/devenv/docker/ha-test-unified-alerting/logs/webhook/dumps/
/devenv/docker/ha-test-unified-alerting/logs/webhook/webhook-listener.log
conf/custom.ini
/conf/provisioning/**/custom.yaml
@@ -107,7 +100,6 @@ debug.test
/packaging/**/*.tar.gz
/packaging/**/*.tar.gz.sha256
pkg/cmd/grafana-server/__debug_bin
pkg/services/quota/quotaimpl/storage/storage.json
# Ignore OSX indexing
.DS_Store
@@ -126,21 +118,12 @@ pkg/services/quota/quotaimpl/storage/storage.json
/scripts/build/release_publisher/release_publisher
*.patch
!.yarn/patches/*.patch
# Ignoring frontend packages specifics
/packages/grafana-ui/.yarn/.cache
/packages/**/dist
/packages/**/compiled
/packages/**/.rpt2_cache
/packages/**/tsdoc-metadata.json
/packages/**/package.tgz
/packages/grafana-toolkit/sass
## CI places the packages in a different location
/npm-artifacts/*.tgz
# Ignore frontend build manifest
manifest.json
# Ignore go local build dependencies
/scripts/go/bin/**
@@ -159,8 +142,6 @@ compilation-stats.json
/e2e/benchmarks/**/results/*
/e2e/benchmarks/**/results
/e2e/build_results.zip
/e2e/extensions
/e2e/extensions-suite
# grafana server
/scripts/grafana-server/server.log
@@ -175,13 +156,15 @@ compilation-stats.json
# auto generated frontend docs
/docs/sources/packages_api
# wire generated files
**/wire_gen.go
# auto generated Go files
*_gen.go
!pkg/services/featuremgmt/toggles_gen.go
!pkg/coremodel/**/*_gen.go
!pkg/framework/**/*_gen.go
# Auto-generated internationalization files
# Auto-generated localisation files
public/locales/_build/
public/locales/*/*.js
public/locales/*/grafana_old.json
public/locales/**/*.js
deployment_tools_config.json

View File

@@ -1,149 +0,0 @@
[run]
timeout = "10m"
[linters-settings.goconst]
min-len = 5
min-occurrences = 5
[linters-settings.exhaustive]
default-signifies-exhaustive = true
[linters-settings.revive]
ignore-generated-header = false
severity = "warning"
confidence = 3
[linters-settings.depguard]
list-type = "blacklist"
include-go-root = true
packages = ["io/ioutil"]
[[linters-settings.depguard.packages-with-error-message]]
"io/ioutil" = "Deprecated: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details."
"gopkg.in/yaml.v2" = "Grafana packages are not allowed to depend on gopkg.in/yaml.v2 as gopkg.in/yaml.v3 is now available"
[linters-settings.gocritic]
enabled-checks = ["ruleguard"]
[linters-settings.gocritic.settings.ruleguard]
rules = "pkg/ruleguard.rules.go"
[linters]
disable-all = true
enable = [
"bodyclose",
"depguard",
"dogsled",
"errcheck",
# "gochecknoinits",
"goconst",
# "gocritic", # Temporarily disabled on 2022-09-09, running into weird bug "ruleguard: execution error: used Run() with an empty rule set; forgot to call Load() first?"
"goimports",
"goprintffuncname",
"gosec",
"gosimple",
"govet",
"ineffassign",
"misspell",
"nakedret",
"rowserrcheck",
"exportloopref",
"staticcheck",
"stylecheck",
"typecheck",
"unconvert",
"unused",
"whitespace",
"gocyclo",
"exhaustive",
"typecheck",
"asciicheck",
"errorlint",
"revive",
]
# Disabled linters (might want them later)
# "unparam"
[issues]
exclude-use-default = false
# Enable when appropriate
# Poorly chosen identifier
[[issues.exclude-rules]]
linters = ["stylecheck"]
text = "ST1003"
# Enable when appropriate
# Dot imports that aren't in external test packages are discouraged.
[[issues.exclude-rules]]
linters = ["stylecheck"]
text = "ST1001"
# Enable when appropriate
# strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly.
# Use golang.org/x/text/cases instead.
[[issues.exclude-rules]]
linters = ["staticcheck"]
text = "SA1019: strings.Title"
[[issues.exclude-rules]]
linters = ["staticcheck"]
text = "use fake service and real access control evaluator instead"
[[issues.exclude-rules]]
linters = ["gosec"]
text = "G108"
[[issues.exclude-rules]]
linters = ["gosec"]
text = "G110"
[[issues.exclude-rules]]
linters = ["gosec"]
text = "G201"
[[issues.exclude-rules]]
linters = ["gosec"]
text = "G202"
[[issues.exclude-rules]]
linters = ["gosec"]
text = "G306"
[[issues.exclude-rules]]
linters = ["gosec"]
text = "401"
[[issues.exclude-rules]]
linters = ["gosec"]
text = "402"
[[issues.exclude-rules]]
linters = ["gosec"]
text = "501"
[[issues.exclude-rules]]
linters = ["gosec"]
text = "404"
[[issues.exclude-rules]]
linters = ["misspell"]
text = "Unknwon` is a misspelling of `Unknown"
[[issues.exclude-rules]]
linters = ["errorlint"]
text = "non-wrapping format verb for fmt.Errorf"
# TODO: Enable
[[issues.exclude-rules]]
linters = ["stylecheck"]
text = "ST1000"
# TODO: Enable
[[issues.exclude-rules]]
linters = ["stylecheck"]
text = "ST1020"
# TODO: Enable
[[issues.exclude-rules]]
linters = ["stylecheck"]
text = "ST1021"

View File

@@ -1,8 +1,8 @@
{
"locales": [
"en-US",
"fr-FR",
"es-ES",
"en",
"fr",
"es",
"pseudo-LOCALE"
],
"catalogs": [
@@ -20,11 +20,11 @@
}
],
"fallbackLocales": {
"pseudo-LOCALE": "en-US",
"default": "en-US"
"pseudo-LOCALE": "en",
"default": "en"
},
"pseudoLocale": "pseudo-LOCALE",
"sourceLocale": "en-US",
"sourceLocale": "en",
"format": "po",
"formatOptions": {
"lineNumbers": false

2
.nvmrc
View File

@@ -1 +1 @@
v18.12.0
v16.14.0

View File

@@ -1,54 +1,8 @@
var dashboardSettings = [
{
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=settings',
wait: 500,
rootElement: '.main-view',
threshold: 0,
},
{
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=annotations',
wait: 500,
rootElement: '.main-view',
threshold: 0,
},
{
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=templating',
wait: 500,
rootElement: '.main-view',
threshold: 0,
},
{
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=links',
wait: 500,
rootElement: '.main-view',
threshold: 0,
},
{
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=versions',
wait: 500,
rootElement: '.main-view',
threshold: 0,
},
{
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=permissions',
wait: 500,
rootElement: '.main-view',
threshold: 9,
},
{
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=dashboard_json',
wait: 500,
rootElement: '.main-view',
threshold: 2,
},
];
var config = {
defaults: {
concurrency: 1,
runners: ['axe'],
useIncognitoBrowserContext: false,
standard: 'WCAG2AA',
chromeLaunchConfig: {
args: ['--no-sandbox'],
},
@@ -62,7 +16,7 @@ var config = {
url: '${HOST}/login',
wait: 500,
rootElement: '.main-view',
threshold: 13,
threshold: 12,
},
{
url: '${HOST}/login',
@@ -74,7 +28,7 @@ var config = {
"click element button[aria-label='Login button']",
"wait for element [aria-label='Skip change password button'] to be visible",
],
threshold: 14,
threshold: 13,
rootElement: '.main-view',
},
{
@@ -88,7 +42,12 @@ var config = {
rootElement: '.main-view',
threshold: 0,
},
...dashboardSettings,
{
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=settings',
wait: 500,
rootElement: '.main-view',
threshold: 0,
},
{
url: '${HOST}/?orgId=1&search=open',
wait: 500,
@@ -101,49 +60,49 @@ var config = {
rootElement: '.main-view',
// the unified alerting promotion alert's content contrast is too low
// see https://github.com/grafana/grafana/pull/41829
threshold: 6,
threshold: 5,
},
{
url: '${HOST}/datasources',
wait: 500,
rootElement: '.main-view',
threshold: 1,
threshold: 0,
},
{
url: '${HOST}/org/users',
wait: 500,
rootElement: '.main-view',
threshold: 1,
threshold: 0,
},
{
url: '${HOST}/org/teams',
wait: 500,
rootElement: '.main-view',
threshold: 1,
threshold: 0,
},
{
url: '${HOST}/plugins',
wait: 500,
rootElement: '.main-view',
threshold: 1,
threshold: 0,
},
{
url: '${HOST}/org',
wait: 500,
rootElement: '.main-view',
threshold: 1,
threshold: 0,
},
{
url: '${HOST}/org/apikeys',
wait: 500,
rootElement: '.main-view',
threshold: 4,
threshold: 0,
},
{
url: '${HOST}/dashboards',
wait: 500,
rootElement: '.main-view',
threshold: 1,
threshold: 0,
},
],
};

View File

@@ -1,46 +1,8 @@
var dashboardSettings = [
{
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=settings',
wait: 500,
rootElement: '.main-view',
},
{
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=annotations',
wait: 500,
rootElement: '.main-view',
},
{
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=templating',
wait: 500,
rootElement: '.main-view',
},
{
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=links',
wait: 500,
rootElement: '.main-view',
},
{
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=versions',
wait: 500,
rootElement: '.main-view',
},
{
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=permissions',
wait: 500,
rootElement: '.main-view',
},
{
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=dashboard_json',
wait: 500,
rootElement: '.main-view',
},
];
var config = {
defaults: {
concurrency: 1,
runners: ['axe'],
useIncognitoBrowserContext: false,
standard: 'WCAG2AA',
chromeLaunchConfig: {
args: ['--no-sandbox'],
},
@@ -76,7 +38,11 @@ var config = {
wait: 500,
rootElement: '.main-view',
},
...dashboardSettings,
{
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=settings',
wait: 500,
rootElement: '.main-view',
},
{
url: '${HOST}/?orgId=1&search=open',
wait: 500,

View File

@@ -18,23 +18,10 @@ vendor
# TS generate from cue by cuetsy
**/*.gen.ts
# Auto-generated internationalization files
# Auto-generated localisation files
public/locales/_build/
public/locales/**/*.js
# Auto-generated theme files
theme.light.generated.json
theme.dark.generated.json
# Generated Swagger API specs
public/api-spec.json
public/api-merged.json
public/openapi3.json
# Generated Kinds report
kinds/report.json
# Generated schema docs
docs/sources/developers/kinds/
scripts/cli/bettererIssueTemplate.md

19
.vscode/launch.json vendored
View File

@@ -6,17 +6,10 @@
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/pkg/cmd/grafana/",
"program": "${workspaceFolder}/pkg/cmd/grafana-server/",
"env": {},
"cwd": "${workspaceFolder}",
"args": ["server", "--homepath", "${workspaceFolder}", "--packaging", "dev"]
},
{
"name": "Attach to Chrome",
"port": 9222,
"request": "attach",
"type": "chrome",
"webRoot": "${workspaceFolder}"
"args": ["--homepath", "${workspaceFolder}", "--packaging", "dev"]
},
{
"name": "Debug Jest test",
@@ -27,14 +20,6 @@
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"port": 9229
},
{
"name": "Debug Go test",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceFolder}/${relativeFileDirname}",
"showLog": true
}
]
}

File diff suppressed because one or more lines are too long

786
.yarn/releases/yarn-3.2.1.cjs vendored Executable file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,13 +1,13 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve} = require(`path`);
const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {

View File

@@ -1,13 +1,13 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve} = require(`path`);
const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {

View File

@@ -1,6 +1,6 @@
{
"name": "eslint",
"version": "8.32.0-sdk",
"version": "8.17.0-sdk",
"main": "./lib/api.js",
"type": "commonjs"
}

View File

@@ -2,5 +2,5 @@
# Manual changes might be lost!
integrations:
- vim
- vscode
- vim

View File

@@ -1,13 +1,13 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve} = require(`path`);
const relPnpApiPath = "../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {

View File

@@ -1,6 +1,6 @@
{
"name": "prettier",
"version": "2.8.1-sdk",
"version": "2.6.2-sdk",
"main": "./index.js",
"type": "commonjs"
}

View File

@@ -1,13 +1,13 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve} = require(`path`);
const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {

View File

@@ -1,13 +1,13 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve} = require(`path`);
const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {

View File

@@ -1,13 +1,13 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve} = require(`path`);
const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {

View File

@@ -1,13 +1,13 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve} = require(`path`);
const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
const moduleWrapper = tsserver => {
if (!process.versions.pnp) {

View File

@@ -1,13 +1,13 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve} = require(`path`);
const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
const moduleWrapper = tsserver => {
if (!process.versions.pnp) {

View File

@@ -1,13 +1,13 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve} = require(`path`);
const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {

View File

@@ -1,6 +1,6 @@
{
"name": "typescript",
"version": "4.8.4-sdk",
"version": "4.6.4-sdk",
"main": "./lib/typescript.js",
"type": "commonjs"
}

View File

@@ -3,36 +3,41 @@ enableTelemetry: false
nodeLinker: pnp
packageExtensions:
'@storybook/addon-docs@6.5.12':
"@grafana/slate-react@0.22.10-grafana":
peerDependencies:
'@babel/core': ^7.0.0
'@storybook/manager-webpack5': 6.5.12
'webpack': 5.74.0
'@storybook/addon-essentials@6.5.12':
slate-react: ">=0.22.0"
"@mdx-js/loader@1.6.22":
peerDependencies:
'@storybook/components': 6.5.12
'@storybook/core-events': 6.5.12
'@storybook/manager-webpack5': 6.5.12
'@storybook/theming': 6.5.12
'@storybook/core-server@6.5.12':
react: 17.0.1
"@storybook/addon-docs@6.4.21":
peerDependencies:
'@babel/core': ^7.0.0
'@storybook/core@6.5.12':
"@storybook/manager-webpack5": 6.4.21
"@storybook/addon-essentials@6.4.21":
peerDependencies:
'@babel/core': ^7.0.0
'@storybook/manager-webpack5': 6.5.12
'@storybook/csf-tools@6.5.12':
"@storybook/components": 6.4.21
"@storybook/core-events": 6.4.21
"@storybook/manager-webpack5": 6.4.21
"@storybook/theming": 6.4.21
"@storybook/core-server@6.4.21":
peerDependencies:
'@babel/core': ^7.0.0
'@storybook/mdx2-csf@0.0.3':
dependencies:
'@babel/types': ^7.14.8
'@storybook/react@6.5.12':
"@babel/core": ^7.0.0
"@storybook/core@6.4.21":
peerDependencies:
'@storybook/manager-webpack5': 6.5.12
"@babel/core": ^7.0.0
"@storybook/manager-webpack5": 6.4.21
"@storybook/csf-tools@6.4.21":
peerDependencies:
"@babel/core": ^7.0.0
"@storybook/react@6.4.21":
peerDependencies:
"@storybook/manager-webpack5": 6.4.21
doctrine@3.0.0:
dependencies:
assert: 2.0.0
moveable@0.30.0:
dependencies:
"@daybrush/utils": 1.7.0
framework-utils: ^1.1.0
rc-time-picker@3.7.3:
peerDependencies:
react: 17.0.1
@@ -44,26 +49,36 @@ packageExtensions:
react-compat-css-styled@1.0.8:
dependencies:
react-simple-compat: 1.2.2
react-compat-moveable@0.18.0:
dependencies:
"@egjs/agent": ^2.2.1
"@egjs/children-differ": ^1.0.1
"@scena/matrix": 1.1.1
css-to-mat: ^1.0.3
gesto: ^1.9.0
overlap-area: ^1.0.0
react-simple-compat: 1.2.2
peerDependencies:
framework-utils: ^1.1.0
react-docgen-typescript-loader@3.7.2:
peerDependencies:
webpack: 4.41.5
react-icons@2.2.7:
peerDependencies:
prop-types: '*'
prop-types: "*"
react-resizable@3.0.4:
peerDependencies:
react-dom: 17.0.1
"@npmcli/run-script@4.1.3":
dependencies:
which: ^2.0.2
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: '@yarnpkg/plugin-typescript'
spec: "@yarnpkg/plugin-typescript"
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: '@yarnpkg/plugin-interactive-tools'
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs
spec: 'https://mskelton.dev/yarn-outdated/v2'
spec: "https://mskelton.dev/yarn-outdated/v2"
yarnPath: .yarn/releases/yarn-3.3.0.cjs
# Uncomment the following lines if you want to use Verdaccio local npm registry. Read more at packages/README.md
# npmScopes:
# grafana:
# npmRegistryServer: http://localhost:4873
# unsafeHttpWhitelist:
# - 'localhost'
yarnPath: .yarn/releases/yarn-3.2.1.cjs

File diff suppressed because it is too large Load Diff

View File

@@ -15,8 +15,6 @@ You can contribute to Grafana in several ways. Here are some examples:
- Organize meetups and user groups in your local area.
- Help others by answering questions about Grafana.
**Please note:** We do not currently accept contributions for translations. Please do not submit pull requests for messages.po files - they will be rejected.
For more ways to contribute, check out the [Open Source Guides](https://opensource.guide/how-to-contribute/).
### Report bugs

View File

@@ -1,17 +1,8 @@
# syntax=docker/dockerfile:1
ARG BASE_IMAGE=alpine:3.17
ARG JS_IMAGE=node:18-alpine3.17
ARG GO_IMAGE=golang:1.20.4-alpine3.17
ARG GO_SRC=go-builder
ARG JS_SRC=js-builder
FROM ${JS_IMAGE} as js-builder
FROM node:16-alpine3.15 as js-builder
ENV NODE_OPTIONS=--max_old_space_size=8000
WORKDIR /tmp/grafana
WORKDIR /grafana
COPY package.json yarn.lock .yarnrc.yml ./
COPY .yarn .yarn
@@ -22,143 +13,84 @@ RUN yarn install
COPY tsconfig.json .eslintrc .editorconfig .browserslistrc .prettierrc.js babel.config.json .linguirc ./
COPY public public
COPY tools tools
COPY scripts scripts
COPY emails emails
ENV NODE_ENV production
RUN yarn build
FROM ${GO_IMAGE} as go-builder
FROM golang:1.17.11-alpine3.15 as go-builder
# Install build dependencies
RUN if grep -i -q alpine /etc/issue; then \
apk add --no-cache gcc g++ make; \
fi
RUN apk add --no-cache gcc g++ make
WORKDIR /tmp/grafana
WORKDIR /grafana
COPY go.* ./
COPY .bingo .bingo
RUN go mod download && \
go install github.com/bwplotka/bingo@latest && \
bingo get
COPY embed.go Makefile build.go package.json ./
COPY cue.mod cue.mod
COPY kinds kinds
COPY local local
COPY go.mod go.sum embed.go Makefile build.go package.json ./
COPY cue cue
COPY packages/grafana-schema packages/grafana-schema
COPY public/app/plugins public/app/plugins
COPY public/api-spec.json public/api-spec.json
COPY pkg pkg
COPY scripts scripts
COPY conf conf
COPY .github .github
COPY cue.mod cue.mod
COPY .bingo .bingo
RUN go mod verify
RUN make build-go
FROM ${BASE_IMAGE} as tgz-builder
WORKDIR /tmp/grafana
ARG GRAFANA_TGZ="grafana-latest.linux-x64-musl.tar.gz"
COPY ${GRAFANA_TGZ} /tmp/grafana.tar.gz
# add -v to make tar print every file it extracts
RUN tar x -z -f /tmp/grafana.tar.gz --strip-components=1
# helpers for COPY --from
FROM ${GO_SRC} as go-src
FROM ${JS_SRC} as js-src
# Final stage
FROM ${BASE_IMAGE}
FROM alpine:3.15
LABEL maintainer="Grafana Labs <hello@grafana.com>"
LABEL maintainer="Grafana team <hello@grafana.com>"
ARG GF_UID="472"
ARG GF_GID="0"
ENV PATH="/usr/share/grafana/bin:$PATH" \
GF_PATHS_CONFIG="/etc/grafana/grafana.ini" \
GF_PATHS_DATA="/var/lib/grafana" \
GF_PATHS_HOME="/usr/share/grafana" \
GF_PATHS_LOGS="/var/log/grafana" \
GF_PATHS_PLUGINS="/var/lib/grafana/plugins" \
GF_PATHS_PROVISIONING="/etc/grafana/provisioning"
GF_PATHS_CONFIG="/etc/grafana/grafana.ini" \
GF_PATHS_DATA="/var/lib/grafana" \
GF_PATHS_HOME="/usr/share/grafana" \
GF_PATHS_LOGS="/var/log/grafana" \
GF_PATHS_PLUGINS="/var/lib/grafana/plugins" \
GF_PATHS_PROVISIONING="/etc/grafana/provisioning"
WORKDIR $GF_PATHS_HOME
# Install dependencies
RUN if grep -i -q alpine /etc/issue; then \
apk add --no-cache ca-certificates bash tzdata musl-utils && \
apk info -vv | sort; \
elif grep -i -q ubuntu /etc/issue; then \
DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y ca-certificates curl tzdata && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*; \
else \
echo 'ERROR: Unsupported base image' && /bin/false; \
fi
RUN apk add --no-cache ca-certificates bash tzdata musl-utils
RUN apk add --no-cache openssl ncurses-libs ncurses-terminfo-base --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main
RUN apk upgrade ncurses-libs ncurses-terminfo-base --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main
RUN apk info -vv | sort
# glibc support for alpine x86_64 only
RUN if grep -i -q alpine /etc/issue && [ `arch` = "x86_64" ]; then \
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-2.35-r0.apk \
-O /tmp/glibc-2.35-r0.apk && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-bin-2.35-r0.apk \
-O /tmp/glibc-bin-2.35-r0.apk && \
apk add --force-overwrite --no-cache /tmp/glibc-2.35-r0.apk /tmp/glibc-bin-2.35-r0.apk && \
rm -f /lib64/ld-linux-x86-64.so.2 && \
ln -s /usr/glibc-compat/lib64/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2 && \
rm -f /tmp/glibc-2.35-r0.apk && \
rm -f /tmp/glibc-bin-2.35-r0.apk && \
rm -f /lib/ld-linux-x86-64.so.2 && \
rm -f /etc/ld.so.cache; \
fi
COPY --from=go-src /tmp/grafana/conf ./conf
COPY conf ./conf
RUN if [ ! $(getent group "$GF_GID") ]; then \
if grep -i -q alpine /etc/issue; then \
addgroup -S -g $GF_GID grafana; \
else \
addgroup --system --gid $GF_GID grafana; \
fi; \
fi && \
GF_GID_NAME=$(getent group $GF_GID | cut -d':' -f1) && \
mkdir -p "$GF_PATHS_HOME/.aws" && \
if grep -i -q alpine /etc/issue; then \
adduser -S -u $GF_UID -G "$GF_GID_NAME" grafana; \
else \
adduser --system --uid $GF_UID --ingroup "$GF_GID_NAME" grafana; \
fi && \
mkdir -p "$GF_PATHS_PROVISIONING/datasources" \
"$GF_PATHS_PROVISIONING/dashboards" \
"$GF_PATHS_PROVISIONING/notifiers" \
"$GF_PATHS_PROVISIONING/plugins" \
"$GF_PATHS_PROVISIONING/access-control" \
"$GF_PATHS_PROVISIONING/alerting" \
"$GF_PATHS_LOGS" \
"$GF_PATHS_PLUGINS" \
"$GF_PATHS_DATA" && \
cp conf/sample.ini "$GF_PATHS_CONFIG" && \
cp conf/ldap.toml /etc/grafana/ldap.toml && \
chown -R "grafana:$GF_GID_NAME" "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING" && \
chmod -R 777 "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING"
addgroup -S -g $GF_GID grafana; \
fi
COPY --from=go-src /tmp/grafana/bin/grafana* /tmp/grafana/bin/*/grafana* ./bin/
COPY --from=js-src /tmp/grafana/public ./public
RUN export GF_GID_NAME=$(getent group $GF_GID | cut -d':' -f1) && \
mkdir -p "$GF_PATHS_HOME/.aws" && \
adduser -S -u $GF_UID -G "$GF_GID_NAME" grafana && \
mkdir -p "$GF_PATHS_PROVISIONING/datasources" \
"$GF_PATHS_PROVISIONING/dashboards" \
"$GF_PATHS_PROVISIONING/notifiers" \
"$GF_PATHS_PROVISIONING/plugins" \
"$GF_PATHS_PROVISIONING/access-control" \
"$GF_PATHS_LOGS" \
"$GF_PATHS_PLUGINS" \
"$GF_PATHS_DATA" && \
cp "$GF_PATHS_HOME/conf/sample.ini" "$GF_PATHS_CONFIG" && \
cp "$GF_PATHS_HOME/conf/ldap.toml" /etc/grafana/ldap.toml && \
chown -R "grafana:$GF_GID_NAME" "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING" && \
chmod -R 777 "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING"
COPY --from=go-builder /grafana/bin/*/grafana-server /grafana/bin/*/grafana-cli ./bin/
COPY --from=js-builder /grafana/public ./public
COPY --from=js-builder /grafana/tools ./tools
EXPOSE 3000
ARG RUN_SH=./packaging/docker/run.sh
COPY ./packaging/docker/run.sh /run.sh
COPY ${RUN_SH} /run.sh
USER "$GF_UID"
USER grafana
ENTRYPOINT [ "/run.sh" ]

87
Dockerfile.ubuntu Normal file
View File

@@ -0,0 +1,87 @@
FROM node:16-alpine3.15 as js-builder
ENV NODE_OPTIONS=--max_old_space_size=8000
WORKDIR /usr/src/app/
COPY package.json yarn.lock ./
COPY packages packages
COPY .yarnrc.yml ./
COPY .yarn .yarn
COPY plugins-bundled plugins-bundled
RUN yarn install
COPY tsconfig.json .eslintrc .editorconfig .browserslistrc .prettierrc.js babel.config.json .linguirc ./
COPY public public
COPY tools tools
COPY scripts scripts
COPY emails emails
ENV NODE_ENV production
RUN yarn build
FROM golang:1.17.11 AS go-builder
WORKDIR /src/grafana
COPY go.mod go.sum embed.go ./
COPY Makefile build.go package.json ./
COPY .bingo .bingo
COPY pkg pkg/
COPY cue cue/
COPY cue.mod cue.mod/
COPY packages/grafana-schema packages/grafana-schema/
COPY public/app/plugins public/app/plugins/
COPY public/api-spec.json public/api-spec.json
RUN go mod verify
RUN make build-go
FROM ubuntu:20.04
LABEL maintainer="Grafana team <hello@grafana.com>"
EXPOSE 3000
ARG GF_UID="472"
ARG GF_GID="472"
ENV PATH="/usr/share/grafana/bin:$PATH" \
GF_PATHS_CONFIG="/etc/grafana/grafana.ini" \
GF_PATHS_DATA="/var/lib/grafana" \
GF_PATHS_HOME="/usr/share/grafana" \
GF_PATHS_LOGS="/var/log/grafana" \
GF_PATHS_PLUGINS="/var/lib/grafana/plugins" \
GF_PATHS_PROVISIONING="/etc/grafana/provisioning"
WORKDIR $GF_PATHS_HOME
COPY conf conf
# curl should be part of the image
RUN apt-get update && apt-get install -y ca-certificates curl
RUN mkdir -p "$GF_PATHS_HOME/.aws" && \
addgroup --system --gid $GF_GID grafana && \
adduser --uid $GF_UID --system --ingroup grafana grafana && \
mkdir -p "$GF_PATHS_PROVISIONING/datasources" \
"$GF_PATHS_PROVISIONING/dashboards" \
"$GF_PATHS_PROVISIONING/notifiers" \
"$GF_PATHS_PROVISIONING/plugins" \
"$GF_PATHS_PROVISIONING/access-control" \
"$GF_PATHS_LOGS" \
"$GF_PATHS_PLUGINS" \
"$GF_PATHS_DATA" && \
cp conf/sample.ini "$GF_PATHS_CONFIG" && \
cp conf/ldap.toml /etc/grafana/ldap.toml && \
chown -R grafana:grafana "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING" && \
chmod -R 777 "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING"
COPY --from=go-builder /src/grafana/bin/*/grafana-server /src/grafana/bin/*/grafana-cli bin/
COPY --from=js-builder /usr/src/app/public public
COPY --from=js-builder /usr/src/app/tools tools
COPY packaging/docker/run.sh /
USER grafana
ENTRYPOINT [ "/run.sh" ]

View File

@@ -20,52 +20,43 @@ If you don't have the knowledge or time to code, consider helping with triage. T
<!-- https://textik.com/#610afa78553def29 -->
```
+-------------------+
| |
| new issue/ | +
| more info added |
| |
+---------|---------+
|
+-------------|-----------+
| |
NO +------- all info needed to ------+ YES
| | categorize the issue? | |
| | | |
| +-------------------------+ |
+------|-----------+ +------------|----------+
| | | |
| label: | | label: type/* |
| needs more info | | label: area/* |
| | | label: datasource/* |
+------------------+ | | |
+------------|----------+
|
+--------|-------+
| |
NO +---------- is duplicate? --------------------+ YES
| | | |
| +----------------+ |
| +----------------|---------------+
+------|-----+ | |
| | | add comment: |
NO +------------ can repro? ------------+ YES | |
| | | | | /duplicate of #<issue number> |
| +------------+ | | |
| | +--------------------------------+
+-------------|-------------+ |
| | +--------|---------+
| label: | | |
| triage/needs-confirmation | NO +-------- needs priority? ------+ YES
| | | | | |
+-------------|-------------+ | +------------------+ |
| | |
+-------------|------+ +-------|--------+ +----------|---------+
| | | | | |
| Assign to project ------ Done -------------- label: priority/* |
| | | | | |
+--------------------+ +----------------+ +--------------------+
+--------------------------+
+----------------+ New issue opened/ |
| | more information added |
| +-------------+------------+
| Ask for more |
| information +-------------+------------+
| | All information needed |
| +--------+ to categorize the issue? +--------+
| | | | |
| | NO +--------------------------+ YES |
| | |
+------+-------+-------------+ +------------+---------+ +----------------------------+
| | | | | |
| label: needs more info | | Needs investigation? +--YES---+ label: needs investigation |
| | | | | |
+----------------------------+ +----------------+-----+ +--------------+-------------+
NO | |
| Investigate |
+-----------+----------+ |
| label: type/* | |
| label: area/* +------------------+
| label: datasource/* |
+-----|----------+-----+
| |
| |
| +--+--------------------+ +--------------------+
| | | | label: priority/* |
| | Needs priority? +--YES---+| milestone? |
| | | | |
| +--------------------+--+ +----+---------------+
| NO | |
| | |
+----+-------------+ +---+----------+ |
| | | | |
| Close issue +----------+ Done +------+
| | | |
+------------------+ +--------------+
```
## 1. Find uncategorized issues
@@ -96,29 +87,28 @@ Given a certain [issue template](https://github.com/grafana/grafana/issues/new/c
Should explain what happened, what was expected and how to reproduce it together with any additional information that may help giving a complete picture of what happened such as screenshots, [query inspector](https://community.grafana.com/t/using-grafanas-query-inspector-to-troubleshoot-issues/2630) output and any environment related information that's applicable and/or maybe related to the reported problem:
- Grafana version:
- Data source type & version:
- OS Grafana is installed on:
- User OS & Browser:
- Grafana plugins:
- Others:
- Grafana version
- Data source type & version
- Platform & OS Grafana is installed on
- User OS & Browser + versions
- Using docker + what environment
- Which plugins
- Configuration database in use (sqlite, mysql, postgres)
- Reverse proxy in front of Grafana, what version and configuration
- Non-default configuration settings
- Development environment like Go and Node versions, if applicable
#### Enhancement requests
Enhancement requests (aka. feature requests) should be created as a [Github discussion](https://github.com/grafana/grafana/discussions). When submitting an enhancement request we ask that users focus on the problem they'd like to solve and why its a problem rather than focusing on the solution itself. To facilitate this we recommend using the following template:
- What would you like to be added?:
- Why is this needed (describe your use case and goals)\*\*?:
Should explain what enhancement or feature that the author wants to be added and why that is needed.
#### Accessibility issues
This is a mix between a bug report and enhancement request but focused on accessibility issues to help make Grafana improve keyboard navigation, screen-reader support and being accessible to everyone. The report should include relevant [WCAG criteria](https://www.w3.org/WAI/WCAG21/quickref/?versions=2.0), if applicable.
Grafana Labs is dedicated to improving our graphical user interfaces and overall experience so that our product becomes usable and accessible for people with disabilities as well as anyone else. Learn more about Grafana's commitment to [A11y](https://grafana.com/accessibility/) (accessibility).
This is a mix between a bug report and enhancement request but focused on accessibility issues to help make Grafana improve keyboard navigation, screen-reader support and being accessible to everyone. The report should include relevant WCAG criteria, if applicable.
#### Support requests
In general, if the issue description and title is perceived as a question no more information is needed. See how to categorize these requests [here](#support-requests-1).
In general, if the issue description and title is perceived as a question no more information is needed.
### Good practices
@@ -132,7 +122,7 @@ To make it easier for everyone to understand and find issues they're searching f
### Do you have all the information needed to categorize an issue?
Depending on the issue, you might not feel all this information is needed. Use your best judgement. If you cannot triage an issue using what its author provided, explain kindly to the author that they must provide the above information to clarify the problem. Label issue with `needs more info` and add any related `area/*` or `datasource/*` labels. Alternatively, use `bot/needs more info` label and the Grafana bot will request it for you.
Depending on the issue, you might not feel all this information is needed. Use your best judgement. If you cannot triage an issue using what its author provided, explain kindly to the author that they must provide the above information to clarify the problem. Label issue with `needs more detail` and add any related `area/*` or `datasource/*` labels.
If the author provides the standard information but you are still unable to triage the issue, request additional information. Do this kindly and politely because you are asking for more of the author's time.
@@ -168,7 +158,7 @@ Make sure it's not a duplicate by searching existing issues using related terms
1. Add a comment `/duplicate of #<issue number>`. GitHub will recognize this and add some additional context to the issue activity.
2. The Grafana bot will do the rest, adding the correct label and closing comment
3. Add `type/duplicate` label. Optionally add any related `area/*` or `datasource/*` labels.
3. Optionally add any related `area/*` or `datasource/*` labels.
### Bug reports
@@ -193,8 +183,8 @@ If it's not perfectly clear that it's an actual bug, quickly try to reproduce it
### Enhancement/feature?
1. Remind the contributor that enhancement/feature request should be created as a GitHub discussion. See [Enhancements requests.](https://github.com/grafana/grafana/blob/main/ISSUE_TRIAGE.md#enhancement-requests)
2. Label the issue `type/feature-request` and at least one `area/*` or `datasource/*` label.
1. Label the issue `type/feature-request` and at least one `area/*` or `datasource/*` label.
2. Move on to [prioritizing the issue](#4-prioritization-of-issues).
### Documentation issue?
@@ -225,7 +215,7 @@ There's a minor typo/error/lack of information that adds a lot of confusion for
### Support requests
1. Kindly and politely direct the issue author to the [community site](https://community.grafana.com/) and explain that GitHub is mainly used for tracking bugs and feature requests. If possible, it's usually a good idea to add some pointers to the issue author's question.
2. Label the issue with `bot/question`. The Grafana bot will automatically close the issue, and it will add the type/question label for you.
2. Close the issue and label it with `type/question`.
## 4. Prioritization of issues
@@ -306,7 +296,7 @@ In many cases the issue author or community as a whole is more suitable to contr
## Investigation of issues
When an issue has all basic information provided, but the triage responsible haven't been able to reproduce the reported problem at a first glance, the issue is labeled [`triage/needs-confirmation`](https://github.com/grafana/grafana/labels/triage%2Fneeds-confirmation). Depending on the perceived severity and/or number of [upvotes](https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments), the investigation will either be delegated to another maintainer for further investigation or put on hold until someone else (maintainer or contributor) picks it up and eventually starts investigating it.
When an issue has all basic information provided, but the triage responsible haven't been able to reproduce the reported problem at a first glance, the issue is labeled [Needs investigation](https://github.com/grafana/grafana/labels/needs%20investigation). Depending on the perceived severity and/or number of [upvotes](https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments), the investigation will either be delegated to another maintainer for further investigation or put on hold until someone else (maintainer or contributor) picks it up and eventually starts investigating it.
Investigating issues can be a very time consuming task, especially for the maintainers, given the huge number of combinations of plugins, data sources, platforms, databases, browsers, tools, hardware, integrations, versions and cloud services, etc that are being used with Grafana. There is a certain number of combinations that are more common than others, and these are in general easier for maintainers to investigate.
@@ -318,16 +308,19 @@ Even if you don't have the time or knowledge to investigate an issue we highly r
We have some automation that triggers on comments or labels being added to issues. Many of these automated behaviors are defined in [commands.json](https://github.com/grafana/grafana/blob/main/.github/commands.json). Or in other [GitHub Actions](https://github.com/grafana/grafana/tree/main/.github/workflows)
- Add /duplicate `#<issue number>` to have Grafana label & close issue with an appropriate message.
- Add `bot/question` and the bot will close it with an appropriate message.
[Read more on bot actions](https://github.com/grafana/grafana/blob/main/.github/bot.md)
## External PRs
Part of issue triage should also be triaging of external PRs. Main goal should be to make sure PRs from external contributors have an owner/reviewer and are not forgotten.
1. Check new external PRs which do not have a reviewer. You can easily search for pull requests made by external contributors by using the label: `pr/external` in your [query search](https://github.com/grafana/grafana/pulls?q=is%3Aopen+is%3Apr+label%3Apr%2Fexternal) Note: external PRs are automatically labeled with `pr/external` upon creation.
2. Check if there is a link to an existing issue. The link to a existing issue should be in the description section, underneath “Which issue(s) does this PR fix?:”.
3. If not and you know which issue it is solving, add the link yourself, otherwise ask the author to link the issue or create one.
4. Assign a reviewer based on who was handling the linked issue or what code or feature does the PR touches (look at who was the last to make changes there if all else fails).
1. Check new external PRs which do not have a reviewer.
1. Check if there is a link to an existing issue.
1. If not and you know which issue it is solving, add the link yourself, otherwise ask the author to link the issue or create one.
1. Assign a reviewer based on who was handling the linked issue or what code or feature does the PR touches (look at who was the last to make changes there if all else fails).
## Appendix

View File

@@ -15,16 +15,12 @@ packages/grafana-e2e-selectors/
packages/grafana-runtime/
packages/grafana-toolkit/
packages/grafana-ui/
packages/jaeger-ui-components/
packaging/
kinds/
pkg/kinds/
pkg/kindsys/
pkg/registry/corekind/
pkg/coremodel/
pkg/framework/coremodel/
grafana-mixin/
public/app/plugins/datasource/tempo
public/app/features/explore/TraceView/components
public/img/icons/solid/
public/img/icons/unicons/
cue/
```
The following directories and their subdirectories are licensed under their original upstream licenses:

102
Makefile
View File

@@ -7,12 +7,12 @@ WIRE_TAGS = "oss"
-include local/Makefile
include .bingo/Variables.mk
.PHONY: all deps-go deps-js deps build-go build-backend build-server build-cli build-js build build-docker-full build-docker-full-ubuntu lint-go golangci-lint test-go test-js gen-ts test run run-frontend clean devenv devenv-down protobuf drone help gen-go gen-cue fix-cue
.PHONY: all deps-go deps-js deps build-go build-server build-cli build-js build build-docker-full build-docker-full-ubuntu lint-go golangci-lint test-go test-js gen-ts test run run-frontend clean devenv devenv-down protobuf drone help gen-go gen-cue
GO = go
GO_FILES ?= ./pkg/...
SH_FILES ?= $(shell find ./scripts -name *.sh)
GO_BUILD_FLAGS += $(if $(GO_BUILD_DEV),-dev)
API_DEFINITION_FILES = $(shell find ./pkg/api/docs/definitions -name '*.go' -print)
GO_BUILD_FLAGS += $(if $(GO_BUILD_DEV),-dev)
GO_BUILD_FLAGS += $(if $(GO_BUILD_TAGS),-build-tags=$(GO_BUILD_TAGS))
@@ -39,59 +39,38 @@ NGALERT_SPEC_TARGET = pkg/services/ngalert/api/tooling/api.json
$(NGALERT_SPEC_TARGET):
+$(MAKE) -C pkg/services/ngalert/api/tooling api.json
$(MERGED_SPEC_TARGET): $(SPEC_TARGET) $(NGALERT_SPEC_TARGET) $(SWAGGER) ## Merge generated and ngalert API specs
# known conflicts DsPermissionType, AddApiKeyCommand, Json, Duration (identical models referenced by both specs)
$(SWAGGER) mixin $(SPEC_TARGET) $(NGALERT_SPEC_TARGET) --ignore-conflicts -o $(MERGED_SPEC_TARGET)
$(MERGED_SPEC_TARGET): $(SPEC_TARGET) $(NGALERT_SPEC_TARGET) ## Merge generated and ngalert API specs
go run pkg/api/docs/merge/merge_specs.go -o=$(MERGED_SPEC_TARGET) $(<) $(NGALERT_SPEC_TARGET)
$(SPEC_TARGET): $(SWAGGER) ## Generate API Swagger specification
SWAGGER_GENERATE_EXTENSION=false $(SWAGGER) generate spec -m -w pkg/server -o $(SPEC_TARGET) \
--swagger-api-spec: $(API_DEFINITION_FILES) $(SWAGGER) ## Generate API Swagger specification
SWAGGER_GENERATE_EXTENSION=false $(SWAGGER) generate spec -m -w pkg/server -o public/api-spec.json \
-x "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions" \
-x "github.com/prometheus/alertmanager" \
-i pkg/api/swagger_tags.json \
--exclude-tag=alpha
-i pkg/api/docs/tags.json
swagger-api-spec: gen-go $(SPEC_TARGET) $(MERGED_SPEC_TARGET) validate-api-spec
swagger-api-spec: gen-go --swagger-api-spec $(MERGED_SPEC_TARGET) validate-api-spec
validate-api-spec: $(MERGED_SPEC_TARGET) $(SWAGGER) ## Validate API spec
$(SWAGGER) validate $(<)
clean-api-spec:
rm $(SPEC_TARGET) $(MERGED_SPEC_TARGET) $(OAPI_SPEC_TARGET)
##@ OpenAPI 3
OAPI_SPEC_TARGET = public/openapi3.json
openapi3-gen: swagger-api-spec ## Generates OpenApi 3 specs from the Swagger 2 already generated
$(GO) run scripts/openapi3/openapi3conv.go $(MERGED_SPEC_TARGET) $(OAPI_SPEC_TARGET)
rm $(SPEC_TARGET) $(MERGED_SPEC_TARGET)
##@ Building
gen-cue: ## Do all CUE/Thema code generation
@echo "generate code from .cue files"
go generate ./pkg/plugins/plugindef
go generate ./kinds/gen.go
go generate ./public/app/plugins/gen.go
go generate ./pkg/kindsys/report.go
go generate ./pkg/framework/coremodel
go generate ./public/app/plugins
gen-go: $(WIRE) gen-cue
@echo "generate go files"
$(WIRE) gen -tags $(WIRE_TAGS) ./pkg/server ./pkg/cmd/grafana-cli/runner
fix-cue: $(CUE)
@echo "formatting cue files"
$(CUE) fix kinds/**/*.cue
$(CUE) fix public/app/plugins/**/**/*.cue
gen-jsonnet:
go generate ./devenv/jsonnet
build-go: $(MERGED_SPEC_TARGET) gen-go ## Build all Go binaries.
@echo "build go files"
$(GO) run build.go $(GO_BUILD_FLAGS) build
build-backend: ## Build Grafana backend.
@echo "build backend"
$(GO) run build.go $(GO_BUILD_FLAGS) build-backend
build-server: ## Build Grafana server.
@echo "build server"
$(GO) run build.go $(GO_BUILD_FLAGS) build-server
@@ -115,30 +94,9 @@ run-frontend: deps-js ## Fetch js dependencies and watch frontend for rebuild
##@ Testing
.PHONY: test-go
test-go: test-go-unit test-go-integration
.PHONY: test-go-unit
test-go-unit: ## Run unit tests for backend with flags.
@echo "test backend unit tests"
$(GO) test -short -covermode=atomic -timeout=30m ./pkg/...
.PHONY: test-go-integration
test-go-integration: ## Run integration tests for backend with flags.
@echo "test backend integration tests"
$(GO) test -run Integration -covermode=atomic -timeout=30m ./pkg/...
.PHONY: test-go-integration-postgres
test-go-integration-postgres: devenv-postgres ## Run integration tests for postgres backend with flags.
@echo "test backend integration postgres tests"
$(GO) clean -testcache
$(GO) list './pkg/...' | xargs -I {} sh -c 'GRAFANA_TEST_DB=postgres go test -run Integration -covermode=atomic -timeout=2m {}'
.PHONY: test-go-integration-mysql
test-go-integration-mysql: devenv-mysql ## Run integration tests for mysql backend with flags.
@echo "test backend integration mysql tests"
$(GO) clean -testcache
$(GO) list './pkg/...' | xargs -I {} sh -c 'GRAFANA_TEST_DB=mysql go test -run Integration -covermode=atomic -timeout=2m {}'
test-go: ## Run tests for backend.
@echo "test backend"
$(GO) test -v ./pkg/...
test-js: ## Run tests for frontend.
@echo "test frontend"
@@ -150,7 +108,7 @@ test: test-go test-js ## Run all tests.
golangci-lint: $(GOLANGCI_LINT)
@echo "lint via golangci-lint"
$(GOLANGCI_LINT) run \
--config .golangci.toml \
--config ./conf/.golangci.toml \
$(GO_FILES)
lint-go: golangci-lint ## Run all code checks for backend. You can use GO_FILES to specify exact files to check
@@ -164,22 +122,17 @@ shellcheck: $(SH_FILES) ## Run checks for shell scripts.
build-docker-full: ## Build Docker image for development.
@echo "build docker container"
DOCKER_BUILDKIT=1 \
docker build \
--tag grafana/grafana:dev .
docker build --tag grafana/grafana:dev .
build-docker-full-ubuntu: ## Build Docker image based on Ubuntu for development.
@echo "build docker container"
DOCKER_BUILDKIT=1 \
docker build \
--build-arg BASE_IMAGE=ubuntu:20.04 \
--build-arg GO_IMAGE=golang:1.20.4 \
--tag grafana/grafana:dev-ubuntu .
docker build --tag grafana/grafana:dev-ubuntu -f ./Dockerfile.ubuntu .
##@ Services
# create docker-compose file with provided sources and start them
# example: make devenv sources=postgres,auth/openldap
# example: make devenv sources=postgres,openldap
ifeq ($(sources),)
devenv:
@printf 'You have to define sources for this command \nexample: make devenv sources=postgres,openldap\n'
@@ -200,14 +153,6 @@ devenv-down: ## Stop optional services.
test -f docker-compose.yaml && \
docker-compose down || exit 0;
devenv-postgres:
@cd devenv; \
sources=postgres_tests
devenv-mysql:
@cd devenv; \
sources=mysql_tests
##@ Helpers
# We separate the protobuf generation because most development tasks on
@@ -239,12 +184,5 @@ drone: $(DRONE)
$(DRONE) lint .drone.yml --trusted
$(DRONE) --server https://drone.grafana.net sign --save grafana/grafana
# Generate an Emacs tags table (https://www.gnu.org/software/emacs/manual/html_node/emacs/Tags-Tables.html) for Starlark files.
scripts/drone/TAGS: $(shell find scripts/drone -name '*.star')
etags --lang none --regex="/def \(\w+\)[^:]+:/\1/" --regex="/\s*\(\w+\) =/\1/" $^ -o $@
format-drone:
buildifier -r scripts/drone
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

33
PLUGIN_DEV.md Normal file
View File

@@ -0,0 +1,33 @@
# Plugin development
This document is not meant as a complete guide for developing plugins but more as a changelog for changes in
Grafana that can impact plugin development. Whenever you as a plugin author encounter an issue with your plugin after
upgrading Grafana please check here before creating an issue.
## Plugin development resources
- [Grafana plugin developer guide](https://grafana.com/docs/grafana/latest/developers/plugins/)
- [Webpack Grafana plugin template project](https://github.com/CorpGlory/grafana-plugin-template-webpack)
- [Simple JSON datasource plugin](https://github.com/grafana/simple-json-datasource)
## Changes in Grafana v4.6
This version of Grafana has big changes that will impact a limited set of plugins. We moved from systemjs to webpack
for built-in plugins and everything internal. External plugins still use systemjs but now with a limited
set of Grafana components they can import. Plugins can depend on libs like lodash & moment and internal components
like before using the same import paths. However since everything in Grafana is no longer accessible, a few plugins could encounter issues when importing a Grafana dependency.
[List of exposed components plugins can import/require](https://github.com/grafana/grafana/blob/main/public/app/features/plugins/plugin_loader.ts#L48)
If you think we missed exposing a crucial lib or Grafana component let us know by opening an issue.
### Deprecated components
The angular directive `<spectrum-picker>` is now deprecated (will still work for a version more) but we recommend plugin authors
upgrade to new `<color-picker color="ctrl.color" onChange="ctrl.onSparklineColorChange"></color-picker>`
## Changes in Grafana v6.0
### DashboardSrv.ts
If you utilize [DashboardSrv](https://github.com/grafana/grafana/commit/8574dca081002f36e482b572517d8f05fd44453f#diff-1ab99561f9f6a10e1fafcddc39bc1d65) in your plugin code, `dash` was renamed to `dashboard`.

View File

@@ -18,7 +18,7 @@ Grafana allows you to query, visualize, alert on and understand your metrics no
## Get started
- [Get Grafana](https://grafana.com/get)
- [Installation guides](https://grafana.com/docs/grafana/latest/setup-grafana/installation/)
- [Installation guides](http://docs.grafana.org/installation/)
Unsure if Grafana is for you? Watch Grafana in action on [play.grafana.org](https://play.grafana.org/)!

View File

@@ -14,6 +14,7 @@ Grafana Labs will send you a response indicating the next steps in handling your
## Security announcements
We will post a summary, remediation, and mitigation details for any patch containing security fixes on the Grafana blog. The security announcement blog posts will be tagged with the [security tag](https://grafana.com/tags/security/).
We maintain a category on the community site called [Security Announcements](https://community.grafana.com/c/support/security-announcements),
where we will post a summary, remediation, and mitigation details for any patch containing security fixes.
You can also track security announcements via the [RSS feed](https://grafana.com/tags/security/index.xml).
You can also subscribe to email updates to this category if you have a grafana.com account and sign on to the community site or track updates via an [RSS feed](https://community.grafana.com/c/support/security-announcements.rss).

38
api-extractor.json Normal file
View File

@@ -0,0 +1,38 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "<projectFolder>/dist/index.d.ts",
"bundledPackages": [],
"compiler": {},
"apiReport": {
"enabled": false
},
"docModel": {
"enabled": true,
"apiJsonFilePath": "<projectFolder>/../../reports/docs/<unscopedPackageName>.api.json"
},
"dtsRollup": {
"enabled": false
},
"tsdocMetadata": {},
"messages": {
"compilerMessageReporting": {
"default": {
"logLevel": "warning"
}
},
"extractorMessageReporting": {
"default": {
"logLevel": "warning"
},
"ae-internal-missing-underscore": {
"logLevel": "none",
"addToApiReportFile": false
}
},
"tsdocMessageReporting": {
"default": {
"logLevel": "warning"
}
}
}
}

134
conf/.golangci.toml Normal file
View File

@@ -0,0 +1,134 @@
[run]
timeout = "10m"
[linters-settings.goconst]
min-len = 5
min-occurrences = 5
[linters-settings.exhaustive]
default-signifies-exhaustive = true
[linters-settings.revive]
ignore-generated-header = false
severity = "warning"
confidence = 3
[linters-settings.gocritic]
enabled-checks = ["ruleguard"]
[linters-settings.gocritic.settings.ruleguard]
rules = "pkg/ruleguard.rules.go"
[linters]
disable-all = true
enable = [
"bodyclose",
"deadcode",
"depguard",
"dogsled",
"errcheck",
# "gochecknoinits",
"goconst",
"gocritic",
"goimports",
"goprintffuncname",
"gosec",
"gosimple",
"govet",
"ineffassign",
"misspell",
"nakedret",
"rowserrcheck",
"exportloopref",
"staticcheck",
"structcheck",
"stylecheck",
"typecheck",
"unconvert",
"unused",
"varcheck",
"whitespace",
"gocyclo",
"exhaustive",
"typecheck",
"asciicheck",
"errorlint",
"sqlclosecheck",
"revive",
]
# Disabled linters (might want them later)
# "unparam"
[issues]
exclude-use-default = false
# Enable when appropriate
# Poorly chosen identifier
[[issues.exclude-rules]]
linters = ["stylecheck"]
text = "ST1003"
# Enable when appropriate
# Dot imports that aren't in external test packages are discouraged.
[[issues.exclude-rules]]
linters = ["stylecheck"]
text = "ST1001"
[[issues.exclude-rules]]
linters = ["gosec"]
text = "G108"
[[issues.exclude-rules]]
linters = ["gosec"]
text = "G110"
[[issues.exclude-rules]]
linters = ["gosec"]
text = "G201"
[[issues.exclude-rules]]
linters = ["gosec"]
text = "G202"
[[issues.exclude-rules]]
linters = ["gosec"]
text = "G306"
[[issues.exclude-rules]]
linters = ["gosec"]
text = "401"
[[issues.exclude-rules]]
linters = ["gosec"]
text = "402"
[[issues.exclude-rules]]
linters = ["gosec"]
text = "501"
[[issues.exclude-rules]]
linters = ["gosec"]
text = "404"
[[issues.exclude-rules]]
linters = ["misspell"]
text = "Unknwon` is a misspelling of `Unknown"
[[issues.exclude-rules]]
linters = ["errorlint"]
text = "non-wrapping format verb for fmt.Errorf"
# TODO: Enable
[[issues.exclude-rules]]
linters = ["stylecheck"]
text = "ST1000"
# TODO: Enable
[[issues.exclude-rules]]
linters = ["stylecheck"]
text = "ST1020"
# TODO: Enable
[[issues.exclude-rules]]
linters = ["stylecheck"]
text = "ST1021"

View File

@@ -66,15 +66,6 @@ enable_gzip = false
cert_file =
cert_key =
# Unix socket gid
# Changing the gid of a file without privileges requires that the target group is in the group of the process and that the process is the file owner
# It is recommended to set the gid as http server user gid
# Not set when the value is -1
socket_gid = -1
# Unix socket mode
socket_mode = 0660
# Unix socket path
socket = /tmp/grafana.sock
@@ -85,11 +76,6 @@ cdn_url =
# `0` means there is no timeout for reading the request.
read_timeout = 0
# This setting enables you to specify additional headers that the server adds to HTTP(S) responses.
[server.custom_response_headers]
#exampleHeader1 = exampleValue1
#exampleHeader2 = exampleValue2
#################################### Database ############################
[database]
# You can configure the database connection by specifying type, host, name, user and password
@@ -139,18 +125,9 @@ path = grafana.db
# For "sqlite3" only. cache mode setting used for connecting to the database
cache_mode = private
# For "sqlite3" only. Enable/disable Write-Ahead Logging, https://sqlite.org/wal.html. Default is false.
wal = false
# For "mysql" only if migrationLocking feature toggle is set. How many seconds to wait before failing to lock the database for the migrations, default is 0.
# For "mysql" only if lockingMigration feature toggle is set. How many seconds to wait before failing to lock the database for the migrations, default is 0.
locking_attempt_timeout_sec = 0
# For "sqlite" only. How many times to retry query in case of database is locked failures. Default is 0 (disabled).
query_retries = 0
# For "sqlite" only. How many times to retry transaction in case of database is locked failures. Default is 5.
transaction_retries = 5
#################################### Cache server #############################
[remote_cache]
# Either "redis", "memcached" or "database" default is "database"
@@ -162,12 +139,6 @@ type = database
# memcache: 127.0.0.1:11211
connstr =
# prefix prepended to all the keys in the remote cache
prefix =
# This enables encryption of values stored in the remote cache
encryption =
#################################### Data proxy ###########################
[dataproxy]
@@ -241,12 +212,6 @@ check_for_plugin_updates = true
# Google Analytics universal tracking code, only enabled if you specify an id here
google_analytics_ua_id =
# Google Analytics 4 tracking code, only enabled if you specify an id here
google_analytics_4_id =
# When Google Analytics 4 Enhanced event measurement is enabled, we will try to avoid sending duplicate events and let Google Analytics 4 detect navigation changes, etc.
google_analytics_4_send_manual_page_views = false
# Google Tag Manager ID, only enabled if you specify an id here
google_tag_manager_id =
@@ -262,9 +227,6 @@ rudderstack_sdk_url =
# Rudderstack Config url, optional, used by Rudderstack SDK to fetch source config
rudderstack_config_url =
# Intercom secret, optional, used to hash user_id before passing to Intercom via Rudderstack
intercom_secret =
# Application Insights connection string. Specify an URL string to enable this feature.
application_insights_connection_string =
@@ -285,9 +247,6 @@ admin_user = admin
# default admin password, can be changed before first start of grafana, or in profile settings
admin_password = admin
# default admin email, created on startup
admin_email = admin@localhost
# used for signing
secret_key = SW2YcwTIb9zpOOhoPsMm
@@ -346,15 +305,6 @@ content_security_policy = false
# $ROOT_PATH is server.root_url without the protocol.
content_security_policy_template = """script-src 'self' 'unsafe-eval' 'unsafe-inline' 'strict-dynamic' $NONCE;object-src 'none';font-src 'self';style-src 'self' 'unsafe-inline' blob:;img-src * data:;base-uri 'self';connect-src 'self' grafana.com ws://$ROOT_PATH wss://$ROOT_PATH;manifest-src 'self';media-src 'none';form-action 'self';"""
# Enable adding the Content-Security-Policy-Report-Only header to your requests.
# Allows you to monitor the effects of a policy without enforcing it.
content_security_policy_report_only = false
# Set Content Security Policy Report Only template used when adding the Content-Security-Policy-Report-Only header to your requests.
# $NONCE in the template includes a random nonce.
# $ROOT_PATH is server.root_url without the protocol.
content_security_policy_report_only_template = """script-src 'self' 'unsafe-eval' 'unsafe-inline' 'strict-dynamic' $NONCE;object-src 'none';font-src 'self';style-src 'self' 'unsafe-inline' blob:;img-src * data:;base-uri 'self';connect-src 'self' grafana.com ws://$ROOT_PATH wss://$ROOT_PATH;manifest-src 'self';media-src 'none';form-action 'self';"""
# Controls if old angular plugins are supported or not. This will be disabled by default in future release
angular_support_enabled = true
@@ -369,9 +319,6 @@ data_keys_cache_cleanup_interval = 1m
#################################### Snapshots ###########################
[snapshots]
# set to false to remove snapshot functionality
enabled = true
# snapshot sharing options
external_enabled = true
external_snapshot_url = https://snapshots.raintank.io
@@ -426,11 +373,11 @@ verify_email_enabled = false
login_hint = email or username
password_hint = password
# Default UI theme ("dark" or "light" or "system")
# Default UI theme ("dark" or "light")
default_theme = dark
# Default UI language (supported IETF language tag, such as en-US)
default_language = en-US
# Default locale (supported IETF language tag, such as en-US)
default_locale = en-US
# Path to a custom home page. Users are only redirected to this if the default home dashboard is used. It should match a frontend route and contain a leading slash.
home_page =
@@ -452,17 +399,10 @@ user_invite_max_lifetime_duration = 24h
# Enter a comma-separated list of usernames to hide them in the Grafana UI. These users are shown to Grafana admins and to themselves.
hidden_users =
[service_accounts]
# When set, Grafana will not allow the creation of tokens with expiry greater than this setting.
token_expiration_day_limit =
[auth]
# Login cookie name
login_cookie_name = grafana_session
# Disable usage of Grafana build-in login solution.
disable_login = false
# The maximum lifetime (duration) an authenticated user can be inactive before being required to login at next visit. Default is 7 days (7d). This setting should be expressed as a duration, e.g. 5m (minutes), 6h (hours), 10d (days), 2w (weeks), 1M (month). The lifetime resets at each successful token rotation (token_rotation_interval_minutes).
login_maximum_inactive_lifetime_duration =
@@ -483,7 +423,6 @@ signout_redirect_url =
# Set to true to attempt login with OAuth automatically, skipping the login screen.
# This setting is ignored if multiple OAuth providers are configured.
# Deprecated, use auto_login option for specific provider instead.
oauth_auto_login = false
# OAuth state max age cookie duration in seconds. Defaults to 600 seconds.
@@ -501,9 +440,6 @@ sigv4_auth_enabled = false
# Set to true to enable verbose logging of SigV4 request signing
sigv4_verbose_logging = false
# Set to true to enable Azure authentication option for HTTP-based datasources
azure_auth_enabled = false
#################################### Anonymous Auth ######################
[auth.anonymous]
# enable anonymous access
@@ -522,7 +458,6 @@ hide_version = false
[auth.github]
enabled = false
allow_sign_up = true
auto_login = false
client_id = some_id
client_secret =
scopes = user:email,read:org
@@ -532,15 +467,11 @@ api_url = https://api.github.com/user
allowed_domains =
team_ids =
allowed_organizations =
role_attribute_path =
role_attribute_strict = false
allow_assign_grafana_admin = false
#################################### GitLab Auth #########################
[auth.gitlab]
enabled = false
allow_sign_up = true
auto_login = false
client_id = some_id
client_secret =
scopes = api
@@ -551,14 +482,11 @@ allowed_domains =
allowed_groups =
role_attribute_path =
role_attribute_strict = false
allow_assign_grafana_admin = false
skip_org_role_sync = false
#################################### Google Auth #########################
[auth.google]
enabled = false
allow_sign_up = true
auto_login = false
client_id = some_client_id
client_secret =
scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
@@ -567,7 +495,6 @@ token_url = https://accounts.google.com/o/oauth2/token
api_url = https://www.googleapis.com/oauth2/v1/userinfo
allowed_domains =
hosted_domain =
skip_org_role_sync = false
#################################### Grafana.com Auth ####################
# legacy key names (so they work in env variables)
@@ -582,19 +509,16 @@ allowed_organizations =
[auth.grafana_com]
enabled = false
allow_sign_up = true
auto_login = false
client_id = some_id
client_secret =
scopes = user:email
allowed_organizations =
skip_org_role_sync = false
#################################### Azure AD OAuth #######################
[auth.azuread]
name = Azure AD
enabled = false
allow_sign_up = true
auto_login = false
client_id = some_client_id
client_secret =
scopes = openid email profile
@@ -603,8 +527,6 @@ token_url = https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token
allowed_domains =
allowed_groups =
role_attribute_strict = false
allow_assign_grafana_admin = false
force_use_graph_api = false
#################################### Okta OAuth #######################
[auth.okta]
@@ -612,7 +534,6 @@ name = Okta
icon = okta
enabled = false
allow_sign_up = true
auto_login = false
client_id = some_id
client_secret =
scopes = openid profile email groups
@@ -623,8 +544,6 @@ allowed_domains =
allowed_groups =
role_attribute_path =
role_attribute_strict = false
allow_assign_grafana_admin = false
skip_org_role_sync = false
#################################### Generic OAuth #######################
[auth.generic_oauth]
@@ -632,7 +551,6 @@ name = OAuth
icon = signin
enabled = false
allow_sign_up = true
auto_login = false
client_id = some_id
client_secret =
scopes = user:email
@@ -658,8 +576,7 @@ tls_client_cert =
tls_client_key =
tls_client_ca =
use_pkce = false
auth_style =
allow_assign_grafana_admin = false
auth_style =
#################################### Basic Auth ##########################
[auth.basic]
@@ -680,28 +597,21 @@ enable_login_token = false
#################################### Auth JWT ##########################
[auth.jwt]
enabled = false
enable_login_token = false
header_name =
email_claim =
username_claim =
jwk_set_url =
jwk_set_file =
cache_ttl = 60m
expect_claims = {}
expected_claims = {}
key_file =
role_attribute_path =
role_attribute_strict = false
auto_sign_up = false
url_login = false
allow_assign_grafana_admin = false
skip_org_role_sync = false
#################################### Auth LDAP ###########################
[auth.ldap]
enabled = false
config_file = /etc/grafana/ldap.toml
allow_sign_up = true
skip_org_role_sync = false
# LDAP background sync (Enterprise only)
# At 1 am every day
@@ -739,13 +649,10 @@ managed_identity_client_id =
#################################### Role-based Access Control ###########
[rbac]
# If enabled, cache permissions in a in memory cache
enabled = true
# If enabled, cache permissions in a in memory cache (Enterprise only)
permission_cache = true
# Reset basic roles permissions on boot
# Warning left to true, basic roles permissions will be reset on every boot
reset_basic_roles = false
#################################### SMTP / Emailing #####################
[smtp]
enabled = false
@@ -855,7 +762,7 @@ instrumentations_console_enabled = false
instrumentations_webvitals_enabled = false
# Api Key, only applies to Grafana Javascript Agent provider
api_key =
api_key =
#################################### Usage Quotas ########################
[quota]
@@ -898,9 +805,6 @@ global_session = -1
# global limit of alerts
global_alert_rule = -1
# global limit of files uploaded to the SQL DB
global_file = 1000
#################################### Unified Alerting ####################
[unified_alerting]
# Enable the Unified Alerting sub-system and interface. When enabled we'll migrate all of your alert rules and notification channels to the new system. New alert rules will be created and your notification channels will be converted into an Alertmanager configuration. Previous data is preserved to enable backwards compatibility but new data is removed when switching. When this configuration section and flag are not defined, the state is defined at runtime. See the documentation for more details.
@@ -957,17 +861,10 @@ max_attempts = 3
min_interval = 10s
[unified_alerting.screenshots]
# Enable screenshots in notifications. You must have either installed the Grafana image rendering
# plugin, or set up Grafana to use a remote rendering service.
# For more information on configuration options, refer to [rendering].
# Enable screenshots in notifications. This option requires a remote HTTP image rendering service. Please
# see [rendering] for further configuration options.
capture = false
# The timeout for capturing screenshots. If a screenshot cannot be captured within the timeout then
# the notification is sent without a screenshot. The maximum duration is 30 seconds. This timeout
# should be less than the minimum Interval of all Evaluation Groups to avoid back pressure on alert
# rule evaluation.
capture_timeout = 10s
# The maximum number of screenshots that can be taken at the same time. This option is different from
# concurrent_render_request_limit as max_concurrent_screenshots sets the number of concurrent screenshots
# that can be taken at the same time for all firing alerts where as concurrent_render_request_limit sets
@@ -979,15 +876,6 @@ max_concurrent_screenshots = 5
# screenshots will be persisted to disk for up to temp_data_lifetime.
upload_external_image_storage = false
[unified_alerting.reserved_labels]
# Comma-separated list of reserved labels added by the Grafana Alerting engine that should be disabled.
# For example: `disabled_labels=grafana_folder`
disabled_labels =
[unified_alerting.state_history]
# Enable the state history functionality in Unified Alerting. The previous states of alert rules will be visible in panels and in the UI.
enabled = true
#################################### Alerting ############################
[alerting]
# Enable the legacy alerting sub-system and interface. If Unified Alerting is already enabled and you try to go back to legacy alerting, all data that is part of Unified Alerting will be deleted. When this configuration section and flag are not defined, the state is defined at runtime. See the documentation for more details.
@@ -1030,10 +918,6 @@ max_annotations_to_keep =
# Configures the batch size for the annotation clean-up job. This setting is used for dashboard, API, and alert annotations.
cleanupjob_batchsize = 100
# Enforces the maximum allowed length of the tags for any newly introduced annotations. It can be between 500 and 4096 inclusive (which is the respective's column length). Default value is 500.
# Setting it to a higher value would impact performance therefore is not recommended.
tags_length = 500
[annotations.dashboard]
# Dashboard annotations means that annotations are associated with the dashboard they are created on.
@@ -1105,7 +989,6 @@ url = https://grafana.com
[grafana_com]
url = https://grafana.com
api_url = https://grafana.com/api
#################################### Distributed tracing ############
# Opentracing is deprecated use opentelemetry instead
@@ -1132,11 +1015,6 @@ zipkin_propagation = false
# Not disabling is the most common setting when using Zipkin elsewhere in your infrastructure.
disable_shared_zipkin_spans = false
[tracing.opentelemetry]
# attributes that will always be included in when creating new spans. ex (key1:value1,key2:value2)
custom_attributes =
[tracing.opentelemetry.jaeger]
# jaeger destination (ex http://localhost:14268/api/traces)
address =
@@ -1183,7 +1061,6 @@ signed_url_expiration =
account_name =
account_key =
container_name =
sas_token_expiration_days =
[external_image_storage.local]
# does not require any configuration
@@ -1194,16 +1071,9 @@ sas_token_expiration_days =
server_url =
# If the remote HTTP image renderer service runs on a different server than the Grafana server you may have to configure this to a URL where Grafana is reachable, e.g. http://grafana.domain/.
callback_url =
# An auth token that will be sent to and verified by the renderer. The renderer will deny any request without an auth token matching the one configured on the renderer side.
renderer_token = -
# Concurrent render request limit affects when the /render HTTP endpoint is used. Rendering many images at the same time can overload the server,
# which this setting can help protect against by only allowing a certain amount of concurrent requests.
concurrent_render_request_limit = 30
# Determines the lifetime of the render key used by the image renderer to access and render Grafana.
# This setting should be expressed as a duration. Examples: 10s (seconds), 5m (minutes), 2h (hours).
# Default is 5m. This should be more than enough for most deployments.
# Change the value only if image rendering is failing and you see `Failed to get the render key from cache` in Grafana logs.
render_key_lifetime = 5m
[panels]
# here for to support old env variables, can remove after a few months
@@ -1318,10 +1188,20 @@ license_path =
# enable = feature1,feature2
enable =
# Some features are enabled by default, see:
# https://grafana.com/docs/grafana/next/setup-grafana/configure-grafana/feature-toggles/
# To enable features by default, set `Expression: "true"` in:
# https://github.com/grafana/grafana/blob/main/pkg/services/featuremgmt/registry.go
# The new prometheus visual query builder
promQueryBuilder = true
# The new loki visual query builder
lokiQueryBuilder = true
# Experimental Explore to Dashboard workflow
explore2Dashboard = true
# Experimental Command Palette
commandPalette = true
# Use dynamic labels in CloudWatch datasource
cloudWatchDynamicLabels = true
# feature1 = true
# feature2 = false
@@ -1375,47 +1255,3 @@ max_crawl_duration =
# Minimum interval between two subsequent scheduler runs. Default is 12h.
# This setting should be expressed as a duration. Examples: 10s (seconds), 1m (minutes).
scheduler_interval =
#################################### Storage ################################################
[storage]
# Allow uploading SVG files without sanitization.
allow_unsanitized_svg_upload = false
#################################### Search ################################################
[search]
# Defines the number of dashboards loaded at once in a batch during a full reindex.
# This is a temporary settings that might be removed in the future.
dashboard_loading_batch_size = 200
# Defines the frequency of a full search reindex.
# This is a temporary settings that might be removed in the future.
full_reindex_interval = 5m
# Defines the frequency of partial index updates based on recent changes such as dashboard updates.
# This is a temporary settings that might be removed in the future.
index_update_interval = 10s
# Move an app plugin referenced by its id (including all its pages) to a specific navigation section
# Dependencies: needs the `topnav` feature to be enabled
# Format: <Plugin ID> = <Section ID> <Sort Weight>
[navigation.app_sections]
# Move a specific app plugin page (referenced by its `path` field) to a specific navigation section
# Format: <Page URL> = <Section ID> <Sort Weight>
[navigation.app_standalone_pages]
#################################### Secure Socks5 Datasource Proxy #####################################
[secure_socks_datasource_proxy]
enabled = false
root_ca_cert =
client_key =
client_cert =
server_name =
# The address of the socks5 proxy datasources should connect to
proxy_address =

View File

@@ -24,11 +24,6 @@ bind_dn = "cn=admin,dc=grafana,dc=org"
# Search user bind password
# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""
bind_password = 'grafana'
# We recommend using variable expansion for the bind_password, for more info https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#variable-expansion
# bind_password = '$__env{LDAP_BIND_PASSWORD}'
# Timeout in seconds (applies to each host specified in the 'host' entry (space separated))
timeout = 10
# User search filter, for example "(cn=%s)" or "(sAMAccountName=%s)" or "(uid=%s)"
search_filter = "(cn=%s)"
@@ -60,7 +55,7 @@ org_role = "Admin"
# org_id = 1
[[servers.group_mappings]]
group_dn = "cn=editors,ou=groups,dc=grafana,dc=org"
group_dn = "cn=users,ou=groups,dc=grafana,dc=org"
org_role = "Editor"
[[servers.group_mappings]]

View File

@@ -19,9 +19,9 @@
# # <string, required> action allowed.
# - action: 'users:read'
# #<string> scope it applies to.
# scope: 'global.users:*'
# scope: 'users:*'
# - action: 'users:write'
# scope: 'global.users:*'
# scope: 'users:*'
# - action: 'users:create'
# - name: 'custom:global:users:reader'
# # <bool> overwrite org id and creates a global role.
@@ -42,9 +42,9 @@
# # <list> list of the permissions to add/remove on top of the copied ones.
# permissions:
# - action: 'users:read'
# scope: 'global.users:*'
# scope: 'users:*'
# - action: 'users:write'
# scope: 'global.users:*'
# scope: 'users:*'
# # <string> state of the permission. Defaults to 'present'. If 'absent', the permission will be removed.
# state: absent

View File

@@ -1,188 +0,0 @@
# # config file version
apiVersion: 1
# # List of rule groups to import or update
# groups:
# # <int> organization ID, default = 1
# - orgId: 1
# # <string, required> name of the rule group
# name: my_rule_group
# # <string, required> name of the folder the rule group will be stored in
# folder: my_first_folder
# # <duration, required> interval of the rule group evaluation
# interval: 60s
# # <list, required> list of rules that are part of the rule group
# rules:
# # <string, required> unique identifier for the rule
# - uid: my_id_1
# # <string, required> title of the rule, will be displayed in the UI
# title: my_first_rule
# # <string, required> query used for the condition
# condition: A
# # <list, required> list of query objects that should be executed on each
# # evaluation - should be obtained via the API
# data:
# - refId: A
# datasourceUid: "__expr__"
# model:
# conditions:
# - evaluator:
# params:
# - 3
# type: gt
# operator:
# type: and
# query:
# params:
# - A
# reducer:
# type: last
# type: query
# datasource:
# type: __expr__
# uid: "__expr__"
# expression: 1==0
# intervalMs: 1000
# maxDataPoints: 43200
# refId: A
# type: math
# # <string> UID of a dashboard that the alert rule should be linked to
# dashboardUid: my_dashboard
# # <int> ID of the panel that the alert rule should be linked to
# panelId: 123
# # <string> state of the alert rule when no data is returned
# # possible values: "NoData", "Alerting", "OK", default = NoData
# noDataState: Alerting
# # <string> state of the alert rule when the query execution
# # fails - possible values: "Error", "Alerting", "OK"
# # default = Alerting
# executionErrorState: Alerting
# # <duration, required> how long the alert condition should be breached before Firing. Before this time has elapsed, the alert is considered to be Pending
# for: 60s
# # <map<string, string>> map of strings to attach arbitrary custom data
# annotations:
# some_key: some_value
# # <map<string, string> map of strings to filter and
# # route alerts
# labels:
# team: sre_team_1
# isPaused: false
# # List of alert rule UIDs that should be deleted
# deleteRules:
# # <int> organization ID, default = 1
# - orgId: 1
# # <string, required> unique identifier for the rule
# uid: my_id_1
# # List of contact points to import or update
# contactPoints:
# # <int> organization ID, default = 1
# - orgId: 1
# # <string, required> name of the contact point
# name: cp_1
# receivers:
# # <string, required> unique identifier for the receiver
# - uid: first_uid
# # <string, required> type of the receiver
# type: prometheus-alertmanager
# # <object, required> settings for the specific receiver type
# settings:
# url: http://test:9000
# # List of receivers that should be deleted
# deleteContactPoints:
# - orgId: 1
# uid: first_uid
# # List of notification policies to import or update
# policies:
# # <int> organization ID, default = 1
# - orgId: 1
# # <string> name of the receiver that should be used for this route
# receiver: grafana-default-email
# # <list<string>> The labels by which incoming alerts are grouped together. For example,
# # multiple alerts coming in for cluster=A and alertname=LatencyHigh would
# # be batched into a single group.
# #
# # To aggregate by all possible labels, use the special value '...' as
# # the sole label name, for example:
# # group_by: ['...']
# # This effectively disables aggregation entirely, passing through all
# # alerts as-is. This is unlikely to be what you want, unless you have
# # a very low alert volume or your upstream notification system performs
# # its own grouping.
# group_by:
# - grafana_folder
# - alertname
# # <list> a list of matchers that an alert has to fulfill to match the node
# matchers:
# - alertname = Watchdog
# - severity =~ "warning|critical"
# # <list> Times when the route should be muted. These must match the name of a
# # mute time interval.
# # Additionally, the root node cannot have any mute times.
# # When a route is muted it will not send any notifications, but
# # otherwise acts normally (including ending the route-matching process
# # if the `continue` option is not set)
# mute_time_intervals:
# - abc
# # <duration> How long to initially wait to send a notification for a group
# # of alerts. Allows to collect more initial alerts for the same group.
# # (Usually ~0s to few minutes), default = 30s
# group_wait: 30s
# # <duration> How long to wait before sending a notification about new alerts that
# # are added to a group of alerts for which an initial notification has
# # already been sent. (Usually ~5m or more), default = 5m
# group_interval: 5m
# # <duration> How long to wait before sending a notification again if it has already
# # been sent successfully for an alert. (Usually ~3h or more), default = 4h
# repeat_interval: 4h
# # <list> Zero or more child routes
# routes:
# ...
# # List of orgIds that should be reset to the default policy
# resetPolicies:
# - 1
# # List of templates to import or update
# templates:
# # <int> organization ID, default = 1
# - orgID: 1
# # <string, required> name of the template, must be unique
# name: my_first_template
# # <string, required> content of the the template
# template: Alerting with a custome text template
# # List of templates that should be deleted
# deleteTemplates:
# # <int> organization ID, default = 1
# - orgId: 1
# # <string, required> name of the template, must be unique
# name: my_first_template
# # List of mute time intervals to import or update
# muteTimes:
# # <int> organization ID, default = 1
# - orgId: 1
# # <string, required> name of the mute time interval, must be unique
# name: mti_1
# # <list> time intervals that should trigger the muting
# refer to https://prometheus.io/docs/alerting/latest/configuration/#time_interval-0
# time_intervals:
# - times:
# - start_time: '06:00'
# end_time: '23:59'
# weekdays: ['monday:wednesday','saturday', 'sunday']
# months: ['1:3', 'may:august', 'december']
# years: ['2020:2022', '2030']
# days_of_month: ['1:5', '-3:-1']
# # List of mute time intervals that should be deleted
# deleteMuteTimes:
# # <int> organization ID, default = 1
# - orgId: 1
# # <string, required> name of the mute time interval, must be unique
# name: mti_1

View File

@@ -67,15 +67,6 @@
;cert_file =
;cert_key =
# Unix socket gid
# Changing the gid of a file without privileges requires that the target group is in the group of the process and that the process is the file owner
# It is recommended to set the gid as http server user gid
# Not set when the value is -1
;socket_gid =
# Unix socket mode
;socket_mode =
# Unix socket path
;socket =
@@ -86,11 +77,6 @@
# `0` means there is no timeout for reading the request.
;read_timeout = 0
# This setting enables you to specify additional headers that the server adds to HTTP(S) responses.
[server.custom_response_headers]
#exampleHeader1 = exampleValue1
#exampleHeader2 = exampleValue2
#################################### Database ####################################
[database]
# You can configure the database connection by specifying type, host, name, user and password
@@ -108,8 +94,7 @@
# Example: mysql://user:secret@host:port/database
;url =
# For "postgres", use either "disable", "require" or "verify-full"
# For "mysql", use either "true", "false", or "skip-verify".
# For "postgres" only, either "disable", "require" or "verify-full"
;ssl_mode = disable
# Database drivers may support different transaction isolation levels.
@@ -141,18 +126,9 @@
# For "sqlite3" only. cache mode setting used for connecting to the database. (private, shared)
;cache_mode = private
# For "sqlite3" only. Enable/disable Write-Ahead Logging, https://sqlite.org/wal.html. Default is false.
;wal = false
# For "mysql" only if migrationLocking feature toggle is set. How many seconds to wait before failing to lock the database for the migrations, default is 0.
# For "mysql" only if lockingMigration feature toggle is set. How many seconds to wait before failing to lock the database for the migrations, default is 0.
;locking_attempt_timeout_sec = 0
# For "sqlite" only. How many times to retry query in case of database is locked failures. Default is 0 (disabled).
;query_retries = 0
# For "sqlite" only. How many times to retry transaction in case of database is locked failures. Default is 5.
;transaction_retries = 5
################################### Data sources #########################
[datasources]
# Upper limit of data sources that Grafana will return. This limit is a temporary configuration and it will be deprecated when pagination will be introduced on the list data sources API.
@@ -169,12 +145,6 @@
# memcache: 127.0.0.1:11211
;connstr =
# prefix prepended to all the keys in the remote cache
; prefix =
# This enables encryption of values stored in the remote cache
;encryption =
#################################### Data proxy ###########################
[dataproxy]
@@ -248,12 +218,6 @@
# Google Analytics universal tracking code, only enabled if you specify an id here
;google_analytics_ua_id =
# Google Analytics 4 tracking code, only enabled if you specify an id here
;google_analytics_4_id =
# When Google Analytics 4 Enhanced event measurement is enabled, we will try to avoid sending duplicate events and let Google Analytics 4 detect navigation changes, etc.
;google_analytics_4_send_manual_page_views = false
# Google Tag Manager ID, only enabled if you specify an id here
;google_tag_manager_id =
@@ -269,9 +233,6 @@
# Rudderstack Config url, optional, used by Rudderstack SDK to fetch source config
;rudderstack_config_url =
# Intercom secret, optional, used to hash user_id before passing to Intercom via Rudderstack
;intercom_secret =
# Controls if the UI contains any links to user feedback forms
;feedback_links_enabled = true
@@ -286,9 +247,6 @@
# default admin password, can be changed before first start of grafana, or in profile settings
;admin_password = admin
# default admin email, created on startup
;admin_email = admin@localhost
# used for signing
;secret_key = SW2YcwTIb9zpOOhoPsMm
@@ -347,14 +305,6 @@
# $ROOT_PATH is server.root_url without the protocol.
;content_security_policy_template = """script-src 'self' 'unsafe-eval' 'unsafe-inline' 'strict-dynamic' $NONCE;object-src 'none';font-src 'self';style-src 'self' 'unsafe-inline' blob:;img-src * data:;base-uri 'self';connect-src 'self' grafana.com ws://$ROOT_PATH wss://$ROOT_PATH;manifest-src 'self';media-src 'none';form-action 'self';"""
# Enable adding the Content-Security-Policy-Report-Only header to your requests.
# Allows you to monitor the effects of a policy without enforcing it.
;content_security_policy_report_only = false
# Set Content Security Policy Report Only template used when adding the Content-Security-Policy-Report-Only header to your requests.
# $NONCE in the template includes a random nonce.
# $ROOT_PATH is server.root_url without the protocol.
;content_security_policy_report_only_template = """script-src 'self' 'unsafe-eval' 'unsafe-inline' 'strict-dynamic' $NONCE;object-src 'none';font-src 'self';style-src 'self' 'unsafe-inline' blob:;img-src * data:;base-uri 'self';connect-src 'self' grafana.com ws://$ROOT_PATH wss://$ROOT_PATH;manifest-src 'self';media-src 'none';form-action 'self';"""
# Controls if old angular plugins are supported or not. This will be disabled by default in future release
;angular_support_enabled = true
@@ -375,9 +325,6 @@
#################################### Snapshots ###########################
[snapshots]
# set to false to remove snapshot functionality
;enabled = true
# snapshot sharing options
;external_enabled = true
;external_snapshot_url = https://snapshots.raintank.io
@@ -416,7 +363,7 @@
# Set this value to automatically add new users to the provided organization (if auto_assign_org above is set to true)
;auto_assign_org_id = 1
# Default role new users will be automatically assigned (if auto_assign_org above is set to true)
# Default role new users will be automatically assigned (if disabled above is set to true)
;auto_assign_org_role = Viewer
# Require email validation before sign up completes
@@ -429,8 +376,8 @@
# Default UI theme ("dark" or "light")
;default_theme = dark
# Default UI language (supported IETF language tag, such as en-US)
;default_language = en-US
# Default locale (supported IETF language tag, such as en-US)
;default_locale = en-US
# Path to a custom home page. Users are only redirected to this if the default home dashboard is used. It should match a frontend route and contain a leading slash.
;home_page =
@@ -452,18 +399,10 @@
# Enter a comma-separated list of users login to hide them in the Grafana UI. These users are shown to Grafana admins and themselves.
; hidden_users =
[service_accounts]
# Service account maximum expiration date in days.
# When set, Grafana will not allow the creation of tokens with expiry greater than this setting.
; token_expiration_day_limit =
[auth]
# Login cookie name
;login_cookie_name = grafana_session
# Disable usage of Grafana build-in login solution.
;disable_login = false
# The maximum lifetime (duration) an authenticated user can be inactive before being required to login at next visit. Default is 7 days (7d). This setting should be expressed as a duration, e.g. 5m (minutes), 6h (hours), 10d (days), 2w (weeks), 1M (month). The lifetime resets at each successful token rotation.
;login_maximum_inactive_lifetime_duration =
@@ -484,7 +423,6 @@
# Set to true to attempt login with OAuth automatically, skipping the login screen.
# This setting is ignored if multiple OAuth providers are configured.
# Deprecated, use auto_login option for specific provider instead.
;oauth_auto_login = false
# OAuth state max age cookie duration in seconds. Defaults to 600 seconds.
@@ -502,12 +440,6 @@
# Set to true to enable verbose logging of SigV4 request signing
;sigv4_verbose_logging = false
# Set to true to enable Azure authentication option for HTTP-based datasources.
;azure_auth_enabled = false
# Set to skip the organization role from JWT login and use system's role assignment instead.
; skip_org_role_sync = false
#################################### Anonymous Auth ######################
[auth.anonymous]
# enable anonymous access
@@ -526,7 +458,6 @@
[auth.github]
;enabled = false
;allow_sign_up = true
;auto_login = false
;client_id = some_id
;client_secret = some_secret
;scopes = user:email,read:org
@@ -536,15 +467,11 @@
;allowed_domains =
;team_ids =
;allowed_organizations =
;role_attribute_path =
;role_attribute_strict = false
;allow_assign_grafana_admin = false
#################################### GitLab Auth #########################
[auth.gitlab]
;enabled = false
;allow_sign_up = true
;auto_login = false
;client_id = some_id
;client_secret = some_secret
;scopes = api
@@ -553,16 +480,11 @@
;api_url = https://gitlab.com/api/v4
;allowed_domains =
;allowed_groups =
;role_attribute_path =
;role_attribute_strict = false
;allow_assign_grafana_admin = false
;skip_org_role_sync = false
#################################### Google Auth ##########################
[auth.google]
;enabled = false
;allow_sign_up = true
;auto_login = false
;client_id = some_client_id
;client_secret = some_client_secret
;scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
@@ -571,25 +493,21 @@
;api_url = https://www.googleapis.com/oauth2/v1/userinfo
;allowed_domains =
;hosted_domain =
;skip_org_role_sync = false
#################################### Grafana.com Auth ####################
[auth.grafana_com]
;enabled = false
;allow_sign_up = true
;auto_login = false
;client_id = some_id
;client_secret = some_secret
;scopes = user:email
;allowed_organizations =
;skip_org_role_sync = false
#################################### Azure AD OAuth #######################
[auth.azuread]
;name = Azure AD
;enabled = false
;allow_sign_up = true
;auto_login = false
;client_id = some_client_id
;client_secret = some_client_secret
;scopes = openid email profile
@@ -598,16 +516,12 @@
;allowed_domains =
;allowed_groups =
;role_attribute_strict = false
;allow_assign_grafana_admin = false
# prevent synchronizing users organization roles
;skip_org_role_sync = false
#################################### Okta OAuth #######################
[auth.okta]
;name = Okta
;enabled = false
;allow_sign_up = true
;auto_login = false
;client_id = some_id
;client_secret = some_secret
;scopes = openid profile email groups
@@ -618,15 +532,12 @@
;allowed_groups =
;role_attribute_path =
;role_attribute_strict = false
;allow_assign_grafana_admin = false
;skip_org_role_sync = false
#################################### Generic OAuth ##########################
[auth.generic_oauth]
;enabled = false
;name = OAuth
;allow_sign_up = true
;auto_login = false
;client_id = some_id
;client_secret = some_secret
;scopes = user:email,read:org
@@ -653,7 +564,6 @@
;tls_client_ca =
;use_pkce = false
;auth_style =
;allow_assign_grafana_admin = false
#################################### Basic Auth ##########################
[auth.basic]
@@ -682,21 +592,15 @@
;jwk_set_url = https://foo.bar/.well-known/jwks.json
;jwk_set_file = /path/to/jwks.json
;cache_ttl = 60m
;expect_claims = {"aud": ["foo", "bar"]}
;expected_claims = {"aud": ["foo", "bar"]}
;key_file = /path/to/key/file
;role_attribute_path =
;role_attribute_strict = false
;auto_sign_up = false
;url_login = false
;allow_assign_grafana_admin = false
#################################### Auth LDAP ##########################
[auth.ldap]
;enabled = false
;config_file = /etc/grafana/ldap.toml
;allow_sign_up = true
# prevent synchronizing ldap users organization roles
;skip_org_role_sync = false
# LDAP background sync (Enterprise only)
# At 1 am every day
@@ -731,12 +635,9 @@
#################################### Role-based Access Control ###########
[rbac]
;enabled = true
# If enabled, cache permissions in a in memory cache (Enterprise only)
;permission_cache = true
# Reset basic roles permissions on boot
# Warning left to true, basic roles permissions will be reset on every boot
#reset_basic_roles = false
#################################### SMTP / Emailing ##########################
[smtp]
;enabled = false
@@ -946,11 +847,6 @@
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
;min_interval = 10s
[unified_alerting.reserved_labels]
# Comma-separated list of reserved labels added by the Grafana Alerting engine that should be disabled.
# For example: `disabled_labels=grafana_folder`
;disabled_labels =
#################################### Alerting ############################
[alerting]
# Disable legacy alerting engine & UI features
@@ -993,10 +889,6 @@
# Configures the batch size for the annotation clean-up job. This setting is used for dashboard, API, and alert annotations.
;cleanupjob_batchsize = 100
# Enforces the maximum allowed length of the tags for any newly introduced annotations. It can be between 500 and 4096 inclusive (which is the respective's column length). Default value is 500.
# Setting it to a higher value would impact performance therefore is not recommended.
;tags_length = 500
[annotations.dashboard]
# Dashboard annotations means that annotations are associated with the dashboard they are created on.
@@ -1068,7 +960,6 @@
# Url used to import dashboards directly from Grafana.com
[grafana_com]
;url = https://grafana.com
;api_url = https://grafana.com/api
#################################### Distributed tracing ############
# Opentracing is deprecated use opentelemetry instead
@@ -1095,10 +986,6 @@
# Not disabling is the most common setting when using Zipkin elsewhere in your infrastructure.
;disable_shared_zipkin_spans = false
[tracing.opentelemetry]
# attributes that will always be included in when creating new spans. ex (key1:value1,key2:value2)
;custom_attributes = key1:value1,key2:value2
[tracing.opentelemetry.jaeger]
# jaeger destination (ex http://localhost:14268/api/traces)
; address = http://localhost:14268/api/traces
@@ -1142,7 +1029,6 @@
;account_name =
;account_key =
;container_name =
;sas_token_expiration_days =
[external_image_storage.local]
# does not require any configuration
@@ -1153,16 +1039,9 @@
;server_url =
# If the remote HTTP image renderer service runs on a different server than the Grafana server you may have to configure this to a URL where Grafana is reachable, e.g. http://grafana.domain/.
;callback_url =
# An auth token that will be sent to and verified by the renderer. The renderer will deny any request without an auth token matching the one configured on the renderer side.
;renderer_token = -
# Concurrent render request limit affects when the /render HTTP endpoint is used. Rendering many images at the same time can overload the server,
# which this setting can help protect against by only allowing a certain amount of concurrent requests.
;concurrent_render_request_limit = 30
# Determines the lifetime of the render key used by the image renderer to access and render Grafana.
# This setting should be expressed as a duration. Examples: 10s (seconds), 5m (minutes), 2h (hours).
# Default is 5m. This should be more than enough for most deployments.
# Change the value only if image rendering is failing and you see `Failed to get the render key from cache` in Grafana logs.
;render_key_lifetime = 5m
[panels]
# If set to true Grafana will allow script tags in text panels. Not recommended as it enable XSS vulnerabilities.
@@ -1314,24 +1193,3 @@
# Enable or disable loading other base map layers
;enable_custom_baselayers = true
# Move an app plugin referenced by its id (including all its pages) to a specific navigation section
# Dependencies: needs the `topnav` feature to be enabled
[navigation.app_sections]
# The following will move an app plugin with the id of `my-app-id` under the `starred` section
# my-app-id = admin
# Move a specific app plugin page (referenced by its `path` field) to a specific navigation section
[navigation.app_standalone_pages]
# The following will move the page with the path "/a/my-app-id/starred-content" from `my-app-id` to the `starred` section
# /a/my-app-id/starred-content = starred
#################################### Secure Socks5 Datasource Proxy #####################################
[secure_socks_datasource_proxy]
; enabled = false
; root_ca_cert =
; client_key =
; client_cert =
; server_name =
# The address of the socks5 proxy datasources should connect to
; proxy_address =

View File

@@ -10,7 +10,8 @@ This directory contains guides for contributors to the Grafana project.
The `style-guides` directory contains style guides for the Grafana software project and documentation.
- [Backend style guide](backend/style-guide.md) for how to style and format backend functionality and code.
- [Backend style guide](style-guides/backend.md) for how to style and format backend functionality and code.
- [Documentation style guide](style-guides/documentation-style-guide.md) for how to style and format documentation.
- [Frontend style guide](style-guides/frontend.md) for how to style and format the user-facing functionality and code.
- [Redux framework](style-guides/redux.md) for designing the Grafana redux framework.
- [Themes style guide](style-guides/themes.md) for designing and updating Grafana themes.

View File

@@ -4,9 +4,9 @@ Are you looking to take on contributions with bigger impact? These guides help y
Learn more about the backend architecture:
- Part 1: [Services](../backend/services.md)
- Part 2: [Communication](../backend/communication.md)
- Part 3: [Database](../backend/database.md)
- Part 1: [Services](backend/services.md)
- Part 2: [Communication](backend/communication.md)
- Part 3: [Database](backend/database.md)
Learn more about the frontend architecture:

View File

@@ -62,7 +62,7 @@ You can now make SQL queries in any of your [command handlers](communication.md#
```go
func (s *MyService) DeleteDashboard(ctx context.Context, cmd *models.DeleteDashboardCommand) error {
if err := s.SQLStore.WithDbSession(ctx, func(sess *db.Session) error {
if err := s.SQLStore.WithDbSession(ctx, func(sess *sqlstore.DBSession) error {
_, err := sess.Exec("DELETE FROM dashboards WHERE dashboard_id=?", cmd.DashboardID)
return err
})

View File

@@ -0,0 +1,81 @@
# Errors
Grafana introduced its own error type `github.com/grafana/grafana/pkg/util/errutil.Error`
in June 2022. It's built on top of the Go `error` interface extended to
contain all the information necessary by Grafana to handle errors in an
informative and safe way.
Previously, Grafana has passed around regular Go errors and have had to
rely on bespoke solutions in API handlers to communicate informative
messages to the end-user. With the new `errutil.Error`, the API handlers
can be slimmed as information about public messaging, structured data
related to the error, localization metadata, log level, HTTP status
code, and so forth are carried by the error.
## Basic use
### Declaring errors
For a service, declare the different categories of errors that may occur
from your service (this corresponds to what you might want to have
specific public error messages or their templates for) by globally
constructing variables using the `errutil.NewBase(status, messageID, opts...)`
function.
The status code loosely corresponds to HTTP status codes and provides a
default log level for errors to ensure that the request logging is
properly informing administrators about various errors occurring in
Grafana (e.g. `StatusBadRequest` is generally speaking not as relevant
as `StatusInternal`). All available status codes live in the `errutil`
package and have names starting with `Status`.
The messageID is constructed as `<servicename>.<error-identifier>` where
the `<servicename>` corresponds to the root service directory per
[the package hierarchy](package-hierarchy.md) and `<error-identifier>`
is a short identifier using dashes for word separation that identifies
the specific category of errors within the service.
To set a static message sent to the client when the error occurs, the
`errutil.WithPublicMessage(message string)` option may be appended to
the NewBase function call. For dynamic messages or more options, refer
to the `errutil` package's GoDocs.
Errors are then constructed using the `Base.Errorf` method, which
functions like the [fmt.Errorf](https://pkg.go.dev/fmt#Errorf) method
except that it creates an `errutil.Error`.
```go
package main
import (
"errors"
"github.com/grafana/grafana/pkg/util/errutil"
"example.org/thing"
)
var ErrBaseNotFound = errutil.NewBase(errutil.StatusNotFound, "main.not-found", errutil.WithPublicMessage("Thing not found"))
func Look(id int) (*Thing, error) {
t, err := thing.GetByID(id)
if errors.Is(err, thing.ErrNotFound) {
return nil, ErrBaseNotFound.Errorf("did not find thing with ID %d: %w", id, err)
}
return t, nil
}
```
Check out [errutil's GoDocs](https://pkg.go.dev/github.com/grafana/grafana@v0.0.0-20220621133844-0f4fc1290421/pkg/util/errutil)
for details on how to construct and use Grafana style errors.
### Handling errors in the API
API handlers use the `github.com/grafana/grafana/pkg/api/response.Err`
function to create responses based on `errutil.Error`s.
> **Note:** (@sakjur 2022-06) `response.Err` requires all errors to be
> `errutil.Error` or it'll be considered an internal server error.
> This is something that should be fixed in the near future to allow
> fallback behavior to make it possible to correctly handle Grafana
> style errors if they're present but allow fallback to a reasonable
> default otherwise.

View File

@@ -19,11 +19,11 @@ package example
type Service struct {
logger log.Logger
cfg *setting.Cfg
sqlStore db.DB
sqlStore *sqlstore.SQLStore
}
// ProvideService provides Service as dependency for other services.
func ProvideService(cfg *setting.Cfg, sqlStore db.DB) (*Service, error) {
func ProvideService(cfg *setting.Cfg, sqlStore *sqlstore.SQLStore) (*Service, error) {
s := &Service{
logger: log.New("service"),
cfg: cfg,
@@ -76,7 +76,7 @@ package server
import (
"github.com/google/wire"
"github.com/grafana/grafana/pkg/example"
"github.com/grafana/grafana/pkg/infra/db"
"github.com/grafana/grafana/pkg/services/sqlstore"
)
var wireBasicSet = wire.NewSet(
@@ -98,7 +98,7 @@ func Initialize(cla setting.CommandLineArgs, opts Options, apiOpts api.ServerOpt
return &Server{}, nil
}
func InitializeForTest(cla setting.CommandLineArgs, opts Options, apiOpts api.ServerOptions, sqlStore db.DB) (*Server, error) {
func InitializeForTest(cla setting.CommandLineArgs, opts Options, apiOpts api.ServerOptions, sqlStore *sqlstore.SQLStore) (*Server, error) {
wire.Build(wireExtsTestSet)
return &Server{}, nil
}

Some files were not shown because too many files have changed in this diff Show More