From ea030e8bbd53dc08163079bd781c8b23efbf0540 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Fri, 1 Oct 2021 10:11:03 -0400 Subject: [PATCH] Prometheus: metrics browser: handle label values with special characters (#39713) (#39858) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * prometheus: handle label-values with special characters * added comment (cherry picked from commit d363c368536d1d0da82392d4aa102953ceb0b25e) Co-authored-by: Gábor Farkas --- .drone.yml | 384 ++++++++---------- .../components/PrometheusMetricsBrowser.tsx | 5 +- .../datasource/prometheus/datasource.ts | 3 + .../prometheus/language_utils.test.ts | 50 ++- .../datasource/prometheus/language_utils.ts | 25 ++ scripts/drone/steps/lib.star | 8 +- 6 files changed, 249 insertions(+), 226 deletions(-) diff --git a/.drone.yml b/.drone.yml index 4d8e1074a03..9ece1312212 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,7 +14,7 @@ steps: - echo $DRONE_RUNNER_NAME - name: initialize - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - mkdir -p bin - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.4.6/grabpl @@ -23,14 +23,12 @@ steps: - curl -fLO https://github.com/jwilder/dockerize/releases/download/v$${DOCKERIZE_VERSION}/dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - tar -C bin -xzvf dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - rm dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - yarn install --frozen-lockfile --no-progress environment: DOCKERIZE_VERSION: 0.6.1 - name: codespell - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - "echo -e \"unknwon\nreferer\nerrorstring\neror\niam\nwan\" > words_to_ignore.txt" - codespell -I words_to_ignore.txt docs/ @@ -38,14 +36,14 @@ steps: - initialize - name: shellcheck - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl shellcheck depends_on: - initialize - name: lint-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - make gen-go - ./bin/grabpl lint-backend --edition oss @@ -55,7 +53,7 @@ steps: - initialize - name: test-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - "[ $(grep FocusConvey -R pkg | wc -l) -eq \"0\" ] || exit 1" - ./bin/grabpl test-backend --edition oss @@ -64,7 +62,7 @@ steps: - lint-backend - name: test-frontend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - yarn run ci:test-frontend environment: @@ -73,35 +71,35 @@ steps: - lint-backend - name: build-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-backend --jobs 8 --edition oss --build-id ${DRONE_BUILD_NUMBER} --variants linux-x64,linux-x64-musl,osx64,win64,armv6 --no-pull-enterprise depends_on: - test-backend - name: build-frontend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-frontend --jobs 8 --no-install-deps --edition oss --build-id ${DRONE_BUILD_NUMBER} --no-pull-enterprise depends_on: - test-frontend - name: build-plugins - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-plugins --jobs 8 --edition oss --no-install-deps depends_on: - lint-backend - name: validate-scuemata - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/linux-amd64/grafana-cli cue validate-schema --grafana-root . depends_on: - build-backend - name: gen-version - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl gen-version --build-id ${DRONE_BUILD_NUMBER} depends_on: @@ -112,14 +110,14 @@ steps: - shellcheck - name: package - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - . scripts/build/gpg-test-vars.sh && ./bin/grabpl package --jobs 8 --edition oss --build-id ${DRONE_BUILD_NUMBER} --no-pull-enterprise --variants linux-x64,linux-x64-musl,osx64,win64,armv6 depends_on: - gen-version - name: end-to-end-tests-server - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 detach: true commands: - ./e2e/start-server @@ -139,7 +137,7 @@ steps: - end-to-end-tests-server - name: build-storybook - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - yarn storybook:build - ./bin/grabpl verify-storybook @@ -163,7 +161,7 @@ steps: - end-to-end-tests-server - name: build-frontend-docs - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./scripts/ci-reference-docs-lint.sh ci depends_on: @@ -179,7 +177,7 @@ steps: - build-frontend-docs - name: copy-packages-for-docker - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ls dist/*.tar.gz* - cp dist/*.tar.gz* packaging/docker/ @@ -196,10 +194,8 @@ steps: - copy-packages-for-docker - name: postgres-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - apt-get install -yq postgresql-client - ./bin/dockerize -wait tcp://postgres:5432 -timeout 120s - psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql @@ -214,10 +210,8 @@ steps: - test-frontend - name: mysql-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - apt-get install -yq default-mysql-client - ./bin/dockerize -wait tcp://mysql:3306 -timeout 120s - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root -prootpass @@ -269,7 +263,7 @@ steps: - echo $DRONE_RUNNER_NAME - name: initialize - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - mkdir -p bin - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.4.6/grabpl @@ -278,8 +272,6 @@ steps: - curl -fLO https://github.com/jwilder/dockerize/releases/download/v$${DOCKERIZE_VERSION}/dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - tar -C bin -xzvf dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - rm dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - yarn install --frozen-lockfile --no-progress environment: DOCKERIZE_VERSION: 0.6.1 @@ -297,7 +289,7 @@ steps: from_secret: drone_token - name: codespell - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - "echo -e \"unknwon\nreferer\nerrorstring\neror\niam\nwan\" > words_to_ignore.txt" - codespell -I words_to_ignore.txt docs/ @@ -305,14 +297,14 @@ steps: - initialize - name: shellcheck - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl shellcheck depends_on: - initialize - name: lint-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - make gen-go - ./bin/grabpl lint-backend --edition oss @@ -322,7 +314,7 @@ steps: - initialize - name: test-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - "[ $(grep FocusConvey -R pkg | wc -l) -eq \"0\" ] || exit 1" - ./bin/grabpl test-backend --edition oss @@ -331,7 +323,7 @@ steps: - lint-backend - name: test-frontend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - yarn run ci:test-frontend environment: @@ -340,21 +332,21 @@ steps: - lint-backend - name: build-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-backend --jobs 8 --edition oss --build-id ${DRONE_BUILD_NUMBER} --no-pull-enterprise depends_on: - test-backend - name: build-frontend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-frontend --jobs 8 --no-install-deps --edition oss --build-id ${DRONE_BUILD_NUMBER} --no-pull-enterprise depends_on: - test-frontend - name: build-plugins - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-plugins --jobs 8 --edition oss --no-install-deps --sign --signing-admin environment: @@ -364,14 +356,14 @@ steps: - lint-backend - name: validate-scuemata - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/linux-amd64/grafana-cli cue validate-schema --grafana-root . depends_on: - build-backend - name: gen-version - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl gen-version --build-id ${DRONE_BUILD_NUMBER} depends_on: @@ -382,7 +374,7 @@ steps: - shellcheck - name: package - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl package --jobs 8 --edition oss --build-id ${DRONE_BUILD_NUMBER} --no-pull-enterprise --sign environment: @@ -400,7 +392,7 @@ steps: - gen-version - name: end-to-end-tests-server - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 detach: true commands: - ./e2e/start-server @@ -420,7 +412,7 @@ steps: - end-to-end-tests-server - name: build-storybook - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - yarn storybook:build - ./bin/grabpl verify-storybook @@ -457,7 +449,7 @@ steps: - end-to-end-tests-server - name: publish-frontend-metrics - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./scripts/ci-frontend-metrics.sh | ./bin/grabpl publish-metrics $${GRAFANA_MISC_STATS_API_KEY} environment: @@ -468,14 +460,14 @@ steps: - test-a11y-frontend - name: build-frontend-docs - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./scripts/ci-reference-docs-lint.sh ci depends_on: - build-frontend - name: copy-packages-for-docker - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ls dist/*.tar.gz* - cp dist/*.tar.gz* packaging/docker/ @@ -506,10 +498,8 @@ steps: - copy-packages-for-docker - name: postgres-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - apt-get install -yq postgresql-client - ./bin/dockerize -wait tcp://postgres:5432 -timeout 120s - psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql @@ -524,10 +514,8 @@ steps: - test-frontend - name: mysql-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - apt-get install -yq default-mysql-client - ./bin/dockerize -wait tcp://mysql:3306 -timeout 120s - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root -prootpass @@ -541,7 +529,7 @@ steps: - test-frontend - name: release-canary-npm-packages - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./scripts/circle-release-canary-packages.sh environment: @@ -663,7 +651,7 @@ steps: - echo $DRONE_RUNNER_NAME - name: initialize - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - mkdir -p bin - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.4.6/grabpl @@ -751,7 +739,7 @@ steps: - echo $DRONE_RUNNER_NAME - name: initialize - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - mkdir -p bin - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.4.6/grabpl @@ -761,14 +749,12 @@ steps: - curl -fLO https://github.com/jwilder/dockerize/releases/download/v$${DOCKERIZE_VERSION}/dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - tar -C bin -xzvf dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - rm dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - yarn install --frozen-lockfile --no-progress environment: DOCKERIZE_VERSION: 0.6.1 - name: codespell - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - "echo -e \"unknwon\nreferer\nerrorstring\neror\niam\nwan\" > words_to_ignore.txt" - codespell -I words_to_ignore.txt docs/ @@ -776,14 +762,14 @@ steps: - initialize - name: shellcheck - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl shellcheck depends_on: - initialize - name: lint-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - make gen-go - ./bin/grabpl lint-backend --edition oss @@ -793,7 +779,7 @@ steps: - initialize - name: test-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - "[ $(grep FocusConvey -R pkg | wc -l) -eq \"0\" ] || exit 1" - ./bin/grabpl test-backend --edition oss --tries 5 @@ -802,7 +788,7 @@ steps: - lint-backend - name: test-frontend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - yarn run ci:test-frontend environment: @@ -811,7 +797,7 @@ steps: - lint-backend - name: build-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-backend --jobs 8 --edition oss --github-token $${GITHUB_TOKEN} --no-pull-enterprise ${DRONE_TAG} environment: @@ -821,14 +807,14 @@ steps: - test-backend - name: build-frontend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-frontend --jobs 8 --github-token $${GITHUB_TOKEN} --no-install-deps --edition oss --no-pull-enterprise ${DRONE_TAG} depends_on: - test-frontend - name: build-plugins - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-plugins --jobs 8 --edition oss --no-install-deps --sign --signing-admin environment: @@ -838,14 +824,14 @@ steps: - lint-backend - name: validate-scuemata - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/linux-amd64/grafana-cli cue validate-schema --grafana-root . depends_on: - build-backend - name: gen-version - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl gen-version ${DRONE_TAG} depends_on: @@ -856,7 +842,7 @@ steps: - shellcheck - name: package - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl package --jobs 8 --edition oss --github-token $${GITHUB_TOKEN} --no-pull-enterprise --sign ${DRONE_TAG} environment: @@ -874,7 +860,7 @@ steps: - gen-version - name: end-to-end-tests-server - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 detach: true commands: - ./e2e/start-server @@ -894,7 +880,7 @@ steps: - end-to-end-tests-server - name: build-storybook - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - yarn storybook:build - ./bin/grabpl verify-storybook @@ -904,7 +890,7 @@ steps: - package - name: copy-packages-for-docker - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ls dist/*.tar.gz* - cp dist/*.tar.gz* packaging/docker/ @@ -935,10 +921,8 @@ steps: - copy-packages-for-docker - name: postgres-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - apt-get install -yq postgresql-client - ./bin/dockerize -wait tcp://postgres:5432 -timeout 120s - psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql @@ -953,10 +937,8 @@ steps: - test-frontend - name: mysql-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - apt-get install -yq default-mysql-client - ./bin/dockerize -wait tcp://mysql:3306 -timeout 120s - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root -prootpass @@ -1006,7 +988,7 @@ steps: - end-to-end-tests - name: release-npm-packages - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./scripts/build/release-packages.sh ${DRONE_TAG} environment: @@ -1107,7 +1089,7 @@ steps: - echo $DRONE_RUNNER_NAME - name: clone - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - mkdir -p bin - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.4.6/grabpl @@ -1120,7 +1102,7 @@ steps: from_secret: github_token - name: initialize - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - mv bin/grabpl /tmp/ - rmdir bin @@ -1134,8 +1116,6 @@ steps: - curl -fLO https://github.com/jwilder/dockerize/releases/download/v$${DOCKERIZE_VERSION}/dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - tar -C bin -xzvf dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - rm dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - yarn install --frozen-lockfile --no-progress environment: DOCKERIZE_VERSION: 0.6.1 @@ -1143,7 +1123,7 @@ steps: - clone - name: codespell - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - "echo -e \"unknwon\nreferer\nerrorstring\neror\niam\nwan\" > words_to_ignore.txt" - codespell -I words_to_ignore.txt docs/ @@ -1151,14 +1131,14 @@ steps: - initialize - name: shellcheck - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl shellcheck depends_on: - initialize - name: lint-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - make gen-go - ./bin/grabpl lint-backend --edition enterprise @@ -1168,7 +1148,7 @@ steps: - initialize - name: test-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - "[ $(grep FocusConvey -R pkg | wc -l) -eq \"0\" ] || exit 1" - ./bin/grabpl test-backend --edition enterprise --tries 5 @@ -1177,7 +1157,7 @@ steps: - lint-backend - name: test-frontend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - yarn run ci:test-frontend environment: @@ -1186,7 +1166,7 @@ steps: - lint-backend - name: build-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-backend --jobs 8 --edition enterprise --github-token $${GITHUB_TOKEN} --no-pull-enterprise ${DRONE_TAG} environment: @@ -1196,14 +1176,14 @@ steps: - test-backend - name: build-frontend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-frontend --jobs 8 --github-token $${GITHUB_TOKEN} --no-install-deps --edition enterprise --no-pull-enterprise ${DRONE_TAG} depends_on: - test-frontend - name: build-plugins - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-plugins --jobs 8 --edition enterprise --no-install-deps --sign --signing-admin environment: @@ -1213,14 +1193,14 @@ steps: - lint-backend - name: validate-scuemata - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/linux-amd64/grafana-cli cue validate-schema --grafana-root . depends_on: - build-backend - name: lint-backend-enterprise2 - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - make gen-go - ./bin/grabpl lint-backend --edition enterprise2 @@ -1230,7 +1210,7 @@ steps: - initialize - name: test-backend-enterprise2 - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - "[ $(grep FocusConvey -R pkg | wc -l) -eq \"0\" ] || exit 1" - ./bin/grabpl test-backend --edition enterprise2 --tries 5 @@ -1239,7 +1219,7 @@ steps: - lint-backend - name: build-backend-enterprise2 - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-backend --jobs 8 --edition enterprise2 --github-token $${GITHUB_TOKEN} --no-pull-enterprise ${DRONE_TAG} environment: @@ -1249,7 +1229,7 @@ steps: - test-backend-enterprise2 - name: gen-version - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl gen-version ${DRONE_TAG} depends_on: @@ -1262,7 +1242,7 @@ steps: - test-backend-enterprise2 - name: package - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl package --jobs 8 --edition enterprise --github-token $${GITHUB_TOKEN} --no-pull-enterprise --sign ${DRONE_TAG} environment: @@ -1280,7 +1260,7 @@ steps: - gen-version - name: end-to-end-tests-server - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 detach: true commands: - ./e2e/start-server @@ -1302,7 +1282,7 @@ steps: - end-to-end-tests-server - name: copy-packages-for-docker - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ls dist/*.tar.gz* - cp dist/*.tar.gz* packaging/docker/ @@ -1333,10 +1313,8 @@ steps: - copy-packages-for-docker - name: postgres-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - apt-get install -yq postgresql-client - ./bin/dockerize -wait tcp://postgres:5432 -timeout 120s - psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql @@ -1351,10 +1329,8 @@ steps: - test-frontend - name: mysql-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - apt-get install -yq default-mysql-client - ./bin/dockerize -wait tcp://mysql:3306 -timeout 120s - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root -prootpass @@ -1368,7 +1344,7 @@ steps: - test-frontend - name: redis-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/dockerize -wait tcp://redis:6379/0 -timeout 120s - ./bin/grabpl integration-tests @@ -1379,7 +1355,7 @@ steps: - test-frontend - name: memcached-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/dockerize -wait tcp://memcached:11211 -timeout 120s - ./bin/grabpl integration-tests @@ -1414,7 +1390,7 @@ steps: - memcached-integration-tests - name: package-enterprise2 - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl package --jobs 8 --edition enterprise2 --github-token $${GITHUB_TOKEN} --no-pull-enterprise --sign ${DRONE_TAG} environment: @@ -1432,7 +1408,7 @@ steps: - gen-version - name: end-to-end-tests-server-enterprise2 - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 detach: true commands: - ./e2e/start-server @@ -1597,7 +1573,7 @@ steps: - echo $DRONE_RUNNER_NAME - name: initialize - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - mkdir -p bin - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.4.6/grabpl @@ -1705,7 +1681,7 @@ steps: - echo $DRONE_RUNNER_NAME - name: initialize - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - mkdir -p bin - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.4.6/grabpl @@ -1715,14 +1691,12 @@ steps: - curl -fLO https://github.com/jwilder/dockerize/releases/download/v$${DOCKERIZE_VERSION}/dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - tar -C bin -xzvf dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - rm dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - yarn install --frozen-lockfile --no-progress environment: DOCKERIZE_VERSION: 0.6.1 - name: codespell - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - "echo -e \"unknwon\nreferer\nerrorstring\neror\niam\nwan\" > words_to_ignore.txt" - codespell -I words_to_ignore.txt docs/ @@ -1730,14 +1704,14 @@ steps: - initialize - name: shellcheck - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl shellcheck depends_on: - initialize - name: lint-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - make gen-go - ./bin/grabpl lint-backend --edition oss @@ -1747,7 +1721,7 @@ steps: - initialize - name: test-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - "[ $(grep FocusConvey -R pkg | wc -l) -eq \"0\" ] || exit 1" - ./bin/grabpl test-backend --edition oss --tries 5 @@ -1756,7 +1730,7 @@ steps: - lint-backend - name: test-frontend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - yarn run ci:test-frontend environment: @@ -1765,7 +1739,7 @@ steps: - lint-backend - name: build-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-backend --jobs 8 --edition oss --github-token $${GITHUB_TOKEN} --no-pull-enterprise v7.3.0-test environment: @@ -1775,14 +1749,14 @@ steps: - test-backend - name: build-frontend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-frontend --jobs 8 --github-token $${GITHUB_TOKEN} --no-install-deps --edition oss --no-pull-enterprise v7.3.0-test depends_on: - test-frontend - name: build-plugins - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-plugins --jobs 8 --edition oss --no-install-deps --sign --signing-admin environment: @@ -1792,14 +1766,14 @@ steps: - lint-backend - name: validate-scuemata - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/linux-amd64/grafana-cli cue validate-schema --grafana-root . depends_on: - build-backend - name: gen-version - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl gen-version v7.3.0-test depends_on: @@ -1810,7 +1784,7 @@ steps: - shellcheck - name: package - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl package --jobs 8 --edition oss --github-token $${GITHUB_TOKEN} --no-pull-enterprise --sign v7.3.0-test environment: @@ -1828,7 +1802,7 @@ steps: - gen-version - name: end-to-end-tests-server - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 detach: true commands: - ./e2e/start-server @@ -1848,7 +1822,7 @@ steps: - end-to-end-tests-server - name: build-storybook - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - yarn storybook:build - ./bin/grabpl verify-storybook @@ -1858,7 +1832,7 @@ steps: - package - name: copy-packages-for-docker - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ls dist/*.tar.gz* - cp dist/*.tar.gz* packaging/docker/ @@ -1883,10 +1857,8 @@ steps: - copy-packages-for-docker - name: postgres-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - apt-get install -yq postgresql-client - ./bin/dockerize -wait tcp://postgres:5432 -timeout 120s - psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql @@ -1901,10 +1873,8 @@ steps: - test-frontend - name: mysql-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - apt-get install -yq default-mysql-client - ./bin/dockerize -wait tcp://mysql:3306 -timeout 120s - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root -prootpass @@ -1951,7 +1921,7 @@ steps: - end-to-end-tests - name: release-npm-packages - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 environment: GITHUB_PACKAGE_TOKEN: from_secret: github_package_token @@ -2050,7 +2020,7 @@ steps: - echo $DRONE_RUNNER_NAME - name: clone - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - mkdir -p bin - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.4.6/grabpl @@ -2063,7 +2033,7 @@ steps: from_secret: github_token - name: initialize - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - mv bin/grabpl /tmp/ - rmdir bin @@ -2077,8 +2047,6 @@ steps: - curl -fLO https://github.com/jwilder/dockerize/releases/download/v$${DOCKERIZE_VERSION}/dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - tar -C bin -xzvf dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - rm dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - yarn install --frozen-lockfile --no-progress environment: DOCKERIZE_VERSION: 0.6.1 @@ -2086,7 +2054,7 @@ steps: - clone - name: codespell - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - "echo -e \"unknwon\nreferer\nerrorstring\neror\niam\nwan\" > words_to_ignore.txt" - codespell -I words_to_ignore.txt docs/ @@ -2094,14 +2062,14 @@ steps: - initialize - name: shellcheck - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl shellcheck depends_on: - initialize - name: lint-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - make gen-go - ./bin/grabpl lint-backend --edition enterprise @@ -2111,7 +2079,7 @@ steps: - initialize - name: test-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - "[ $(grep FocusConvey -R pkg | wc -l) -eq \"0\" ] || exit 1" - ./bin/grabpl test-backend --edition enterprise --tries 5 @@ -2120,7 +2088,7 @@ steps: - lint-backend - name: test-frontend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - yarn run ci:test-frontend environment: @@ -2129,7 +2097,7 @@ steps: - lint-backend - name: build-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-backend --jobs 8 --edition enterprise --github-token $${GITHUB_TOKEN} --no-pull-enterprise v7.3.0-test environment: @@ -2139,14 +2107,14 @@ steps: - test-backend - name: build-frontend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-frontend --jobs 8 --github-token $${GITHUB_TOKEN} --no-install-deps --edition enterprise --no-pull-enterprise v7.3.0-test depends_on: - test-frontend - name: build-plugins - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-plugins --jobs 8 --edition enterprise --no-install-deps --sign --signing-admin environment: @@ -2156,14 +2124,14 @@ steps: - lint-backend - name: validate-scuemata - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/linux-amd64/grafana-cli cue validate-schema --grafana-root . depends_on: - build-backend - name: lint-backend-enterprise2 - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - make gen-go - ./bin/grabpl lint-backend --edition enterprise2 @@ -2173,7 +2141,7 @@ steps: - initialize - name: test-backend-enterprise2 - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - "[ $(grep FocusConvey -R pkg | wc -l) -eq \"0\" ] || exit 1" - ./bin/grabpl test-backend --edition enterprise2 --tries 5 @@ -2182,7 +2150,7 @@ steps: - lint-backend - name: build-backend-enterprise2 - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-backend --jobs 8 --edition enterprise2 --github-token $${GITHUB_TOKEN} --no-pull-enterprise v7.3.0-test environment: @@ -2192,7 +2160,7 @@ steps: - test-backend-enterprise2 - name: gen-version - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl gen-version v7.3.0-test depends_on: @@ -2205,7 +2173,7 @@ steps: - test-backend-enterprise2 - name: package - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl package --jobs 8 --edition enterprise --github-token $${GITHUB_TOKEN} --no-pull-enterprise --sign v7.3.0-test environment: @@ -2223,7 +2191,7 @@ steps: - gen-version - name: end-to-end-tests-server - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 detach: true commands: - ./e2e/start-server @@ -2245,7 +2213,7 @@ steps: - end-to-end-tests-server - name: copy-packages-for-docker - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ls dist/*.tar.gz* - cp dist/*.tar.gz* packaging/docker/ @@ -2270,10 +2238,8 @@ steps: - copy-packages-for-docker - name: postgres-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - apt-get install -yq postgresql-client - ./bin/dockerize -wait tcp://postgres:5432 -timeout 120s - psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql @@ -2288,10 +2254,8 @@ steps: - test-frontend - name: mysql-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - apt-get install -yq default-mysql-client - ./bin/dockerize -wait tcp://mysql:3306 -timeout 120s - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root -prootpass @@ -2305,7 +2269,7 @@ steps: - test-frontend - name: redis-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/dockerize -wait tcp://redis:6379/0 -timeout 120s - ./bin/grabpl integration-tests @@ -2316,7 +2280,7 @@ steps: - test-frontend - name: memcached-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/dockerize -wait tcp://memcached:11211 -timeout 120s - ./bin/grabpl integration-tests @@ -2351,7 +2315,7 @@ steps: - memcached-integration-tests - name: package-enterprise2 - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl package --jobs 8 --edition enterprise2 --github-token $${GITHUB_TOKEN} --no-pull-enterprise --sign v7.3.0-test environment: @@ -2369,7 +2333,7 @@ steps: - gen-version - name: end-to-end-tests-server-enterprise2 - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 detach: true commands: - ./e2e/start-server @@ -2534,7 +2498,7 @@ steps: - echo $DRONE_RUNNER_NAME - name: initialize - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - mkdir -p bin - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.4.6/grabpl @@ -2642,7 +2606,7 @@ steps: - echo $DRONE_RUNNER_NAME - name: initialize - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - mkdir -p bin - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.4.6/grabpl @@ -2651,14 +2615,12 @@ steps: - curl -fLO https://github.com/jwilder/dockerize/releases/download/v$${DOCKERIZE_VERSION}/dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - tar -C bin -xzvf dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - rm dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - yarn install --frozen-lockfile --no-progress environment: DOCKERIZE_VERSION: 0.6.1 - name: codespell - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - "echo -e \"unknwon\nreferer\nerrorstring\neror\niam\nwan\" > words_to_ignore.txt" - codespell -I words_to_ignore.txt docs/ @@ -2666,14 +2628,14 @@ steps: - initialize - name: shellcheck - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl shellcheck depends_on: - initialize - name: lint-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - make gen-go - ./bin/grabpl lint-backend --edition oss @@ -2683,7 +2645,7 @@ steps: - initialize - name: test-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - "[ $(grep FocusConvey -R pkg | wc -l) -eq \"0\" ] || exit 1" - ./bin/grabpl test-backend --edition oss @@ -2692,7 +2654,7 @@ steps: - lint-backend - name: test-frontend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - yarn run ci:test-frontend environment: @@ -2701,21 +2663,21 @@ steps: - lint-backend - name: build-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-backend --jobs 8 --edition oss --build-id ${DRONE_BUILD_NUMBER} --no-pull-enterprise depends_on: - test-backend - name: build-frontend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-frontend --jobs 8 --no-install-deps --edition oss --build-id ${DRONE_BUILD_NUMBER} --no-pull-enterprise depends_on: - test-frontend - name: build-plugins - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-plugins --jobs 8 --edition oss --no-install-deps --sign --signing-admin environment: @@ -2725,14 +2687,14 @@ steps: - lint-backend - name: validate-scuemata - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/linux-amd64/grafana-cli cue validate-schema --grafana-root . depends_on: - build-backend - name: gen-version - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl gen-version --build-id ${DRONE_BUILD_NUMBER} depends_on: @@ -2743,7 +2705,7 @@ steps: - shellcheck - name: package - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl package --jobs 8 --edition oss --build-id ${DRONE_BUILD_NUMBER} --no-pull-enterprise --sign environment: @@ -2761,7 +2723,7 @@ steps: - gen-version - name: end-to-end-tests-server - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 detach: true commands: - ./e2e/start-server @@ -2781,7 +2743,7 @@ steps: - end-to-end-tests-server - name: build-storybook - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - yarn storybook:build - ./bin/grabpl verify-storybook @@ -2791,7 +2753,7 @@ steps: - package - name: copy-packages-for-docker - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ls dist/*.tar.gz* - cp dist/*.tar.gz* packaging/docker/ @@ -2816,10 +2778,8 @@ steps: - copy-packages-for-docker - name: postgres-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - apt-get install -yq postgresql-client - ./bin/dockerize -wait tcp://postgres:5432 -timeout 120s - psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql @@ -2834,10 +2794,8 @@ steps: - test-frontend - name: mysql-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - apt-get install -yq default-mysql-client - ./bin/dockerize -wait tcp://mysql:3306 -timeout 120s - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root -prootpass @@ -2958,7 +2916,7 @@ steps: - echo $DRONE_RUNNER_NAME - name: clone - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - mkdir -p bin - curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v2.4.6/grabpl @@ -2971,7 +2929,7 @@ steps: from_secret: github_token - name: initialize - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - mv bin/grabpl /tmp/ - rmdir bin @@ -2984,8 +2942,6 @@ steps: - curl -fLO https://github.com/jwilder/dockerize/releases/download/v$${DOCKERIZE_VERSION}/dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - tar -C bin -xzvf dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - rm dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - yarn install --frozen-lockfile --no-progress environment: DOCKERIZE_VERSION: 0.6.1 @@ -2993,7 +2949,7 @@ steps: - clone - name: codespell - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - "echo -e \"unknwon\nreferer\nerrorstring\neror\niam\nwan\" > words_to_ignore.txt" - codespell -I words_to_ignore.txt docs/ @@ -3001,14 +2957,14 @@ steps: - initialize - name: shellcheck - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl shellcheck depends_on: - initialize - name: lint-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - make gen-go - ./bin/grabpl lint-backend --edition enterprise @@ -3018,7 +2974,7 @@ steps: - initialize - name: test-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - "[ $(grep FocusConvey -R pkg | wc -l) -eq \"0\" ] || exit 1" - ./bin/grabpl test-backend --edition enterprise @@ -3027,7 +2983,7 @@ steps: - lint-backend - name: test-frontend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - yarn run ci:test-frontend environment: @@ -3036,21 +2992,21 @@ steps: - lint-backend - name: build-backend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-backend --jobs 8 --edition enterprise --build-id ${DRONE_BUILD_NUMBER} --no-pull-enterprise depends_on: - test-backend - name: build-frontend - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-frontend --jobs 8 --no-install-deps --edition enterprise --build-id ${DRONE_BUILD_NUMBER} --no-pull-enterprise depends_on: - test-frontend - name: build-plugins - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-plugins --jobs 8 --edition enterprise --no-install-deps --sign --signing-admin environment: @@ -3060,14 +3016,14 @@ steps: - lint-backend - name: validate-scuemata - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/linux-amd64/grafana-cli cue validate-schema --grafana-root . depends_on: - build-backend - name: lint-backend-enterprise2 - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - make gen-go - ./bin/grabpl lint-backend --edition enterprise2 @@ -3077,7 +3033,7 @@ steps: - initialize - name: test-backend-enterprise2 - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - "[ $(grep FocusConvey -R pkg | wc -l) -eq \"0\" ] || exit 1" - ./bin/grabpl test-backend --edition enterprise2 @@ -3086,14 +3042,14 @@ steps: - lint-backend - name: build-backend-enterprise2 - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl build-backend --jobs 8 --edition enterprise2 --build-id ${DRONE_BUILD_NUMBER} --variants linux-x64 --no-pull-enterprise depends_on: - test-backend-enterprise2 - name: gen-version - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl gen-version --build-id ${DRONE_BUILD_NUMBER} depends_on: @@ -3106,7 +3062,7 @@ steps: - test-backend-enterprise2 - name: package - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl package --jobs 8 --edition enterprise --build-id ${DRONE_BUILD_NUMBER} --no-pull-enterprise --sign environment: @@ -3124,7 +3080,7 @@ steps: - gen-version - name: end-to-end-tests-server - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 detach: true commands: - ./e2e/start-server @@ -3146,7 +3102,7 @@ steps: - end-to-end-tests-server - name: build-storybook - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - yarn storybook:build - ./bin/grabpl verify-storybook @@ -3156,7 +3112,7 @@ steps: - package - name: copy-packages-for-docker - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ls dist/*.tar.gz* - cp dist/*.tar.gz* packaging/docker/ @@ -3181,10 +3137,8 @@ steps: - copy-packages-for-docker - name: postgres-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - apt-get install -yq postgresql-client - ./bin/dockerize -wait tcp://postgres:5432 -timeout 120s - psql -p 5432 -h postgres -U grafanatest -d grafanatest -f devenv/docker/blocks/postgres_tests/setup.sql @@ -3199,10 +3153,8 @@ steps: - test-frontend - name: mysql-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - - mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30 - - mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list - apt-get install -yq default-mysql-client - ./bin/dockerize -wait tcp://mysql:3306 -timeout 120s - cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root -prootpass @@ -3216,7 +3168,7 @@ steps: - test-frontend - name: redis-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/dockerize -wait tcp://redis:6379/0 -timeout 120s - ./bin/grabpl integration-tests @@ -3227,7 +3179,7 @@ steps: - test-frontend - name: memcached-integration-tests - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/dockerize -wait tcp://memcached:11211 -timeout 120s - ./bin/grabpl integration-tests @@ -3262,7 +3214,7 @@ steps: - memcached-integration-tests - name: package-enterprise2 - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 commands: - ./bin/grabpl package --jobs 8 --edition enterprise2 --build-id ${DRONE_BUILD_NUMBER} --no-pull-enterprise --variants linux-x64 --sign environment: @@ -3280,7 +3232,7 @@ steps: - gen-version - name: end-to-end-tests-server-enterprise2 - image: grafana/build-container:1.4.2 + image: grafana/build-container:1.4.3 detach: true commands: - ./e2e/start-server @@ -3524,6 +3476,6 @@ get: --- kind: signature -hmac: 1963852802141adda7e86247b0c80e85a2cb90edef6486abdfbefd095e903201 +hmac: eddb32cfb37c2f1126abcb55b3dcf80a4706e39e5d7410530d849c802ac3079c ... diff --git a/public/app/plugins/datasource/prometheus/components/PrometheusMetricsBrowser.tsx b/public/app/plugins/datasource/prometheus/components/PrometheusMetricsBrowser.tsx index 6bbc052c310..76a9ba17889 100644 --- a/public/app/plugins/datasource/prometheus/components/PrometheusMetricsBrowser.tsx +++ b/public/app/plugins/datasource/prometheus/components/PrometheusMetricsBrowser.tsx @@ -10,6 +10,7 @@ import { BrowserLabel as PromLabel, } from '@grafana/ui'; import PromQlLanguageProvider from '../language_provider'; +import { escapeLabelValueInExactSelector, escapeLabelValueInRegexSelector } from '../language_utils'; import { css, cx } from '@emotion/css'; import store from 'app/core/store'; import { FixedSizeList } from 'react-window'; @@ -65,12 +66,12 @@ export function buildSelector(labels: SelectableLabel[]): string { if ((label.name === METRIC_LABEL || label.selected) && label.values && label.values.length > 0) { const selectedValues = label.values.filter((value) => value.selected).map((value) => value.name); if (selectedValues.length > 1) { - selectedLabels.push(`${label.name}=~"${selectedValues.join('|')}"`); + selectedLabels.push(`${label.name}=~"${selectedValues.map(escapeLabelValueInRegexSelector).join('|')}"`); } else if (selectedValues.length === 1) { if (label.name === METRIC_LABEL) { singleMetric = selectedValues[0]; } else { - selectedLabels.push(`${label.name}="${selectedValues[0]}"`); + selectedLabels.push(`${label.name}="${escapeLabelValueInExactSelector(selectedValues[0])}"`); } } } diff --git a/public/app/plugins/datasource/prometheus/datasource.ts b/public/app/plugins/datasource/prometheus/datasource.ts index a58fb999373..f090e947aae 100644 --- a/public/app/plugins/datasource/prometheus/datasource.ts +++ b/public/app/plugins/datasource/prometheus/datasource.ts @@ -864,6 +864,9 @@ export function extractRuleMappingFromGroups(groups: any[]) { ); } +// NOTE: these two functions are very similar to the escapeLabelValueIn* functions +// in language_utils.ts, but they are not exactly the same algorithm, and we found +// no way to reuse one in the another or vice versa. export function prometheusRegularEscape(value: any) { return typeof value === 'string' ? value.replace(/\\/g, '\\\\').replace(/'/g, "\\\\'") : value; } diff --git a/public/app/plugins/datasource/prometheus/language_utils.test.ts b/public/app/plugins/datasource/prometheus/language_utils.test.ts index a020c1166be..142a4ef751c 100644 --- a/public/app/plugins/datasource/prometheus/language_utils.test.ts +++ b/public/app/plugins/datasource/prometheus/language_utils.test.ts @@ -1,4 +1,10 @@ -import { expandRecordingRules, fixSummariesMetadata, parseSelector } from './language_utils'; +import { + escapeLabelValueInExactSelector, + escapeLabelValueInRegexSelector, + expandRecordingRules, + fixSummariesMetadata, + parseSelector, +} from './language_utils'; describe('parseSelector()', () => { let parsed; @@ -168,3 +174,45 @@ describe('expandRecordingRules()', () => { ).toBe('rate(fooA{label1="value1",label2="value2"}[])/ rate(fooB{label3="value3"}[])'); }); }); + +describe('escapeLabelValueInExactSelector()', () => { + it('handles newline characters', () => { + expect(escapeLabelValueInExactSelector('t\nes\nt')).toBe('t\\nes\\nt'); + }); + + it('handles backslash characters', () => { + expect(escapeLabelValueInExactSelector('t\\es\\t')).toBe('t\\\\es\\\\t'); + }); + + it('handles double-quote characters', () => { + expect(escapeLabelValueInExactSelector('t"es"t')).toBe('t\\"es\\"t'); + }); + + it('handles all together', () => { + expect(escapeLabelValueInExactSelector('t\\e"st\nl\nab"e\\l')).toBe('t\\\\e\\"st\\nl\\nab\\"e\\\\l'); + }); +}); + +describe('escapeLabelValueInRegexSelector()', () => { + it('handles newline characters', () => { + expect(escapeLabelValueInRegexSelector('t\nes\nt')).toBe('t\\nes\\nt'); + }); + + it('handles backslash characters', () => { + expect(escapeLabelValueInRegexSelector('t\\es\\t')).toBe('t\\\\\\\\es\\\\\\\\t'); + }); + + it('handles double-quote characters', () => { + expect(escapeLabelValueInRegexSelector('t"es"t')).toBe('t\\"es\\"t'); + }); + + it('handles regex-meaningful characters', () => { + expect(escapeLabelValueInRegexSelector('t+es$t')).toBe('t\\\\+es\\\\$t'); + }); + + it('handles all together', () => { + expect(escapeLabelValueInRegexSelector('t\\e"s+t\nl\n$ab"e\\l')).toBe( + 't\\\\\\\\e\\"s\\\\+t\\nl\\n\\\\$ab\\"e\\\\\\\\l' + ); + }); +}); diff --git a/public/app/plugins/datasource/prometheus/language_utils.ts b/public/app/plugins/datasource/prometheus/language_utils.ts index 4ec792a62cf..da1dce71208 100644 --- a/public/app/plugins/datasource/prometheus/language_utils.ts +++ b/public/app/plugins/datasource/prometheus/language_utils.ts @@ -239,3 +239,28 @@ export function limitSuggestions(items: string[]) { export function addLimitInfo(items: any[] | undefined): string { return items && items.length >= SUGGESTIONS_LIMIT ? `, limited to the first ${SUGGESTIONS_LIMIT} received items` : ''; } + +// NOTE: the following 2 exported functions are very similar to the prometheus*Escape +// functions in datasource.ts, but they are not exactly the same algorithm, and we found +// no way to reuse one in the another or vice versa. + +// Prometheus regular-expressions use the RE2 syntax (https://github.com/google/re2/wiki/Syntax), +// so every character that matches something in that list has to be escaped. +// the list of metacharacters is: *+?()|\.[]{}^$ +// we make a javascript regular expression that matches those characters: +const RE2_METACHARACTERS = /[*+?()|\\.\[\]{}^$]/g; +function escapePrometheusRegexp(value: string): string { + return value.replace(RE2_METACHARACTERS, '\\$&'); +} + +// based on the openmetrics-documentation, the 3 symbols we have to handle are: +// - \n ... the newline character +// - \ ... the backslash character +// - " ... the double-quote character +export function escapeLabelValueInExactSelector(labelValue: string): string { + return labelValue.replace(/\\/g, '\\\\').replace(/\n/g, '\\n').replace(/"/g, '\\"'); +} + +export function escapeLabelValueInRegexSelector(labelValue: string): string { + return escapeLabelValueInExactSelector(escapePrometheusRegexp(labelValue)); +} diff --git a/scripts/drone/steps/lib.star b/scripts/drone/steps/lib.star index 53d9d29de6d..a124f2cc53c 100644 --- a/scripts/drone/steps/lib.star +++ b/scripts/drone/steps/lib.star @@ -1,7 +1,7 @@ load('scripts/drone/vault.star', 'from_secret', 'github_token', 'pull_secret', 'drone_token') grabpl_version = '2.4.6' -build_image = 'grafana/build-container:1.4.2' +build_image = 'grafana/build-container:1.4.3' publish_image = 'grafana/grafana-ci-deploy:1.3.1' grafana_docker_image = 'grafana/drone-grafana-docker:0.3.2' deploy_docker_image = 'us.gcr.io/kubernetes-dev/drone/plugins/deploy-image' @@ -63,8 +63,6 @@ def initialize_step(edition, platform, ver_mode, is_downstream=False, install_de 'curl -fLO https://github.com/jwilder/dockerize/releases/download/v$${DOCKERIZE_VERSION}/dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz', 'tar -C bin -xzvf dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz', 'rm dockerize-linux-amd64-v$${DOCKERIZE_VERSION}.tar.gz', - 'mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30', - 'mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list', 'yarn install --frozen-lockfile --no-progress', ]) if edition in ('enterprise', 'enterprise2'): @@ -698,8 +696,6 @@ def postgres_integration_tests_step(): 'POSTGRES_HOST': 'postgres', }, 'commands': [ - 'mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30', - 'mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list', 'apt-get install -yq postgresql-client', './bin/dockerize -wait tcp://postgres:5432 -timeout 120s', 'psql -p 5432 -h postgres -U grafanatest -d grafanatest -f ' + @@ -723,8 +719,6 @@ def mysql_integration_tests_step(): 'MYSQL_HOST': 'mysql', }, 'commands': [ - 'mv /etc/apt/sources.list.d/nodesource.list /etc/apt/sources.list.d/nodesource.list.disabled; apt-get update; apt-get -y upgrade; apt-get install -y ca-certificates libgnutls30', - 'mv /etc/apt/sources.list.d/nodesource.list.disabled /etc/apt/sources.list.d/nodesource.list', 'apt-get install -yq default-mysql-client', './bin/dockerize -wait tcp://mysql:3306 -timeout 120s', 'cat devenv/docker/blocks/mysql_tests/setup.sql | mysql -h mysql -P 3306 -u root -prootpass',