diff --git a/.gitignore b/.gitignore index 15693e5..03daa61 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /grafana-*.tar.gz /grafana-*.tar.gz.manifest /grafana-*/ +*.rpm diff --git a/001-wrappers-grafana-cli.patch b/001-wrappers-grafana-cli.patch index 79bb3b5..fb3d2cc 100644 --- a/001-wrappers-grafana-cli.patch +++ b/001-wrappers-grafana-cli.patch @@ -1,8 +1,16 @@ diff --git a/packaging/wrappers/grafana-cli b/packaging/wrappers/grafana-cli -index 9cad151c0d..6b7ec1ab42 100755 +index 9cad151c0d..a786edc596 100755 --- a/packaging/wrappers/grafana-cli +++ b/packaging/wrappers/grafana-cli -@@ -12,11 +12,12 @@ CONF_DIR=/etc/grafana +@@ -5,18 +5,19 @@ + # the system-wide Grafana configuration that was bundled with the package as we + # use the binary. + +-DEFAULT=/etc/default/grafana ++DEFAULT=/etc/sysconfig/grafana-server + + GRAFANA_HOME=/usr/share/grafana + CONF_DIR=/etc/grafana DATA_DIR=/var/lib/grafana PLUGINS_DIR=/var/lib/grafana/plugins LOG_DIR=/var/log/grafana @@ -24,3 +32,16 @@ index 9cad151c0d..6b7ec1ab42 100755 if [ -f "$DEFAULT" ]; then . "$DEFAULT" fi +@@ -36,4 +38,11 @@ OPTS="--homepath=${GRAFANA_HOME} \ + cfg:default.paths.logs=${LOG_DIR} \ + cfg:default.paths.plugins=${PLUGINS_DIR}'" + +-eval $EXECUTABLE "$OPTS" "$@" ++if [ "$(id -u)" -eq 0 ]; then ++ exec runuser -u "${GRAFANA_USER}" -- "$EXECUTABLE" "$OPTS" "$@" ++elif [ "$(id -u -n)" = "${GRAFANA_USER}" ]; then ++ exec "$EXECUTABLE" "$OPTS" "$@" ++else ++ echo "Please run this script as user \"${GRAFANA_USER}\" or root." ++ exit 5 ++fi diff --git a/002-manpages.patch b/002-manpages.patch index d2b2f88..ba614a4 100644 --- a/002-manpages.patch +++ b/002-manpages.patch @@ -1,10 +1,10 @@ diff --git a/docs/man/man1/grafana-cli.1 b/docs/man/man1/grafana-cli.1 new file mode 100644 -index 0000000000..171748fcda +index 0000000000..7ac2af882c --- /dev/null +++ b/docs/man/man1/grafana-cli.1 -@@ -0,0 +1,51 @@ -+.TH GRAFANA "1" "February 2019" "Grafana cli version 5.4.3" "User Commands" +@@ -0,0 +1,60 @@ ++.TH GRAFANA "1" "November 2020" "Grafana cli version 7.3.1" "User Commands" +.SH NAME +grafana-cli \- command line administration for the Grafana metrics dashboard and graph editor +.SH DESCRIPTION @@ -41,6 +41,15 @@ index 0000000000..171748fcda +\fB\-\-debug\fR, \fB\-d\fR +enable debug logging +.TP ++\fB\-\-configOverrides\fR value ++Configuration options to override defaults as a string. e.g. cfg:default.paths.log=/dev/null ++.TP ++\fB\-\-homepath\fR value ++Path to Grafana install/home path, defaults to working directory ++.TP ++\fB\-\-config\fR value ++Path to config file ++.TP +\fB\-\-help\fR, \fB\-h\fR +show help +.TP @@ -57,11 +66,11 @@ index 0000000000..171748fcda +.BR http://docs.grafana.org/ . diff --git a/docs/man/man1/grafana-server.1 b/docs/man/man1/grafana-server.1 new file mode 100644 -index 0000000000..30b7c1306f +index 0000000000..c616268b31 --- /dev/null +++ b/docs/man/man1/grafana-server.1 -@@ -0,0 +1,156 @@ -+.TH VERSION "1" "February 2019" "Version 5.4.3" "User Commands" +@@ -0,0 +1,84 @@ ++.TH VERSION "1" "November 2020" "Version 7.3.1" "User Commands" +.SH NAME +grafana-server \- back-end server for the Grafana metrics dashboard and graph editor +.SH DESCRIPTION @@ -90,14 +99,25 @@ index 0000000000..30b7c1306f +.BR /etc/grafana/grafana.ini +and is well documented with comments. +The command-line options listed below override options of -+the same (or similar) name in the configuration file and also provide -+additional options for testing Grafana. ++the same (or similar) name in the configuration file. +.P +.HP +\fB\-config\fR string +.IP +path to config file +.HP ++\fB\-convey-json\fR ++.IP ++When true, emits results in JSON blocks. Default: 'false' ++.HP ++\fB\-convey-silent\fR ++.IP ++When true, all output from GoConvey is suppressed. ++.HP ++\fB\-convey-story\fR ++.IP ++When true, emits story output, otherwise emits dot output. When not provided, this flag mirrors the value of the '-test.v' flag ++.HP +\fB\-homepath\fR string +.IP +path to grafana install/home path, defaults to working directory @@ -114,103 +134,20 @@ index 0000000000..30b7c1306f +.IP +Turn on pprof profiling +.HP -+\fB\-profile\-port\fR int ++\fB\-profile\-port\fR uint +.IP +Define custom port for profiling (default 6060) +.HP -+\fB\-test\fR.bench regexp ++\fB\-tracing\fR +.IP -+run only benchmarks matching regexp ++Turn on tracing +.HP -+\fB\-test\fR.benchmem ++\fB\-tracing\-file\fR string +.IP -+print memory allocations for benchmarks -+.HP -+\fB\-test\fR.benchtime d -+.IP -+run each benchmark for duration d (default 1s) -+.HP -+\fB\-test\fR.blockprofile file -+.IP -+write a goroutine blocking profile to file -+.HP -+\fB\-test\fR.blockprofilerate rate -+.IP -+set blocking profile rate (see runtime.SetBlockProfileRate) (default 1) -+.HP -+\fB\-test\fR.count n -+.IP -+run tests and benchmarks n times (default 1) -+.HP -+\fB\-test\fR.coverprofile file -+.IP -+write a coverage profile to file -+.HP -+\fB\-test\fR.cpu list -+.IP -+comma\-separated list of cpu counts to run each test with -+.HP -+\fB\-test\fR.cpuprofile file -+.IP -+write a cpu profile to file -+.HP -+\fB\-test\fR.failfast -+.IP -+do not start new tests after the first test failure -+.HP -+\fB\-test\fR.list regexp -+.IP -+list tests, examples, and benchmarks matching regexp then exit -+.HP -+\fB\-test\fR.memprofile file -+.IP -+write a memory profile to file -+.HP -+\fB\-test\fR.memprofilerate rate -+.IP -+set memory profiling rate (see runtime.MemProfileRate) -+.HP -+\fB\-test\fR.mutexprofile string -+.IP -+write a mutex contention profile to the named file after execution -+.HP -+\fB\-test\fR.mutexprofilefraction int -+.IP -+if >= 0, calls runtime.SetMutexProfileFraction() (default 1) -+.HP -+\fB\-test\fR.outputdir dir -+.IP -+write profiles to dir -+.HP -+\fB\-test\fR.parallel n -+.IP -+run at most n tests in parallel (default 8) -+.HP -+\fB\-test\fR.run regexp -+.IP -+run only tests and examples matching regexp -+.HP -+\fB\-test\fR.short -+.IP -+run smaller test suite to save time -+.HP -+\fB\-test\fR.testlogfile file -+.IP -+write test action log to file (for use only by cmd/go) -+.HP -+\fB\-test\fR.timeout d -+.IP -+panic test binary after duration d (default 0, timeout disabled) -+.HP -+\fB\-test\fR.trace file -+.IP -+write an execution trace to file -+.HP -+\fB\-test\fR.v -+.IP -+verbose: print additional output ++Define tracing output file (default "trace.out") +.TP +\fB\-v\fR ++.IP +prints current version and exits +.SH "SEE ALSO" +The full documentation for diff --git a/003-golang1.15.patch b/003-golang1.15.patch deleted file mode 100644 index d568703..0000000 --- a/003-golang1.15.patch +++ /dev/null @@ -1,85 +0,0 @@ -diff --git a/pkg/api/dashboard_test.go b/pkg/api/dashboard_test.go -index b58cf217d3..90e110974e 100644 ---- a/pkg/api/dashboard_test.go -+++ b/pkg/api/dashboard_test.go -@@ -3,6 +3,7 @@ package api - import ( - "encoding/json" - "fmt" -+ "strconv" - "io/ioutil" - "testing" - -@@ -828,7 +829,7 @@ func TestDashboardApiEndpoint(t *testing.T) { - bus.AddHandler("test", func(query *models.GetDashboardVersionQuery) error { - query.Result = &models.DashboardVersion{ - Data: simplejson.NewFromAny(map[string]interface{}{ -- "title": "Dash" + string(query.DashboardId), -+ "title": "Dash" + strconv.FormatInt(query.DashboardId, 10), - }), - } - return nil -diff --git a/pkg/components/gtime/gtime_test.go b/pkg/components/gtime/gtime_test.go -index 4dab30fbf6..e4ba096a43 100644 ---- a/pkg/components/gtime/gtime_test.go -+++ b/pkg/components/gtime/gtime_test.go -@@ -22,7 +22,7 @@ func TestParseInterval(t *testing.T) { - {interval: "1M", duration: now.Sub(now.AddDate(0, -1, 0))}, - {interval: "1y", duration: now.Sub(now.AddDate(-1, 0, 0))}, - {interval: "5y", duration: now.Sub(now.AddDate(-5, 0, 0))}, -- {interval: "invalid-duration", err: "time: invalid duration invalid-duration"}, -+ {interval: "invalid-duration", err: "time: invalid duration \"invalid-duration\""}, - } - - for i, tc := range tcs { -diff --git a/pkg/services/sqlstore/alert_notification_test.go b/pkg/services/sqlstore/alert_notification_test.go -index 75d5582022..4986d0d781 100644 ---- a/pkg/services/sqlstore/alert_notification_test.go -+++ b/pkg/services/sqlstore/alert_notification_test.go -@@ -168,7 +168,7 @@ func TestAlertNotificationSQLAccess(t *testing.T) { - cmd.Frequency = "invalid duration" - - err := CreateAlertNotificationCommand(cmd) -- So(err.Error(), ShouldEqual, "time: invalid duration invalid duration") -+ So(err.Error(), ShouldEqual, "time: invalid duration \"invalid duration\"") - }) - }) - -@@ -199,7 +199,7 @@ func TestAlertNotificationSQLAccess(t *testing.T) { - - err := UpdateAlertNotification(updateCmd) - So(err, ShouldNotBeNil) -- So(err.Error(), ShouldEqual, "time: invalid duration invalid duration") -+ So(err.Error(), ShouldEqual, "time: invalid duration \"invalid duration\"") - }) - }) - -diff --git a/pkg/services/sqlstore/sqlbuilder_test.go b/pkg/services/sqlstore/sqlbuilder_test.go -index 42159171b0..abf669d294 100644 ---- a/pkg/services/sqlstore/sqlbuilder_test.go -+++ b/pkg/services/sqlstore/sqlbuilder_test.go -@@ -5,6 +5,7 @@ import ( - "math/rand" - "testing" - "time" -+ "strconv" - - "github.com/grafana/grafana/pkg/components/simplejson" - "github.com/grafana/grafana/pkg/models" -@@ -193,12 +194,12 @@ func test(t *testing.T, dashboardProps DashboardProps, dashboardPermission *Dash - func createDummyUser() (*models.User, error) { - uid := rand.Intn(9999999) - createUserCmd := &models.CreateUserCommand{ -- Email: string(uid) + "@example.com", -- Login: string(uid), -- Name: string(uid), -+ Email: strconv.Itoa(uid) + "@example.com", -+ Login: strconv.Itoa(uid), -+ Name: strconv.Itoa(uid), - Company: "", - OrgName: "", -- Password: string(uid), -+ Password: strconv.Itoa(uid), - EmailVerified: true, - IsAdmin: false, - SkipOrgSetup: false, diff --git a/003-remove-dashboard-abspath-test.patch b/003-remove-dashboard-abspath-test.patch new file mode 100644 index 0000000..2076441 --- /dev/null +++ b/003-remove-dashboard-abspath-test.patch @@ -0,0 +1,41 @@ +diff --git a/pkg/services/provisioning/dashboards/file_reader_linux_test.go b/pkg/services/provisioning/dashboards/file_reader_linux_test.go +index 3584bbc242..3d37f5e104 100644 +--- a/pkg/services/provisioning/dashboards/file_reader_linux_test.go ++++ b/pkg/services/provisioning/dashboards/file_reader_linux_test.go +@@ -33,6 +33,11 @@ func TestProvisionedSymlinkedFolder(t *testing.T) { + t.Errorf("expected err to be nil") + } + ++ want, err = filepath.EvalSymlinks(want) ++ if err != nil { ++ t.Errorf("expected err to be nil %v", err) ++ } ++ + resolvedPath := reader.resolvedPath() + if resolvedPath != want { + t.Errorf("got %s want %s", resolvedPath, want) +diff --git a/pkg/services/provisioning/dashboards/file_reader_test.go b/pkg/services/provisioning/dashboards/file_reader_test.go +index 33fe6a0a68..2c67ebb677 100644 +--- a/pkg/services/provisioning/dashboards/file_reader_test.go ++++ b/pkg/services/provisioning/dashboards/file_reader_test.go +@@ -340,20 +340,6 @@ func TestDashboardFileReader(t *testing.T) { + So(err, ShouldBeNil) + + So(len(fakeService.provisioned["Default"]), ShouldEqual, 1) +- So(fakeService.provisioned["Default"][0].ExternalId, ShouldEqual, absPath1) +- }) +- +- Convey("Missing dashboard should be deleted if DisableDeletion = false", func() { +- reader, err := NewDashboardFileReader(cfg, logger) +- So(err, ShouldBeNil) +- +- err = reader.startWalkingDisk() +- So(err, ShouldBeNil) +- +- So(len(fakeService.provisioned["Default"]), ShouldEqual, 1) +- So(fakeService.provisioned["Default"][0].ExternalId, ShouldEqual, absPath1) +- So(len(fakeService.inserted), ShouldEqual, 1) +- So(fakeService.inserted[0].Dashboard.Id, ShouldEqual, 1) + }) + }) + diff --git a/004-remove-goldenfiles-test.patch b/004-remove-goldenfiles-test.patch deleted file mode 100644 index bc08ffc..0000000 --- a/004-remove-goldenfiles-test.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/pkg/tsdb/influxdb/flux/executor_test.go b/pkg/tsdb/influxdb/flux/executor_test.go -index b42389c94d..a24e16f97e 100644 ---- a/pkg/tsdb/influxdb/flux/executor_test.go -+++ b/pkg/tsdb/influxdb/flux/executor_test.go -@@ -285,12 +285,3 @@ func TestBuckets(t *testing.T) { - fmt.Println("----------------------") - }) - } -- --func TestGoldenFiles(t *testing.T) { -- t.Run("Renamed", func(t *testing.T) { -- _, err := verifyGoldenResponse("renamed") -- if err != nil { -- t.Fatal(err.Error()) -- } -- }) --} diff --git a/004-skip-x86-goldenfiles-tests.patch b/004-skip-x86-goldenfiles-tests.patch new file mode 100644 index 0000000..20a50e2 --- /dev/null +++ b/004-skip-x86-goldenfiles-tests.patch @@ -0,0 +1,59 @@ +diff --git a/packages/grafana-data/src/dataframe/ArrowDataFrame.test.ts b/packages/grafana-data/src/dataframe/ArrowDataFrame.test.ts +index 96efaccfce..bcdd98144f 100644 +--- a/packages/grafana-data/src/dataframe/ArrowDataFrame.test.ts ++++ b/packages/grafana-data/src/dataframe/ArrowDataFrame.test.ts +@@ -52,7 +52,7 @@ describe('Read/Write arrow Table to DataFrame', () => { + expect(after).toEqual(before); + }); + +- test('should read all types', () => { ++ test.skip('should read all types', () => { + const fullpath = path.resolve(__dirname, './__snapshots__/all_types.golden.arrow'); + const arrow = fs.readFileSync(fullpath); + const table = Table.from([arrow]); +diff --git a/packages/grafana-runtime/src/utils/queryResponse.test.ts b/packages/grafana-runtime/src/utils/queryResponse.test.ts +index 25169669a0..05474366a2 100644 +--- a/packages/grafana-runtime/src/utils/queryResponse.test.ts ++++ b/packages/grafana-runtime/src/utils/queryResponse.test.ts +@@ -38,7 +38,7 @@ const emptyResults = { + /* eslint-enable */ + + describe('GEL Utils', () => { +- test('should parse output with dataframe', () => { ++ test.skip('should parse output with dataframe', () => { + const res = toDataQueryResponse(resp); + const frames = res.data; + for (const frame of frames) { +@@ -106,7 +106,7 @@ describe('GEL Utils', () => { + expect(frames.length).toEqual(0); + }); + +- test('resultWithError', () => { ++ test.skip('resultWithError', () => { + // Generated from: + // qdr.Responses[q.GetRefID()] = backend.DataResponse{ + // Error: fmt.Errorf("an Error: %w", fmt.Errorf("another error")), +diff --git a/pkg/tsdb/influxdb/flux/executor_test.go b/pkg/tsdb/influxdb/flux/executor_test.go +index e053c6c397..fc7685cbab 100644 +--- a/pkg/tsdb/influxdb/flux/executor_test.go ++++ b/pkg/tsdb/influxdb/flux/executor_test.go +@@ -59,6 +59,7 @@ func (r *MockRunner) runQuery(ctx context.Context, q string) (*api.QueryTableRes + } + + func verifyGoldenResponse(t *testing.T, name string) *backend.DataResponse { ++ t.Skip("x86 memory dump is not compatible with other architectures") + runner := &MockRunner{ + testDataPath: name + ".csv", + } +diff --git a/public/app/plugins/datasource/cloudwatch/specs/datasource.test.ts b/public/app/plugins/datasource/cloudwatch/specs/datasource.test.ts +index 94c1991dae..8e5b35eb3b 100644 +--- a/public/app/plugins/datasource/cloudwatch/specs/datasource.test.ts ++++ b/public/app/plugins/datasource/cloudwatch/specs/datasource.test.ts +@@ -88,6 +88,7 @@ describe('CloudWatchDatasource', () => { + }); + + it('should return log groups as an array of strings', async () => { ++ return; // "it.skip" of this test leads to a test failure of the other log group test, because the mock is not active (see beforeEach() above) + const logGroups = await ctx.ds.describeLogGroups(); + const expectedLogGroups = [ + '/aws/containerinsights/dev303-workshop/application', diff --git a/Makefile b/Makefile index 3f1696f..daf6b09 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,36 @@ -all: grafana-vendor-$(VER).tar.gz \ - grafana-vendor-$(VER).tar.gz.manifest \ - grafana-webpack-$(VER).tar.gz \ - grafana-webpack-$(VER).tar.gz.manifest +all: grafana-vendor-go-$(VER).tar.gz \ + grafana-webpack-$(VER).tar.gz -grafana-$(VER).tar.gz grafana-$(VER): +grafana-$(VER).tar.gz grafana-$(VER)/: wget https://github.com/grafana/grafana/archive/v$(VER)/grafana-$(VER).tar.gz + rm -rf grafana-$(VER) tar xfz grafana-$(VER).tar.gz + cd grafana-$(VER) && \ + for patch in ../*.patch; do patch -p1 < $$patch; done -grafana-vendor-$(VER).tar.gz: grafana-$(VER).tar.gz +grafana-vendor-go-$(VER).tar.gz: grafana-$(VER)/ cd grafana-$(VER) && go mod vendor -v tar cfz $@ grafana-$(VER)/vendor - -grafana-vendor-$(VER).tar.gz.manifest: grafana-$(VER).tar.gz awk '$$2~/^v/ && $$4 != "indirect" {print "Provides: bundled(golang(" $$1 ")) = " substr($$2, 2)}' grafana-$(VER)/go.mod | \ - sed -E 's/=(.*)-(.*)-(.*)/=\1-\2.\3/g' > $@ + sed -E 's/=(.*)-(.*)-(.*)/=\1-\2.\3/g' > $@.manifest -grafana-webpack-$(VER).tar.gz: grafana-$(VER).tar.gz - cd grafana-$(VER) && yarn install --pure-lockfile && yarn run build +grafana-vendor-nodejs-$(VER).tar.gz: grafana-$(VER)/ + cd grafana-$(VER) && yarn install --pure-lockfile + + # Remove files with licensing issues + find grafana-$(VER) -type d -name 'node-notifier' -prune -exec rm -r {} \; + find grafana-$(VER) -name '*.exe' -delete + + tar cfz $@ $$(find grafana-$(VER) -type d -name "node_modules" -prune) + ./list_bundled_nodejs_packages.py grafana-$(VER)/ > $@.manifest + +grafana-webpack-$(VER).tar.gz: grafana-$(VER)/ cd grafana-$(VER) && \ - mkdir plugins-bundled/external && yarn run plugins:build-bundled && \ - for plugin in plugins-bundled/internal/*; do mv $$plugin $$plugin.tmp; mv $$plugin.tmp/dist $$plugin; rm -rf $$plugin.tmp; done && \ - rm plugins-bundled/README.md plugins-bundled/.gitignore plugins-bundled/external.json - tar cfz $@ grafana-$(VER)/public/build grafana-$(VER)/public/views grafana-$(VER)/plugins-bundled + yarn install --pure-lockfile && \ + ../build_frontend.sh -grafana-webpack-$(VER).tar.gz.manifest: grafana-$(VER).tar.gz - ./create_webpack_manifest.py grafana-$(VER)/ > $@ + tar cfz $@ grafana-$(VER)/public/build grafana-$(VER)/public/views grafana-$(VER)/plugins-bundled + ./list_bundled_nodejs_packages.py grafana-$(VER)/ > $@.manifest clean: - rm -rf *.tar.gz grafana-*/ + rm -rf *.tar.gz *.manifest *.rpm grafana-*/ diff --git a/README.md b/README.md index 1c34177..74b0655 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,20 @@ The grafana package (replace X.Y.Z with the new Grafana version) * update `Version` and `%changelog` in the specfile -* create bundles and manifests: `VER=X.Y.Z make` -* update specfile with contents of `grafana-vendor-X.Y.Z.tar.gz.manifest` and `grafana-webpack-X.Y.Z.tar.gz.manifest` +* create bundles and manifests: `VER=X.Y.Z make clean all` +* update specfile with contents of the `*.manifest` files * check if the default configuration has changed: `diff grafana-X.Y.Z/conf/defaults.ini distro-defaults.ini` and update `distro-defaults.ini` if necessary * run local build: `rpkg local` -* run rpm linter: `rpkg lint` -* run local builds with different OS versions: `./run_container_build.sh version` +* run rpm linter: `rpkg lint -r grafana.rpmlintrc` +* run local builds with different OS versions: `./run_container_build.sh fedora-version` * run a scratch build: `fedpkg scratch-build --srpm` -* upload new source tarballs: `fedpkg new-sources grafana-X.Y.Z.tar.gz grafana-vendor-X.Y.Z.tar.gz grafana-webpack-X.Y.Z.tar.gz` +* upload new source tarballs: `fedpkg new-sources grafana-X.Y.Z.tar.gz grafana-vendor-X.Y.Z.tar.gz` + +## Backporting +* create the patch +* declare and apply (`%prep`) the patch in the specfile +* if the patch affects Go or Node.js dependencies, or the webpack + * create new tarballs and rename them to `grafana-...-X.Y.Z-R.tar.gz` + * update the specfile + +Note: the Makefile automatically applies all patches before creating the tarballs diff --git a/build_frontend.sh b/build_frontend.sh new file mode 100755 index 0000000..a9aa76d --- /dev/null +++ b/build_frontend.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Build the frontend +yarn run build + +# Build the bundled plugins +mkdir plugins-bundled/external +yarn run plugins:build-bundled +for plugin in plugins-bundled/internal/input-datasource; do + mv $plugin $plugin.tmp + mv $plugin.tmp/dist $plugin + rm -rf $plugin.tmp +done +rm plugins-bundled/README.md plugins-bundled/.gitignore plugins-bundled/external.json + +# Fix permissions (webpack sometimes outputs files with mode = 666 due to reasons unknown (race condition/umask issue afaics)) +chmod -R g-w,o-w public/build plugins-bundled diff --git a/distro-defaults.ini b/distro-defaults.ini index 7b61f6e..db0de31 100644 --- a/distro-defaults.ini +++ b/distro-defaults.ini @@ -1,4 +1,4 @@ -##################### Grafana Configuration Defaults for distros ##################### +##################### Grafana Configuration Defaults ##################### # # Do not modify this file in grafana installs # @@ -130,7 +130,25 @@ logging = false # This setting also applies to core backend HTTP data sources where query requests use an HTTP client with timeout set. timeout = 30 -# If enabled and user is not anonymous, data proxy will add X-Grafana-User header with username into the request, default is false. +# How many seconds the data proxy waits before sending a keepalive request. +keep_alive_seconds = 30 + +# How many seconds the data proxy waits for a successful TLS Handshake before timing out. +tls_handshake_timeout_seconds = 10 + +# How many seconds the data proxy will wait for a server's first response headers after +# fully writing the request headers if the request has an "Expect: 100-continue" +# header. A value of 0 will result in the body being sent immediately, without +# waiting for the server to approve. +expect_continue_timeout_seconds = 1 + +# The maximum number of idle connections that Grafana will keep alive. +max_idle_connections = 100 + +# How many seconds the data proxy keeps an idle connection open before timing out. +idle_conn_timeout_seconds = 90 + +# If enabled and user is not anonymous, data proxy will add X-Grafana-User header with username into the request. send_user_header = false #################################### Analytics ########################### @@ -275,15 +293,18 @@ viewers_can_edit = false # Editors can administrate dashboard, folders and teams they create editors_can_admin = false +# The duration in time a user invitation remains valid before expiring. This setting should be expressed as a duration. Examples: 6h (hours), 2d (days), 1w (week). Default is 24h (24 hours). The minimum supported duration is 15m (15 minutes). +user_invite_max_lifetime_duration = 24h + [auth] # Login cookie name login_cookie_name = grafana_session -# The lifetime (days) an authenticated user can be inactive before being required to login at next visit. Default is 7 days. -login_maximum_inactive_lifetime_days = 7 +# 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 = -# The maximum lifetime (days) an authenticated user can be logged in since login time before being required to login. Default is 30 days. -login_maximum_lifetime_days = 30 +# The maximum lifetime (duration) an authenticated user can be logged in since login time before being required to login. Default is 30 days (30d). This setting should be expressed as a duration, e.g. 5m (minutes), 6h (hours), 10d (days), 2w (weeks), 1M (month). +login_maximum_lifetime_duration = # How often should auth tokens be rotated for authenticated users when being active. The default is each 10 minutes. token_rotation_interval_minutes = 10 @@ -301,12 +322,15 @@ signout_redirect_url = # This setting is ignored if multiple OAuth providers are configured. oauth_auto_login = false -# OAuth state max age cookie duration. Defaults to 60 seconds. -oauth_state_cookie_max_age = 60 +# OAuth state max age cookie duration in seconds. Defaults to 600 seconds. +oauth_state_cookie_max_age = 600 # limit of api_key seconds to live before expiration api_key_max_seconds_to_live = -1 +# Set to true to enable SigV4 authentication option for HTTP-based datasources +sigv4_auth_enabled = false + #################################### Anonymous Auth ###################### [auth.anonymous] # enable anonymous access @@ -321,12 +345,12 @@ org_role = Viewer # mask the Grafana version number for unauthenticated users hide_version = false -#################################### Github Auth ######################### +#################################### GitHub Auth ######################### [auth.github] enabled = false allow_sign_up = true client_id = some_id -client_secret = some_secret +client_secret = scopes = user:email,read:org auth_url = https://github.com/login/oauth/authorize token_url = https://github.com/login/oauth/access_token @@ -340,7 +364,7 @@ allowed_organizations = enabled = false allow_sign_up = true client_id = some_id -client_secret = some_secret +client_secret = scopes = api auth_url = https://gitlab.com/oauth/authorize token_url = https://gitlab.com/oauth/token @@ -353,7 +377,7 @@ allowed_groups = enabled = false allow_sign_up = true client_id = some_client_id -client_secret = some_client_secret +client_secret = scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email auth_url = https://accounts.google.com/o/oauth2/auth token_url = https://accounts.google.com/o/oauth2/token @@ -367,7 +391,7 @@ hosted_domain = enabled = false allow_sign_up = true client_id = some_id -client_secret = some_secret +client_secret = scopes = user:email allowed_organizations = @@ -375,7 +399,7 @@ allowed_organizations = enabled = false allow_sign_up = true client_id = some_id -client_secret = some_secret +client_secret = scopes = user:email allowed_organizations = @@ -385,7 +409,7 @@ name = Azure AD enabled = false allow_sign_up = true client_id = some_client_id -client_secret = some_client_secret +client_secret = scopes = openid email profile auth_url = https://login.microsoftonline.com//oauth2/v2.0/authorize token_url = https://login.microsoftonline.com//oauth2/v2.0/token @@ -398,7 +422,7 @@ name = Okta enabled = false allow_sign_up = true client_id = some_id -client_secret = some_secret +client_secret = scopes = openid profile email groups auth_url = https://.okta.com/oauth2/v1/authorize token_url = https://.okta.com/oauth2/v1/token @@ -413,11 +437,13 @@ name = OAuth enabled = false allow_sign_up = true client_id = some_id -client_secret = some_secret +client_secret = scopes = user:email email_attribute_name = email:primary email_attribute_path = +login_attribute_path = role_attribute_path = +id_token_attribute_name = auth_url = token_url = api_url = @@ -597,6 +623,36 @@ max_attempts = 3 # Makes it possible to enforce a minimal interval between evaluations, to reduce load on the backend min_interval_seconds = 1 +# Configures for how long alert annotations are stored. Default is 0, which keeps them forever. +# This setting should be expressed as an duration. Ex 6h (hours), 10d (days), 2w (weeks), 1M (month). +max_annotation_age = + +# Configures max number of alert annotations that Grafana stores. Default value is 0, which keeps all alert annotations. +max_annotations_to_keep = + +#################################### Annotations ######################### + +[annotations.dashboard] +# Dashboard annotations means that annotations are associated with the dashboard they are created on. + +# Configures how long dashboard annotations are stored. Default is 0, which keeps them forever. +# This setting should be expressed as a duration. Examples: 6h (hours), 10d (days), 2w (weeks), 1M (month). +max_age = + +# Configures max number of dashboard annotations that Grafana stores. Default value is 0, which keeps all dashboard annotations. +max_annotations_to_keep = + +[annotations.api] +# API annotations means that the annotations have been created using the API without any +# association with a dashboard. + +# Configures how long Grafana stores API annotations. Default is 0, which keeps them forever. +# This setting should be expressed as a duration. Examples: 6h (hours), 10d (days), 2w (weeks), 1M (month). +max_age = + +# Configures max number of API annotations that Grafana keeps. Default value is 0, which keeps all API annotations. +max_annotations_to_keep = + #################################### Explore ############################# [explore] # Enable the Explore section @@ -614,6 +670,12 @@ disable_total_stats = false basic_auth_username = basic_auth_password = +# Metrics environment info adds dimensions to the `grafana_environment_info` metric, which +# can expose more information about the Grafana instance. +[metrics.environment_info] +#exampleLabel1 = exampleValue1 +#exampleLabel2 = exampleValue2 + # Send internal Grafana metrics to graphite [metrics.graphite] # Enable by setting the address setting (ex localhost:2003) @@ -675,6 +737,8 @@ public_url = key_file = bucket = path = +enable_signed_urls = false +signed_url_expiration = [external_image_storage.azure_blob] account_name = @@ -771,3 +835,23 @@ license_path = [feature_toggles] # enable features, separated by spaces enable = + +[date_formats] +# For information on what formatting patterns that are supported https://momentjs.com/docs/#/displaying/ + +# Default system date format used in time range picker and other places where full time is displayed +full_date = YYYY-MM-DD HH:mm:ss + +# Used by graph and other places where we only show small intervals +interval_second = HH:mm:ss +interval_minute = HH:mm +interval_hour = MM/DD HH:mm +interval_day = MM/DD +interval_month = YYYY-MM +interval_year = YYYY + +# Experimental feature +use_browser_locale = false + +# Default timezone for user preferences. Options are 'browser' for the browser local timezone or a timezone name from IANA Time Zone database, e.g. 'UTC' or 'Europe/Amsterdam' etc. +default_timezone = browser diff --git a/grafana.rpmlintrc b/grafana.rpmlintrc index d7a45e7..ff8b52d 100644 --- a/grafana.rpmlintrc +++ b/grafana.rpmlintrc @@ -1,6 +1,7 @@ addFilter("E: non-readable /etc/grafana/grafana.ini 640") addFilter("E: non-readable /etc/grafana/ldap.toml 640") addFilter("E: non-standard-dir-perm /var/lib/grafana 750") +addFilter("E: non-standard-dir-perm /etc/grafana/provisioning/datasources 750") addFilter("E: zero-length /usr/share/grafana/public/.*") addFilter("E: script-without-shebang .*\.json") @@ -9,3 +10,7 @@ addFilter("W: non-standard-gid.* grafana") addFilter("W: hidden-file-or-dir /usr/share/grafana/public/.*") addFilter("W: log-files-without-logrotate .*") addFilter("W: dangerous-command-in-%post chown") + +addFilter("W: strange-permission build_frontend.sh 755") +addFilter("W: strange-permission list_bundled_nodejs_packages.py 755") +addFilter("W: %ifarch-applied-patch Patch.: 00.-skip-goldenfiles-tests.patch") diff --git a/grafana.spec b/grafana.spec index 875ca4a..679e369 100644 --- a/grafana.spec +++ b/grafana.spec @@ -8,9 +8,18 @@ end end} +# Specify if the frontend will be compiled as part of the build or +# is attached as a webpack tarball (in case of an unsuitable nodejs version on the build system) +%define compile_frontend 0 + Name: grafana +<<<<<<< HEAD Version: 7.1.1 Release: 2%{?dist} +======= +Version: 7.3.1 +Release: 1%{?dist} +>>>>>>> 84a264d... update to upstream version 7.3.1, resolve RHBZ #1843170 Summary: Metrics dashboard and graph editor License: ASL 2.0 URL: https://grafana.org @@ -19,34 +28,41 @@ URL: https://grafana.org Source0: https://github.com/grafana/grafana/archive/v%{version}/%{name}-%{version}.tar.gz # Source1 contains the bundled Go dependencies -Source1: grafana-vendor-%{version}.tar.gz +Source1: grafana-vendor-go-%{version}.tar.gz -# Source2 contains the front-end javascript modules bundled into a webpack +%if %{compile_frontend} +# Source2 contains the bundled Node.js dependencies +Source2: grafana-vendor-nodejs-%{version}.tar.gz +%else +# Source2 contains the precompiled frontend Source2: grafana-webpack-%{version}.tar.gz +%endif # Source3 contains Grafana configuration defaults for distributions Source3: distro-defaults.ini -# Source4 contains the Makefile to create a Go vendor tarball and a webpack from grafana sources -Source4: Makefile +# Source4 contains the script to build the frontend +Source4: build_frontend.sh -# Source5 contains the script to generate the list of bundled nodejs packages -Source5: create_webpack_manifest.py +# Source5 contains the Makefile to create the required bundles +Source5: Makefile + +# Source6 contains the script to generate the list of bundled nodejs packages +Source6: list_bundled_nodejs_packages.py # Patches Patch1: 001-wrappers-grafana-cli.patch Patch2: 002-manpages.patch -# Required for Go >= 1.15 -# https://github.com/golang/go/commit/201cb046b745f8bb00e3d382290190c74ba7b7e1 -# https://github.com/golang/go/issues/32479 -Patch3: 003-golang1.15.patch +# remove failing assertions due to a symlink +# BUILD/src/github.com/grafana/grafana -> BUILD/grafana-X.Y.Z +Patch3: 003-remove-dashboard-abspath-test.patch # Required for s390x # the golden files include memory dumps from a x86 machine # integers are stored as little endian on x86, but as big endian on s390x # therefore loading this memory dump fails on s390x -Patch4: 004-remove-goldenfiles-test.patch +Patch4: 004-skip-x86-goldenfiles-tests.patch # Intersection of go_arches and nodejs_arches ExclusiveArch: %{grafana_arches} @@ -64,6 +80,9 @@ ExclusiveArch: %{grafana_arches} Requires(pre): shadow-utils BuildRequires: git, systemd, golang, go-srpm-macros, go-rpm-macros +%if %{compile_frontend} +BuildRequires: nodejs >= 1:12, nodejs < 1:13, yarnpkg +%endif Obsoletes: grafana-cloudwatch < 7.1.1-1 Obsoletes: grafana-elasticsearch < 7.1.1-1 @@ -77,164 +96,324 @@ Obsoletes: grafana-opentsdb < 7.1.1-1 Obsoletes: grafana-postgres < 7.1.1-1 Obsoletes: grafana-prometheus < 7.1.1-1 Obsoletes: grafana-stackdriver < 7.1.1-1 +Provides: grafana-cloudwatch = 7.1.1-1 +Provides: grafana-elasticsearch = 7.1.1-1 +Provides: grafana-azure-monitor = 7.1.1-1 +Provides: grafana-graphite = 7.1.1-1 +Provides: grafana-influxdb = 7.1.1-1 +Provides: grafana-loki = 7.1.1-1 +Provides: grafana-mssql = 7.1.1-1 +Provides: grafana-mysql = 7.1.1-1 +Provides: grafana-opentsdb = 7.1.1-1 +Provides: grafana-postgres = 7.1.1-1 +Provides: grafana-prometheus = 7.1.1-1 +Provides: grafana-stackdriver = 7.1.1-1 %if 0%{?fedora} || 0%{?rhel} > 7 -Recommends: grafana-pcp >= 3.0.0 +Recommends: grafana-pcp %endif -# vendored golang build dependencies +# vendored golang and node.js build dependencies # Note: generated by the Makefile (see README.md) +Provides: bundled(golang(cloud.google.com/go/storage)) = 1.8.0 Provides: bundled(golang(github.com/BurntSushi/toml)) = 0.3.1 Provides: bundled(golang(github.com/VividCortex/mysqlerr)) = 0.0.0-20170204212430.6c6b55f8796f -Provides: bundled(golang(github.com/aws/aws-sdk-go)) = 1.29.20 +Provides: bundled(golang(github.com/aws/aws-sdk-go)) = 1.33.12 +Provides: bundled(golang(github.com/beevik/etree)) = 1.1.0 Provides: bundled(golang(github.com/benbjohnson/clock)) = 0.0.0-20161215174838.7dc76406b6d3 -Provides: bundled(golang(github.com/bradfitz/gomemcache)) = 0.0.0-20190329173943.551aad21a668 -Provides: bundled(golang(github.com/crewjam/saml)) = 0.0.0-20191031171751.c42136edf9b1 +Provides: bundled(golang(github.com/bradfitz/gomemcache)) = 0.0.0-20190913173617.a41fca850d0b +Provides: bundled(golang(github.com/centrifugal/centrifuge)) = 0.11.0 +Provides: bundled(golang(github.com/crewjam/saml)) = 0.4.1 Provides: bundled(golang(github.com/davecgh/go-spew)) = 1.1.1 -Provides: bundled(golang(github.com/denisenkom/go-mssqldb)) = 0.0.0-20190707035753.2be1aa521ff4 +Provides: bundled(golang(github.com/denisenkom/go-mssqldb)) = 0.0.0-20200620013148.b91950f658ec Provides: bundled(golang(github.com/facebookgo/inject)) = 0.0.0-20180706035515.f23751cae28b -Provides: bundled(golang(github.com/fatih/color)) = 1.7.0 +Provides: bundled(golang(github.com/fatih/color)) = 1.9.0 +Provides: bundled(golang(github.com/gchaincl/sqlhooks)) = 1.3.0 Provides: bundled(golang(github.com/go-macaron/binding)) = 0.0.0-20190806013118.0b4f37bab25b Provides: bundled(golang(github.com/go-macaron/gzip)) = 0.0.0-20160222043647.cad1c6580a07 Provides: bundled(golang(github.com/go-macaron/session)) = 0.0.0-20190805070824.1a3cdc6f5659 Provides: bundled(golang(github.com/go-sql-driver/mysql)) = 1.5.0 Provides: bundled(golang(github.com/go-stack/stack)) = 1.8.0 Provides: bundled(golang(github.com/gobwas/glob)) = 0.2.3 -Provides: bundled(golang(github.com/golang/protobuf)) = 1.4.0 -Provides: bundled(golang(github.com/google/go-cmp)) = 0.4.0 -Provides: bundled(golang(github.com/gorilla/websocket)) = 1.4.1 +Provides: bundled(golang(github.com/golang/protobuf)) = 1.4.2 +Provides: bundled(golang(github.com/google/go-cmp)) = 0.5.0 Provides: bundled(golang(github.com/gosimple/slug)) = 1.4.2 Provides: bundled(golang(github.com/grafana/grafana-plugin-model)) = 0.0.0-20190930120109.1fc953a61fb4 -Provides: bundled(golang(github.com/grafana/grafana-plugin-sdk-go)) = 0.75.0 -Provides: bundled(golang(github.com/hashicorp/go-hclog)) = 0.0.0-20180709165350.ff2cf002a8dd +Provides: bundled(golang(github.com/grafana/grafana-plugin-sdk-go)) = 0.78.0 +Provides: bundled(golang(github.com/grafana/loki)) = 1.6.0 +Provides: bundled(golang(github.com/grpc-ecosystem/go-grpc-middleware)) = 1.2.1 +Provides: bundled(golang(github.com/hashicorp/go-hclog)) = 0.12.2 Provides: bundled(golang(github.com/hashicorp/go-plugin)) = 1.2.2 -Provides: bundled(golang(github.com/hashicorp/go-version)) = 1.1.0 +Provides: bundled(golang(github.com/hashicorp/go-version)) = 1.2.0 Provides: bundled(golang(github.com/inconshreveable/log15)) = 0.0.0-20180818164646.67afb5ed74ec -Provides: bundled(golang(github.com/influxdata/influxdb-client-go)) = 1.3.0 -Provides: bundled(golang(github.com/jmespath/go-jmespath)) = 0.0.0-20180206201540.c2b33e8439af +Provides: bundled(golang(github.com/influxdata/influxdb-client-go/v2)) = 2.0.1 +Provides: bundled(golang(github.com/jmespath/go-jmespath)) = 0.3.0 Provides: bundled(golang(github.com/jung-kurt/gofpdf)) = 1.10.1 -Provides: bundled(golang(github.com/lib/pq)) = 1.2.0 +Provides: bundled(golang(github.com/lib/pq)) = 1.3.0 Provides: bundled(golang(github.com/linkedin/goavro/v2)) = 2.9.7 +Provides: bundled(golang(github.com/magefile/mage)) = 1.9.0 Provides: bundled(golang(github.com/mattn/go-isatty)) = 0.0.12 Provides: bundled(golang(github.com/mattn/go-sqlite3)) = 1.11.0 -Provides: bundled(golang(github.com/opentracing/opentracing-go)) = 1.1.0 +Provides: bundled(golang(github.com/opentracing/opentracing-go)) = 1.2.0 Provides: bundled(golang(github.com/patrickmn/go-cache)) = 2.1.0+incompatible Provides: bundled(golang(github.com/pkg/errors)) = 0.9.1 -Provides: bundled(golang(github.com/prometheus/client_golang)) = 1.3.0 -Provides: bundled(golang(github.com/prometheus/client_model)) = 0.1.0 -Provides: bundled(golang(github.com/prometheus/common)) = 0.7.0 +Provides: bundled(golang(github.com/prometheus/client_golang)) = 1.7.1 +Provides: bundled(golang(github.com/prometheus/client_model)) = 0.2.0 +Provides: bundled(golang(github.com/prometheus/common)) = 0.10.0 Provides: bundled(golang(github.com/robfig/cron)) = 0.0.0-20180505203441.b41be1df6967 Provides: bundled(golang(github.com/robfig/cron/v3)) = 3.0.0 -Provides: bundled(golang(github.com/smartystreets/goconvey)) = 0.0.0-20190731233626.505e41936337 -Provides: bundled(golang(github.com/stretchr/testify)) = 1.5.1 +Provides: bundled(golang(github.com/russellhaering/goxmldsig)) = 0.0.0-20200902171629.2e1fbc2c5593 +Provides: bundled(golang(github.com/smartystreets/goconvey)) = 1.6.4 +Provides: bundled(golang(github.com/stretchr/testify)) = 1.6.1 Provides: bundled(golang(github.com/teris-io/shortid)) = 0.0.0-20171029131806.771a37caa5cf Provides: bundled(golang(github.com/timberio/go-datemath)) = 0.1.1-0.20200323150745.74ddef604fff Provides: bundled(golang(github.com/ua-parser/uap-go)) = 0.0.0-20190826212731.daf92ba38329 -Provides: bundled(golang(github.com/uber/jaeger-client-go)) = 2.24.0+incompatible +Provides: bundled(golang(github.com/uber/jaeger-client-go)) = 2.25.0+incompatible Provides: bundled(golang(github.com/unknwon/com)) = 1.0.1 Provides: bundled(golang(github.com/urfave/cli/v2)) = 2.1.1 Provides: bundled(golang(github.com/xorcare/pointer)) = 1.1.0 Provides: bundled(golang(github.com/yudai/gojsondiff)) = 1.0.0 -Provides: bundled(golang(golang.org/x/crypto)) = 0.0.0-20200406173513.056763e48d71 -Provides: bundled(golang(golang.org/x/net)) = 0.0.0-20200501053045.e0ff5e5a1de5 +Provides: bundled(golang(golang.org/x/crypto)) = 0.0.0-20200820211705.5c72a883971a +Provides: bundled(golang(golang.org/x/net)) = 0.0.0-20200813134508.3edf25e44fcc Provides: bundled(golang(golang.org/x/oauth2)) = 0.0.0-20200107190931.bf48bf16ab8d -Provides: bundled(golang(golang.org/x/sync)) = 0.0.0-20200317015054.43a5402ce75a -Provides: bundled(golang(golang.org/x/xerrors)) = 0.0.0-20191204190536.9bdfabe68543 -Provides: bundled(golang(google.golang.org/grpc)) = 1.29.1 -Provides: bundled(golang(gopkg.in/ini.v1)) = 1.46.0 +Provides: bundled(golang(golang.org/x/sync)) = 0.0.0-20200625203802.6e8e738ad208 +Provides: bundled(golang(google.golang.org/grpc)) = 1.30.0 +Provides: bundled(golang(gopkg.in/ini.v1)) = 1.51.0 Provides: bundled(golang(gopkg.in/ldap.v3)) = 3.0.2 Provides: bundled(golang(gopkg.in/macaron.v1)) = 1.3.9 Provides: bundled(golang(gopkg.in/mail.v2)) = 2.3.1 Provides: bundled(golang(gopkg.in/redis.v5)) = 5.2.9 Provides: bundled(golang(gopkg.in/square/go-jose.v2)) = 2.4.1 -Provides: bundled(golang(gopkg.in/yaml.v2)) = 2.2.8 +Provides: bundled(golang(gopkg.in/yaml.v2)) = 2.3.0 Provides: bundled(golang(xorm.io/core)) = 0.7.3 Provides: bundled(golang(xorm.io/xorm)) = 0.8.1 -# Declare all nodejs modules bundled in the webpack - this is for security -# purposes so if nodejs-foo ever needs an update, affected packages can be -# easily identified. -# Note: generated with the Makefile (see README.md) -Provides: bundled(nodejs-@grafana/slate-react) = 0.22.9-grafana -Provides: bundled(nodejs-@reduxjs/toolkit) = 1.3.4 -Provides: bundled(nodejs-@torkelo/react-select) = 3.0.8 -Provides: bundled(nodejs-@types/antlr4) = 4.7.1 -Provides: bundled(nodejs-@types/braintree__sanitize-url) = 4.0.0 -Provides: bundled(nodejs-@types/common-tags) = 1.8.0 -Provides: bundled(nodejs-@types/jsurl) = 1.2.28 -Provides: bundled(nodejs-@types/md5) = 2.1.33 -Provides: bundled(nodejs-@types/react-loadable) = 5.5.2 -Provides: bundled(nodejs-@types/react-virtualized-auto-sizer) = 1.0.0 -Provides: bundled(nodejs-@welldone-software/why-did-you-render) = 4.0.6 -Provides: bundled(nodejs-abortcontroller-polyfill) = 1.4.0 -Provides: bundled(nodejs-angular) = 1.6.9 -Provides: bundled(nodejs-angular-bindonce) = 0.3.1 -Provides: bundled(nodejs-angular-native-dragdrop) = 1.2.2 -Provides: bundled(nodejs-angular-route) = 1.6.6 -Provides: bundled(nodejs-angular-sanitize) = 1.6.6 -Provides: bundled(nodejs-antlr4) = 4.8.0 -Provides: bundled(nodejs-baron) = 3.0.3 -Provides: bundled(nodejs-brace) = 0.11.1 -Provides: bundled(nodejs-calculate-size) = 1.1.1 -Provides: bundled(nodejs-classnames) = 2.2.6 -Provides: bundled(nodejs-clipboard) = 2.0.4 -Provides: bundled(nodejs-common-tags) = 1.8.0 -Provides: bundled(nodejs-core-js) = 1.2.7 -Provides: bundled(nodejs-d3) = 5.15.0 -Provides: bundled(nodejs-d3-scale-chromatic) = 1.5.0 -Provides: bundled(nodejs-dangerously-set-html-content) = 1.0.6 -Provides: bundled(nodejs-emotion) = 10.0.27 -Provides: bundled(nodejs-eventemitter3) = 3.1.2 -Provides: bundled(nodejs-fast-text-encoding) = 1.0.0 -Provides: bundled(nodejs-file-saver) = 2.0.2 -Provides: bundled(nodejs-hoist-non-react-statics) = 2.5.5 -Provides: bundled(nodejs-immutable) = 3.8.2 -Provides: bundled(nodejs-is-hotkey) = 0.1.4 -Provides: bundled(nodejs-jquery) = 3.4.1 -Provides: bundled(nodejs-jsurl) = 0.1.5 -Provides: bundled(nodejs-lodash) = 3.10.1 -Provides: bundled(nodejs-lru-cache) = 4.1.5 -Provides: bundled(nodejs-marked) = 0.3.19 -Provides: bundled(nodejs-md5) = 2.2.1 -Provides: bundled(nodejs-memoize-one) = 4.1.0 -Provides: bundled(nodejs-moment) = 2.24.0 -Provides: bundled(nodejs-moment-timezone) = 0.5.28 -Provides: bundled(nodejs-mousetrap) = 1.6.5 -Provides: bundled(nodejs-mousetrap-global-bind) = 1.1.0 -Provides: bundled(nodejs-nodemon) = 2.0.2 -Provides: bundled(nodejs-papaparse) = 4.6.3 -Provides: bundled(nodejs-prismjs) = 1.17.1 -Provides: bundled(nodejs-prop-types) = 15.7.2 -Provides: bundled(nodejs-rc-cascader) = 1.0.1 -Provides: bundled(nodejs-re-resizable) = 6.2.0 -Provides: bundled(nodejs-react) = 16.10.2 -Provides: bundled(nodejs-react-dom) = 16.10.2 -Provides: bundled(nodejs-react-grid-layout) = 0.17.1 -Provides: bundled(nodejs-react-highlight-words) = 0.16.0 -Provides: bundled(nodejs-react-loadable) = 5.5.0 -Provides: bundled(nodejs-react-popper) = 1.3.3 -Provides: bundled(nodejs-react-redux) = 7.2.0 -Provides: bundled(nodejs-react-sizeme) = 2.6.8 -Provides: bundled(nodejs-react-split-pane) = 0.1.89 -Provides: bundled(nodejs-react-transition-group) = 2.9.0 -Provides: bundled(nodejs-react-use) = 13.27.0 -Provides: bundled(nodejs-react-virtualized-auto-sizer) = 1.0.2 -Provides: bundled(nodejs-react-window) = 1.8.5 -Provides: bundled(nodejs-redux) = 3.7.2 -Provides: bundled(nodejs-redux-logger) = 3.0.6 -Provides: bundled(nodejs-redux-thunk) = 2.3.0 -Provides: bundled(nodejs-regenerator-runtime) = 0.11.1 -Provides: bundled(nodejs-reselect) = 4.0.0 -Provides: bundled(nodejs-rst2html) = 1.0.4 -Provides: bundled(nodejs-rxjs) = 6.5.5 -Provides: bundled(nodejs-search-query-parser) = 1.5.4 -Provides: bundled(nodejs-slate) = 0.47.8 -Provides: bundled(nodejs-slate-plain-serializer) = 0.7.10 -Provides: bundled(nodejs-tether) = 1.4.7 -Provides: bundled(nodejs-tether-drop) = 1.5.0 -Provides: bundled(nodejs-tinycolor2) = 1.4.1 -Provides: bundled(nodejs-tti-polyfill) = 0.2.2 -Provides: bundled(nodejs-whatwg-fetch) = 3.0.0 +Provides: bundled(npm(@babel/core)) = 7.6.2 +Provides: bundled(npm(@babel/plugin-proposal-nullish-coalescing-operator)) = 7.8.3 +Provides: bundled(npm(@babel/plugin-proposal-optional-chaining)) = 7.8.3 +Provides: bundled(npm(@babel/plugin-syntax-dynamic-import)) = 7.2.0 +Provides: bundled(npm(@babel/preset-env)) = 7.6.3 +Provides: bundled(npm(@babel/preset-react)) = 7.6.3 +Provides: bundled(npm(@babel/preset-typescript)) = 7.8.3 +Provides: bundled(npm(@emotion/core)) = 10.0.21 +Provides: bundled(npm(@grafana/api-documenter)) = 0.9.3 +Provides: bundled(npm(@grafana/api-extractor)) = 7.10.1 +Provides: bundled(npm(@grafana/eslint-config)) = 2.0.3 +Provides: bundled(npm(@grafana/slate-react)) = 0.22.9-grafana +Provides: bundled(npm(@reduxjs/toolkit)) = 1.3.4 +Provides: bundled(npm(@rtsao/plugin-proposal-class-properties)) = 7.0.1-patch.1 +Provides: bundled(npm(@testing-library/jest-dom)) = 5.11.3 +Provides: bundled(npm(@testing-library/react)) = 10.4.8 +Provides: bundled(npm(@testing-library/react-hooks)) = 3.2.1 +Provides: bundled(npm(@testing-library/user-event)) = 12.1.3 +Provides: bundled(npm(@torkelo/react-select)) = 3.0.8 +Provides: bundled(npm(@types/angular)) = 1.6.56 +Provides: bundled(npm(@types/angular-route)) = 1.7.0 +Provides: bundled(npm(@types/antlr4)) = 4.7.1 +Provides: bundled(npm(@types/braintree__sanitize-url)) = 4.0.0 +Provides: bundled(npm(@types/classnames)) = 2.2.7 +Provides: bundled(npm(@types/clipboard)) = 2.0.1 +Provides: bundled(npm(@types/common-tags)) = 1.8.0 +Provides: bundled(npm(@types/d3)) = 5.7.2 +Provides: bundled(npm(@types/d3-scale-chromatic)) = 1.3.1 +Provides: bundled(npm(@types/enzyme)) = 3.10.3 +Provides: bundled(npm(@types/enzyme-adapter-react-16)) = 1.0.6 +Provides: bundled(npm(@types/file-saver)) = 2.0.1 +Provides: bundled(npm(@types/hoist-non-react-statics)) = 3.3.1 +Provides: bundled(npm(@types/is-hotkey)) = 0.1.1 +Provides: bundled(npm(@types/jest)) = 23.3.14 +Provides: bundled(npm(@types/jquery)) = 3.3.38 +Provides: bundled(npm(@types/jsurl)) = 1.2.28 +Provides: bundled(npm(@types/lodash)) = 4.14.123 +Provides: bundled(npm(@types/lru-cache)) = 5.1.0 +Provides: bundled(npm(@types/marked)) = 1.1.0 +Provides: bundled(npm(@types/md5)) = 2.1.33 +Provides: bundled(npm(@types/moment-timezone)) = 0.5.13 +Provides: bundled(npm(@types/mousetrap)) = 1.6.3 +Provides: bundled(npm(@types/node)) = 10.14.1 +Provides: bundled(npm(@types/papaparse)) = 5.2.0 +Provides: bundled(npm(@types/prismjs)) = 1.16.0 +Provides: bundled(npm(@types/react)) = 16.8.16 +Provides: bundled(npm(@types/react-beautiful-dnd)) = 12.1.2 +Provides: bundled(npm(@types/react-dom)) = 16.8.4 +Provides: bundled(npm(@types/react-grid-layout)) = 0.16.7 +Provides: bundled(npm(@types/react-loadable)) = 5.5.2 +Provides: bundled(npm(@types/react-redux)) = 7.1.7 +Provides: bundled(npm(@types/react-select)) = 3.0.8 +Provides: bundled(npm(@types/react-test-renderer)) = 16.9.1 +Provides: bundled(npm(@types/react-transition-group)) = 4.2.3 +Provides: bundled(npm(@types/react-virtualized-auto-sizer)) = 1.0.0 +Provides: bundled(npm(@types/react-window)) = 1.8.1 +Provides: bundled(npm(@types/redux-logger)) = 3.0.7 +Provides: bundled(npm(@types/redux-mock-store)) = 1.0.2 +Provides: bundled(npm(@types/reselect)) = 2.2.0 +Provides: bundled(npm(@types/slate)) = 0.47.1 +Provides: bundled(npm(@types/slate-plain-serializer)) = 0.6.1 +Provides: bundled(npm(@types/slate-react)) = 0.22.5 +Provides: bundled(npm(@types/sockjs-client)) = 1.1.1 +Provides: bundled(npm(@types/testing-library__jest-dom)) = 5.9.2 +Provides: bundled(npm(@types/testing-library__react-hooks)) = 3.1.0 +Provides: bundled(npm(@types/tinycolor2)) = 1.4.1 +Provides: bundled(npm(@types/uuid)) = 8.3.0 +Provides: bundled(npm(@typescript-eslint/eslint-plugin)) = 4.0.1 +Provides: bundled(npm(@typescript-eslint/parser)) = 4.0.1 +Provides: bundled(npm(@welldone-software/why-did-you-render)) = 4.0.6 +Provides: bundled(npm(abortcontroller-polyfill)) = 1.4.0 +Provides: bundled(npm(angular)) = 1.6.9 +Provides: bundled(npm(angular-bindonce)) = 0.3.1 +Provides: bundled(npm(angular-mocks)) = 1.6.6 +Provides: bundled(npm(angular-native-dragdrop)) = 1.2.2 +Provides: bundled(npm(angular-route)) = 1.6.6 +Provides: bundled(npm(angular-sanitize)) = 1.6.6 +Provides: bundled(npm(antlr4)) = 4.8.0 +Provides: bundled(npm(autoprefixer)) = 9.7.4 +Provides: bundled(npm(axios)) = 0.19.0 +Provides: bundled(npm(babel-core)) = 7.0.0-bridge.0 +Provides: bundled(npm(babel-jest)) = 24.8.0 +Provides: bundled(npm(babel-loader)) = 8.0.6 +Provides: bundled(npm(babel-plugin-angularjs-annotate)) = 0.10.0 +Provides: bundled(npm(baron)) = 3.0.3 +Provides: bundled(npm(brace)) = 0.11.1 +Provides: bundled(npm(calculate-size)) = 1.1.1 +Provides: bundled(npm(centrifuge)) = 2.6.4 +Provides: bundled(npm(classnames)) = 2.2.6 +Provides: bundled(npm(clean-webpack-plugin)) = 3.0.0 +Provides: bundled(npm(clipboard)) = 2.0.4 +Provides: bundled(npm(common-tags)) = 1.8.0 +Provides: bundled(npm(core-js)) = 1.2.7 +Provides: bundled(npm(css-loader)) = 3.2.0 +Provides: bundled(npm(d3)) = 5.15.0 +Provides: bundled(npm(d3-scale-chromatic)) = 1.5.0 +Provides: bundled(npm(dangerously-set-html-content)) = 1.0.6 +Provides: bundled(npm(emotion)) = 10.0.27 +Provides: bundled(npm(enzyme)) = 3.11.0 +Provides: bundled(npm(enzyme-adapter-react-16)) = 1.15.2 +Provides: bundled(npm(enzyme-to-json)) = 3.4.4 +Provides: bundled(npm(es6-promise)) = 4.2.8 +Provides: bundled(npm(es6-shim)) = 0.35.5 +Provides: bundled(npm(eslint)) = 2.13.1 +Provides: bundled(npm(eslint-config-prettier)) = 6.11.0 +Provides: bundled(npm(eslint-plugin-jsdoc)) = 28.6.1 +Provides: bundled(npm(eslint-plugin-prettier)) = 3.1.4 +Provides: bundled(npm(eslint-plugin-react-hooks)) = 4.0.5 +Provides: bundled(npm(eventemitter3)) = 3.1.2 +Provides: bundled(npm(expect.js)) = 0.3.1 +Provides: bundled(npm(expose-loader)) = 0.7.5 +Provides: bundled(npm(fast-text-encoding)) = 1.0.0 +Provides: bundled(npm(file-loader)) = 4.3.0 +Provides: bundled(npm(file-saver)) = 2.0.2 +Provides: bundled(npm(fork-ts-checker-webpack-plugin)) = 1.0.0 +Provides: bundled(npm(gaze)) = 1.1.3 +Provides: bundled(npm(glob)) = 5.0.15 +Provides: bundled(npm(grunt)) = 1.0.4 +Provides: bundled(npm(grunt-angular-templates)) = 1.1.0 +Provides: bundled(npm(grunt-cli)) = 1.2.0 +Provides: bundled(npm(grunt-contrib-clean)) = 2.0.0 +Provides: bundled(npm(grunt-contrib-compress)) = 1.6.0 +Provides: bundled(npm(grunt-contrib-copy)) = 1.0.0 +Provides: bundled(npm(grunt-exec)) = 3.0.0 +Provides: bundled(npm(grunt-newer)) = 1.3.0 +Provides: bundled(npm(grunt-notify)) = 0.4.5 +Provides: bundled(npm(grunt-postcss)) = 0.9.0 +Provides: bundled(npm(grunt-sass-lint)) = 0.2.4 +Provides: bundled(npm(grunt-usemin)) = 3.1.1 +Provides: bundled(npm(grunt-webpack)) = 3.1.3 +Provides: bundled(npm(hoist-non-react-statics)) = 2.5.5 +Provides: bundled(npm(html-loader)) = 0.5.5 +Provides: bundled(npm(html-webpack-harddisk-plugin)) = 1.0.1 +Provides: bundled(npm(html-webpack-plugin)) = 3.2.0 +Provides: bundled(npm(husky)) = 4.2.1 +Provides: bundled(npm(immutable)) = 3.8.2 +Provides: bundled(npm(is-hotkey)) = 0.1.4 +Provides: bundled(npm(jest)) = 25.5.4 +Provides: bundled(npm(jest-canvas-mock)) = 2.1.2 +Provides: bundled(npm(jest-date-mock)) = 1.0.8 +Provides: bundled(npm(jquery)) = 3.4.1 +Provides: bundled(npm(jsurl)) = 0.1.5 +Provides: bundled(npm(lerna)) = 3.20.2 +Provides: bundled(npm(lint-staged)) = 10.0.7 +Provides: bundled(npm(load-grunt-tasks)) = 5.1.0 +Provides: bundled(npm(lodash)) = 3.10.1 +Provides: bundled(npm(lru-cache)) = 4.1.5 +Provides: bundled(npm(marked)) = 0.3.19 +Provides: bundled(npm(md5)) = 2.2.1 +Provides: bundled(npm(memoize-one)) = 4.1.0 +Provides: bundled(npm(mini-css-extract-plugin)) = 0.7.0 +Provides: bundled(npm(mocha)) = 7.0.1 +Provides: bundled(npm(module-alias)) = 2.2.2 +Provides: bundled(npm(moment)) = 2.24.0 +Provides: bundled(npm(moment-timezone)) = 0.5.28 +Provides: bundled(npm(monaco-editor)) = 0.20.0 +Provides: bundled(npm(monaco-editor-webpack-plugin)) = 1.9.0 +Provides: bundled(npm(mousetrap)) = 1.6.5 +Provides: bundled(npm(mousetrap-global-bind)) = 1.1.0 +Provides: bundled(npm(mutationobserver-shim)) = 0.3.3 +Provides: bundled(npm(ngtemplate-loader)) = 2.0.1 +Provides: bundled(npm(node-sass)) = 4.13.1 +Provides: bundled(npm(nodemon)) = 2.0.2 +Provides: bundled(npm(optimize-css-assets-webpack-plugin)) = 5.0.3 +Provides: bundled(npm(papaparse)) = 4.6.3 +Provides: bundled(npm(postcss-browser-reporter)) = 0.6.0 +Provides: bundled(npm(postcss-loader)) = 3.0.0 +Provides: bundled(npm(postcss-reporter)) = 6.0.1 +Provides: bundled(npm(prettier)) = 1.18.2 +Provides: bundled(npm(prismjs)) = 1.17.1 +Provides: bundled(npm(prop-types)) = 15.7.2 +Provides: bundled(npm(rc-cascader)) = 1.0.1 +Provides: bundled(npm(re-resizable)) = 6.2.0 +Provides: bundled(npm(react)) = 16.10.2 +Provides: bundled(npm(react-dom)) = 16.10.2 +Provides: bundled(npm(react-grid-layout)) = 0.17.1 +Provides: bundled(npm(react-highlight-words)) = 0.16.0 +Provides: bundled(npm(react-hot-loader)) = 4.8.0 +Provides: bundled(npm(react-loadable)) = 5.5.0 +Provides: bundled(npm(react-popper)) = 1.3.3 +Provides: bundled(npm(react-redux)) = 7.2.0 +Provides: bundled(npm(react-reverse-portal)) = 2.0.1 +Provides: bundled(npm(react-sizeme)) = 2.6.8 +Provides: bundled(npm(react-split-pane)) = 0.1.89 +Provides: bundled(npm(react-test-renderer)) = 16.10.2 +Provides: bundled(npm(react-transition-group)) = 2.9.0 +Provides: bundled(npm(react-use)) = 13.27.0 +Provides: bundled(npm(react-virtualized-auto-sizer)) = 1.0.2 +Provides: bundled(npm(react-window)) = 1.8.5 +Provides: bundled(npm(redux)) = 3.7.2 +Provides: bundled(npm(redux-logger)) = 3.0.6 +Provides: bundled(npm(redux-mock-store)) = 1.5.4 +Provides: bundled(npm(redux-thunk)) = 2.3.0 +Provides: bundled(npm(regenerator-runtime)) = 0.11.1 +Provides: bundled(npm(regexp-replace-loader)) = 1.0.1 +Provides: bundled(npm(reselect)) = 4.0.0 +Provides: bundled(npm(rimraf)) = 2.6.3 +Provides: bundled(npm(rst2html)) = 1.0.4 +Provides: bundled(npm(rxjs)) = 6.5.5 +Provides: bundled(npm(rxjs-spy)) = 7.5.1 +Provides: bundled(npm(sass-lint)) = 1.12.1 +Provides: bundled(npm(sass-loader)) = 8.0.2 +Provides: bundled(npm(search-query-parser)) = 1.5.4 +Provides: bundled(npm(sinon)) = 8.1.1 +Provides: bundled(npm(slate)) = 0.47.8 +Provides: bundled(npm(slate-plain-serializer)) = 0.7.10 +Provides: bundled(npm(sockjs-client)) = 1.4.0 +Provides: bundled(npm(style-loader)) = 1.1.3 +Provides: bundled(npm(terser-webpack-plugin)) = 1.4.1 +Provides: bundled(npm(tether)) = 1.4.7 +Provides: bundled(npm(tether-drop)) = 1.5.0 +Provides: bundled(npm(tinycolor2)) = 1.4.1 +Provides: bundled(npm(ts-jest)) = 26.3.0 +Provides: bundled(npm(ts-node)) = 8.8.1 +Provides: bundled(npm(tslib)) = 1.10.0 +Provides: bundled(npm(tti-polyfill)) = 0.2.2 +Provides: bundled(npm(typescript)) = 3.7.5 +Provides: bundled(npm(uuid)) = 3.3.3 +Provides: bundled(npm(webpack)) = 4.41.2 +Provides: bundled(npm(webpack-bundle-analyzer)) = 3.6.0 +Provides: bundled(npm(webpack-cleanup-plugin)) = 0.5.1 +Provides: bundled(npm(webpack-cli)) = 3.3.10 +Provides: bundled(npm(webpack-dev-server)) = 3.10.3 +Provides: bundled(npm(webpack-merge)) = 4.2.2 +Provides: bundled(npm(whatwg-fetch)) = 3.0.0 +Provides: bundled(npm(zone.js)) = 0.7.8 %description @@ -244,27 +423,34 @@ Graphite, InfluxDB & OpenTSDB. %prep %setup -q -T -D -b 0 -rm -r plugins-bundled # compiled bundled plugins are in grafana-webpack %setup -q -T -D -b 1 +%if %{compile_frontend} == 0 +# remove bundled plugins source, otherwise they'll get merged +# with the compiled bundled plugins when extracting the webpack +rm -r plugins-bundled +%endif %setup -q -T -D -b 2 %patch1 -p1 %patch2 -p1 -%if 0%{?fedora} >= 33 %patch3 -p1 -%endif %ifarch s390x %patch4 -p1 %endif # Set up build subdirs and links mkdir -p %{_builddir}/src/github.com/grafana -ln -sf %{_builddir}/%{name}-%{version} \ +ln -s %{_builddir}/%{name}-%{version} \ %{_builddir}/src/github.com/grafana/grafana %build -# Build the server-side binaries +# Build the frontend +%if %{compile_frontend} +%{SOURCE4} +%endif + +# Build the backend cd %{_builddir}/src/github.com/grafana/grafana export GOPATH=%{_builddir} @@ -364,12 +550,20 @@ chmod 640 %{_sysconfdir}/%{name}/ldap.toml %check +# Frontend tests +%if %{compile_frontend} +yarn test +%endif + +# Backend tests cd %{_builddir}/src/github.com/grafana/grafana export GOPATH=%{_builddir} -# remove tests currently failing - these two are due to a symlink -# BUILD/src/github.com/grafana/grafana -> BUILD/grafana-6.6.1 -rm -f pkg/services/provisioning/dashboards/file_reader_linux_test.go -rm -f pkg/services/provisioning/dashboards/file_reader_test.go + +# in setting_test.go there is a unit test which checks if 10 days are 240 hours +# which is usually true except if the dayligt saving time change falls into the last 10 days, then it's either 239 or 241 hours... +# let's set the time zone to a time zone without daylight saving time +export TZ=GMT + %gotest ./pkg/... @@ -380,22 +574,19 @@ rm -f pkg/services/provisioning/dashboards/file_reader_test.go %{_libexecdir}/%{name} # config files +%config(noreplace) %{_sysconfdir}/sysconfig/grafana-server %dir %{_sysconfdir}/%{name} %attr(0755, root, %{GRAFANA_GROUP}) %dir %{_sysconfdir}/%{name}/provisioning %attr(0755, root, %{GRAFANA_GROUP}) %dir %{_sysconfdir}/%{name}/provisioning/dashboards -%attr(0755, root, %{GRAFANA_GROUP}) %dir %{_sysconfdir}/%{name}/provisioning/datasources +%attr(0750, root, %{GRAFANA_GROUP}) %dir %{_sysconfdir}/%{name}/provisioning/datasources %attr(0755, root, %{GRAFANA_GROUP}) %dir %{_sysconfdir}/%{name}/provisioning/notifiers %attr(0755, root, %{GRAFANA_GROUP}) %dir %{_sysconfdir}/%{name}/provisioning/plugins -%config(noreplace) %attr(0640, root, %{GRAFANA_GROUP}) %{_sysconfdir}/%{name}/grafana.ini -%config(noreplace) %attr(0640, root, %{GRAFANA_GROUP}) %{_sysconfdir}/%{name}/ldap.toml -%config(noreplace) %{_sysconfdir}/sysconfig/grafana-server - -# Grafana configuration to dynamically create /run/grafana/grafana.pid on tmpfs -%{_tmpfilesdir}/%{name}.conf +%attr(0640, root, %{GRAFANA_GROUP}) %config(noreplace) %{_sysconfdir}/%{name}/grafana.ini +%attr(0640, root, %{GRAFANA_GROUP}) %config(noreplace) %{_sysconfdir}/%{name}/ldap.toml # config database directory and plugins %attr(0750, %{GRAFANA_USER}, %{GRAFANA_GROUP}) %dir %{_sharedstatedir}/%{name} -%attr(-, %{GRAFANA_USER}, %{GRAFANA_GROUP}) %dir %{_sharedstatedir}/%{name}/plugins +%attr(-, %{GRAFANA_USER}, %{GRAFANA_GROUP}) %dir %{_sharedstatedir}/%{name}/plugins # shared directory and all files therein %{_datadir}/%{name} @@ -404,6 +595,9 @@ rm -f pkg/services/provisioning/dashboards/file_reader_test.go # systemd service file %{_unitdir}/grafana-server.service +# Grafana configuration to dynamically create /run/grafana/grafana.pid on tmpfs +%{_tmpfilesdir}/%{name}.conf + # log directory - grafana.log is created by grafana-server, and it does it's own log rotation %attr(0755, %{GRAFANA_USER}, %{GRAFANA_GROUP}) %dir %{_localstatedir}/log/%{name} @@ -418,6 +612,12 @@ rm -f pkg/services/provisioning/dashboards/file_reader_test.go %changelog +* Tue Nov 10 2020 Andreas Gerstmayr 7.3.1-1 +- update to 7.3.1 tagged upstream community sources, see CHANGELOG +- optionally bundle node.js dependencies and build and test frontend as part of the specfile +- change default provisioning path to /etc/grafana/provisioning (changed in version 7.1.1-1) +- resolve https://bugzilla.redhat.com/show_bug.cgi?id=1843170 + * Sat Aug 01 2020 Fedora Release Engineering - 7.1.1-2 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild diff --git a/create_webpack_manifest.py b/list_bundled_nodejs_packages.py similarity index 89% rename from create_webpack_manifest.py rename to list_bundled_nodejs_packages.py index 0f62106..f5490c4 100755 --- a/create_webpack_manifest.py +++ b/list_bundled_nodejs_packages.py @@ -8,7 +8,7 @@ from packaging import version def read_declared_pkgs(package_json_path): with open(package_json_path) as f: package_json = json.load(f) - return list(package_json['dependencies'].keys()) + return list(package_json['dependencies'].keys()) + list(package_json['devDependencies'].keys()) def read_installed_pkgs(yarn_lock_path): @@ -28,7 +28,7 @@ def list_provides(declared_pkgs, installed_pkgs): versions = [version.parse(pkg_version) for pkg_name, pkg_version in installed_pkgs if pkg_name == declared_pkg] oldest_version = sorted(versions)[0] - yield f"Provides: bundled(nodejs-{declared_pkg}) = {oldest_version}" + yield f"Provides: bundled(npm({declared_pkg})) = {oldest_version}" if __name__ == "__main__": diff --git a/sources b/sources index 0bf5376..a6e73c7 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (grafana-7.1.1.tar.gz) = 487322d6d26cdc1ce6fc03719ded482380c2be4bb01279367ff166b2bc9e3ca7691edc32a6c42bb9a64eb39d6620ca47855786e259dbfeb636585add5e1fe5b0 -SHA512 (grafana-vendor-7.1.1.tar.gz) = 966ec92abdd644e4a189e8c381c0ffc6e54995983ae4746eee183cdc65a6817e3368faf1366990795cb18299fe8a9883257ba7e2b7b5f24db0631e16ae223884 -SHA512 (grafana-webpack-7.1.1.tar.gz) = 5e271ecd9539dba4f902d3c2a14e5deb5b0f1fa686d20bf6ac3db11af54c6571477a56d270dae9c43f374c485c7cdc48155acfdeb7428ac3a1a09dd6abc71d90 +SHA512 (grafana-7.3.1.tar.gz) = 95e12158c58f99e5479aa042eccaed402957f3d05b8ecaf36aed8737ad3a33970a7204aeb1e6da1e58beb3144f29acf98ffa73b96fd6469ce73e66be0ac85f36 +SHA512 (grafana-vendor-go-7.3.1.tar.gz) = 76ae7c96f62a04ca3fa03dfd5637e257678ae740a494f81293c928e7b5735ef5cea51a1e5b7fb756f8ed0ad079dfa8f26249885253b6357519a2aa58737853c4 +SHA512 (grafana-webpack-7.3.1.tar.gz) = 6b1712177a53c1d7c6ee22c28ab3bd553c1b1b5b70539de4c9248ab97659a9ba862ab703280b607ac5664f6632ace8abc62c589983a3e635b73be0ed05d55b64