CI: remove frontend unit test and frontend linting from drone PR/main pipelines (#102221)
* remove frontend unit test and frontend linting from drone PR/main pipelines * remove unused dependency on frontend test * fail fast on frontend unit tests * no more main-test-frontend * update CODEOWNERS * make job names more identifiable
This commit is contained in:
+1
-355
@@ -160,224 +160,6 @@ image_pull_secrets:
|
||||
- gcr
|
||||
- gar
|
||||
kind: pipeline
|
||||
name: pr-test-frontend
|
||||
node:
|
||||
type: no-parallel
|
||||
platform:
|
||||
arch: amd64
|
||||
os: linux
|
||||
services: []
|
||||
steps:
|
||||
- commands:
|
||||
- echo $DRONE_RUNNER_NAME
|
||||
image: alpine:3.21.3
|
||||
name: identify-runner
|
||||
- commands:
|
||||
- yarn install --immutable || yarn install --immutable
|
||||
depends_on: []
|
||||
image: node:22.11.0-alpine
|
||||
name: yarn-install
|
||||
- commands:
|
||||
- apk add --update git bash
|
||||
- yarn betterer:ci
|
||||
depends_on:
|
||||
- yarn-install
|
||||
image: node:22.11.0-alpine
|
||||
name: betterer-frontend
|
||||
- commands:
|
||||
- echo $(/usr/bin/github-app-external-token) > /github-app/token
|
||||
environment:
|
||||
GITHUB_APP_ID:
|
||||
from_secret: github-app-app-id
|
||||
GITHUB_APP_INSTALLATION_ID:
|
||||
from_secret: github-app-installation-id
|
||||
GITHUB_APP_PRIVATE_KEY:
|
||||
from_secret: github-app-private-key
|
||||
failure: ignore
|
||||
image: us-docker.pkg.dev/grafanalabs-global/docker-deployment-tools-prod/github-app-secret-writer:2024-11-05-v11688112090.1-83920c59
|
||||
name: github-app-generate-token
|
||||
volumes:
|
||||
- name: github-app
|
||||
path: /github-app
|
||||
- commands:
|
||||
- apk add --update curl jq bash
|
||||
- GITHUB_TOKEN=$(cat /github-app/token)
|
||||
- is_fork=$(curl --retry 5 "https://$${GITHUB_TOKEN}@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST"
|
||||
| jq .head.repo.fork)
|
||||
- if [ "$is_fork" != false ]; then return 1; fi
|
||||
- git clone "https://x-access-token:$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
|
||||
../grafana-enterprise
|
||||
- cd ../grafana-enterprise
|
||||
- if git checkout ${DRONE_SOURCE_BRANCH}; then echo "checked out ${DRONE_SOURCE_BRANCH}";
|
||||
elif git checkout ${DRONE_TARGET_BRANCH}; then echo "git checkout ${DRONE_TARGET_BRANCH}";
|
||||
else git checkout main; fi
|
||||
- cd ../
|
||||
- ln -s src grafana
|
||||
- cd ./grafana-enterprise
|
||||
- ./build.sh
|
||||
depends_on:
|
||||
- github-app-generate-token
|
||||
failure: ignore
|
||||
image: alpine/git:2.40.1
|
||||
name: clone-enterprise
|
||||
volumes:
|
||||
- name: github-app
|
||||
path: /github-app
|
||||
- commands:
|
||||
- yarn run ci:test-frontend
|
||||
depends_on:
|
||||
- yarn-install
|
||||
environment:
|
||||
TEST_MAX_WORKERS: 50%
|
||||
image: node:22.11.0-alpine
|
||||
name: test-frontend
|
||||
trigger:
|
||||
event:
|
||||
- pull_request
|
||||
paths:
|
||||
exclude:
|
||||
- docs/**
|
||||
- '*.md'
|
||||
- pkg/**
|
||||
- packaging/**
|
||||
- go.sum
|
||||
- go.mod
|
||||
include: []
|
||||
type: docker
|
||||
volumes:
|
||||
- host:
|
||||
path: /var/run/docker.sock
|
||||
name: docker
|
||||
- name: github-app
|
||||
temp: {}
|
||||
---
|
||||
clone:
|
||||
retries: 3
|
||||
depends_on: []
|
||||
environment:
|
||||
EDITION: oss
|
||||
image_pull_secrets:
|
||||
- gcr
|
||||
- gar
|
||||
kind: pipeline
|
||||
name: pr-lint-frontend
|
||||
node:
|
||||
type: no-parallel
|
||||
platform:
|
||||
arch: amd64
|
||||
os: linux
|
||||
services: []
|
||||
steps:
|
||||
- commands:
|
||||
- echo $(/usr/bin/github-app-external-token) > /github-app/token
|
||||
environment:
|
||||
GITHUB_APP_ID:
|
||||
from_secret: github-app-app-id
|
||||
GITHUB_APP_INSTALLATION_ID:
|
||||
from_secret: github-app-installation-id
|
||||
GITHUB_APP_PRIVATE_KEY:
|
||||
from_secret: github-app-private-key
|
||||
failure: ignore
|
||||
image: us-docker.pkg.dev/grafanalabs-global/docker-deployment-tools-prod/github-app-secret-writer:2024-11-05-v11688112090.1-83920c59
|
||||
name: github-app-generate-token
|
||||
volumes:
|
||||
- name: github-app
|
||||
path: /github-app
|
||||
- commands:
|
||||
- apk add --update curl jq bash
|
||||
- GITHUB_TOKEN=$(cat /github-app/token)
|
||||
- is_fork=$(curl --retry 5 "https://$${GITHUB_TOKEN}@api.github.com/repos/grafana/grafana/pulls/$DRONE_PULL_REQUEST"
|
||||
| jq .head.repo.fork)
|
||||
- if [ "$is_fork" != false ]; then return 1; fi
|
||||
- git clone "https://x-access-token:$${GITHUB_TOKEN}@github.com/grafana/grafana-enterprise.git"
|
||||
../grafana-enterprise
|
||||
- cd ../grafana-enterprise
|
||||
- if git checkout ${DRONE_SOURCE_BRANCH}; then echo "checked out ${DRONE_SOURCE_BRANCH}";
|
||||
elif git checkout ${DRONE_TARGET_BRANCH}; then echo "git checkout ${DRONE_TARGET_BRANCH}";
|
||||
else git checkout main; fi
|
||||
- cd ../
|
||||
- ln -s src grafana
|
||||
- cd ./grafana-enterprise
|
||||
- ./build.sh
|
||||
depends_on:
|
||||
- github-app-generate-token
|
||||
failure: ignore
|
||||
image: alpine/git:2.40.1
|
||||
name: clone-enterprise
|
||||
volumes:
|
||||
- name: github-app
|
||||
path: /github-app
|
||||
- commands:
|
||||
- echo $DRONE_RUNNER_NAME
|
||||
image: alpine:3.21.3
|
||||
name: identify-runner
|
||||
- commands:
|
||||
- yarn install --immutable || yarn install --immutable
|
||||
depends_on: []
|
||||
image: node:22.11.0-alpine
|
||||
name: yarn-install
|
||||
- commands:
|
||||
- yarn run prettier:check
|
||||
- yarn run lint
|
||||
- yarn run typecheck
|
||||
depends_on:
|
||||
- yarn-install
|
||||
environment:
|
||||
TEST_MAX_WORKERS: 50%
|
||||
image: node:22.11.0-alpine
|
||||
name: lint-frontend
|
||||
- commands:
|
||||
- |-
|
||||
make i18n-extract || (echo "
|
||||
Extraction failed. Make sure that you have no dynamic translation phrases, such as 't(\`preferences.theme.\$${themeID}\`, themeName)' and that no translation key is used twice. Search the output for '[warning]' to find the offending file." && false)
|
||||
- "\n file_diff=$(git diff --dirstat public/locales)\n if
|
||||
[ -n \"$file_diff\" ]; then\n echo $file_diff\n echo
|
||||
\"\nTranslation extraction has not been committed. Please run 'make i18n-extract',
|
||||
commit the changes and push again.\"\n exit 1\n fi\n
|
||||
\ "
|
||||
depends_on:
|
||||
- yarn-install
|
||||
image: node:22-bookworm
|
||||
name: verify-i18n
|
||||
- commands:
|
||||
- yarn generate-apis
|
||||
- "\n file_diff=$(git diff ':!conf')\n if [ -n \"$file_diff\"
|
||||
]; then\n echo $file_diff\n echo \"\nAPI client
|
||||
generation has not been committed. Please run 'yarn generate-apis', commit the
|
||||
changes and push again.\"\n exit 1\n fi\n "
|
||||
depends_on:
|
||||
- yarn-install
|
||||
image: node:22-bookworm
|
||||
name: verify-api-clients
|
||||
trigger:
|
||||
event:
|
||||
- pull_request
|
||||
paths:
|
||||
exclude:
|
||||
- docs/**
|
||||
- '*.md'
|
||||
- pkg/**
|
||||
- packaging/**
|
||||
- go.sum
|
||||
- go.mod
|
||||
include: []
|
||||
type: docker
|
||||
volumes:
|
||||
- host:
|
||||
path: /var/run/docker.sock
|
||||
name: docker
|
||||
- name: github-app
|
||||
temp: {}
|
||||
---
|
||||
clone:
|
||||
retries: 3
|
||||
depends_on: []
|
||||
environment:
|
||||
EDITION: oss
|
||||
image_pull_secrets:
|
||||
- gcr
|
||||
- gar
|
||||
kind: pipeline
|
||||
name: pr-test-backend
|
||||
node:
|
||||
type: no-parallel
|
||||
@@ -1698,140 +1480,6 @@ image_pull_secrets:
|
||||
- gcr
|
||||
- gar
|
||||
kind: pipeline
|
||||
name: main-test-frontend
|
||||
node:
|
||||
type: no-parallel
|
||||
platform:
|
||||
arch: amd64
|
||||
os: linux
|
||||
services: []
|
||||
steps:
|
||||
- commands:
|
||||
- echo $DRONE_RUNNER_NAME
|
||||
image: alpine:3.21.3
|
||||
name: identify-runner
|
||||
- commands:
|
||||
- yarn install --immutable || yarn install --immutable
|
||||
depends_on: []
|
||||
image: node:22.11.0-alpine
|
||||
name: yarn-install
|
||||
- commands:
|
||||
- apk add --update git bash
|
||||
- yarn betterer:ci
|
||||
depends_on:
|
||||
- yarn-install
|
||||
image: node:22.11.0-alpine
|
||||
name: betterer-frontend
|
||||
- commands:
|
||||
- yarn run ci:test-frontend
|
||||
depends_on:
|
||||
- yarn-install
|
||||
environment:
|
||||
TEST_MAX_WORKERS: 50%
|
||||
image: node:22.11.0-alpine
|
||||
name: test-frontend
|
||||
trigger:
|
||||
branch: main
|
||||
event:
|
||||
- push
|
||||
paths:
|
||||
exclude:
|
||||
- '*.md'
|
||||
- docs/**
|
||||
- latest.json
|
||||
repo:
|
||||
- grafana/grafana
|
||||
type: docker
|
||||
volumes:
|
||||
- host:
|
||||
path: /var/run/docker.sock
|
||||
name: docker
|
||||
---
|
||||
clone:
|
||||
retries: 3
|
||||
depends_on: []
|
||||
environment:
|
||||
EDITION: oss
|
||||
image_pull_secrets:
|
||||
- gcr
|
||||
- gar
|
||||
kind: pipeline
|
||||
name: main-lint-frontend
|
||||
node:
|
||||
type: no-parallel
|
||||
platform:
|
||||
arch: amd64
|
||||
os: linux
|
||||
services: []
|
||||
steps:
|
||||
- commands:
|
||||
- echo $DRONE_RUNNER_NAME
|
||||
image: alpine:3.21.3
|
||||
name: identify-runner
|
||||
- commands:
|
||||
- yarn install --immutable || yarn install --immutable
|
||||
depends_on: []
|
||||
image: node:22.11.0-alpine
|
||||
name: yarn-install
|
||||
- commands:
|
||||
- yarn run prettier:check
|
||||
- yarn run lint
|
||||
- yarn run typecheck
|
||||
depends_on:
|
||||
- yarn-install
|
||||
environment:
|
||||
TEST_MAX_WORKERS: 50%
|
||||
image: node:22.11.0-alpine
|
||||
name: lint-frontend
|
||||
- commands:
|
||||
- |-
|
||||
make i18n-extract || (echo "
|
||||
Extraction failed. Make sure that you have no dynamic translation phrases, such as 't(\`preferences.theme.\$${themeID}\`, themeName)' and that no translation key is used twice. Search the output for '[warning]' to find the offending file." && false)
|
||||
- "\n file_diff=$(git diff --dirstat public/locales)\n if
|
||||
[ -n \"$file_diff\" ]; then\n echo $file_diff\n echo
|
||||
\"\nTranslation extraction has not been committed. Please run 'make i18n-extract',
|
||||
commit the changes and push again.\"\n exit 1\n fi\n
|
||||
\ "
|
||||
depends_on:
|
||||
- yarn-install
|
||||
image: node:22-bookworm
|
||||
name: verify-i18n
|
||||
- commands:
|
||||
- yarn generate-apis
|
||||
- "\n file_diff=$(git diff ':!conf')\n if [ -n \"$file_diff\"
|
||||
]; then\n echo $file_diff\n echo \"\nAPI client
|
||||
generation has not been committed. Please run 'yarn generate-apis', commit the
|
||||
changes and push again.\"\n exit 1\n fi\n "
|
||||
depends_on:
|
||||
- yarn-install
|
||||
image: node:22-bookworm
|
||||
name: verify-api-clients
|
||||
trigger:
|
||||
branch: main
|
||||
event:
|
||||
- push
|
||||
paths:
|
||||
exclude:
|
||||
- '*.md'
|
||||
- docs/**
|
||||
- latest.json
|
||||
repo:
|
||||
- grafana/grafana
|
||||
type: docker
|
||||
volumes:
|
||||
- host:
|
||||
path: /var/run/docker.sock
|
||||
name: docker
|
||||
---
|
||||
clone:
|
||||
retries: 3
|
||||
depends_on: []
|
||||
environment:
|
||||
EDITION: oss
|
||||
image_pull_secrets:
|
||||
- gcr
|
||||
- gar
|
||||
kind: pipeline
|
||||
name: main-test-backend
|
||||
node:
|
||||
type: no-parallel
|
||||
@@ -2802,7 +2450,6 @@ volumes:
|
||||
clone:
|
||||
retries: 3
|
||||
depends_on:
|
||||
- main-test-frontend
|
||||
- main-test-backend
|
||||
- main-build-e2e-publish
|
||||
- main-integration-tests
|
||||
@@ -3974,7 +3621,6 @@ clone:
|
||||
retries: 3
|
||||
depends_on:
|
||||
- main-test-backend
|
||||
- main-test-frontend
|
||||
image_pull_secrets:
|
||||
- gcr
|
||||
- gar
|
||||
@@ -5564,6 +5210,6 @@ kind: secret
|
||||
name: gcr_credentials
|
||||
---
|
||||
kind: signature
|
||||
hmac: f55fddb4c6faf30b232ae778ec6c022c9f3d32955879e8a764c715642712c5ea
|
||||
hmac: efb7a251f741df9b3497b3c09683604b25752f1f52488aff7175fff4802e8ce3
|
||||
|
||||
...
|
||||
|
||||
+1
-1
@@ -824,7 +824,7 @@ embed.go @grafana/grafana-as-code
|
||||
/.github/workflows/trivy-scan.yml @grafana/grafana-backend-services-squad
|
||||
/.github/workflows/changelog.yml @zserge
|
||||
/.github/workflows/actions/changelog @zserge
|
||||
/.github/workflows/frontend-unit-tests.yml @grafana/grafana-frontend-platform
|
||||
/.github/workflows/pr-frontend-unit-tests.yml @grafana/grafana-frontend-platform
|
||||
/.github/workflows/frontend-lint.yml @grafana/grafana-frontend-platform
|
||||
/.github/workflows/analytics-events-report.yml @grafana/grafana-frontend-platform
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ on:
|
||||
- release-*.*.*
|
||||
|
||||
jobs:
|
||||
verify-i18n:
|
||||
lint-frontend-verify-i18n:
|
||||
name: Verify i18n
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
echo "${uncommited_error_message}"
|
||||
exit 1
|
||||
fi
|
||||
prettier:
|
||||
lint-frontend-prettier:
|
||||
name: Prettier
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
cache-dependency-path: 'yarn.lock'
|
||||
- run: yarn install --immutable --check-cache
|
||||
- run: yarn run prettier:check
|
||||
typecheck:
|
||||
lint-fronetnd-typecheck:
|
||||
name: Typecheck
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
+1
-2
@@ -7,11 +7,10 @@ on:
|
||||
- release-*.*.*
|
||||
|
||||
jobs:
|
||||
test-frontend:
|
||||
frontend-unit-tests:
|
||||
runs-on: ubuntu-latest-8-cores
|
||||
name: "Unit tests (${{ matrix.chunk }} / 8)"
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
chunk: [1, 2, 3, 4, 5, 6, 7, 8]
|
||||
steps:
|
||||
@@ -19,18 +19,10 @@ load(
|
||||
"scripts/drone/pipelines/lint_backend.star",
|
||||
"lint_backend_pipeline",
|
||||
)
|
||||
load(
|
||||
"scripts/drone/pipelines/lint_frontend.star",
|
||||
"lint_frontend_pipeline",
|
||||
)
|
||||
load(
|
||||
"scripts/drone/pipelines/test_backend.star",
|
||||
"test_backend",
|
||||
)
|
||||
load(
|
||||
"scripts/drone/pipelines/test_frontend.star",
|
||||
"test_frontend",
|
||||
)
|
||||
load(
|
||||
"scripts/drone/pipelines/trigger_downstream.star",
|
||||
"enterprise_downstream_pipeline",
|
||||
@@ -68,8 +60,6 @@ def main_pipelines():
|
||||
# Let's make an effort to reduce the amount of string constants in "depends_on" lists.
|
||||
pipelines = [
|
||||
docs_pipelines(ver_mode, trigger_docs_main()),
|
||||
test_frontend(trigger, ver_mode),
|
||||
lint_frontend_pipeline(trigger, ver_mode),
|
||||
test_backend(trigger, ver_mode),
|
||||
lint_backend_pipeline(trigger, ver_mode),
|
||||
verify_storybook(trigger, ver_mode),
|
||||
@@ -81,7 +71,6 @@ def main_pipelines():
|
||||
slack_channel = "grafana-ci-notifications",
|
||||
trigger = dict(trigger, status = ["failure"]),
|
||||
depends_on = [
|
||||
"main-test-frontend",
|
||||
"main-test-backend",
|
||||
"main-build-e2e-publish",
|
||||
"main-integration-tests",
|
||||
|
||||
@@ -24,10 +24,6 @@ load(
|
||||
"scripts/drone/pipelines/lint_backend.star",
|
||||
"lint_backend_pipeline",
|
||||
)
|
||||
load(
|
||||
"scripts/drone/pipelines/lint_frontend.star",
|
||||
"lint_frontend_pipeline",
|
||||
)
|
||||
load(
|
||||
"scripts/drone/pipelines/shellcheck.star",
|
||||
"shellcheck_pipeline",
|
||||
@@ -40,10 +36,6 @@ load(
|
||||
"scripts/drone/pipelines/test_backend.star",
|
||||
"test_backend",
|
||||
)
|
||||
load(
|
||||
"scripts/drone/pipelines/test_frontend.star",
|
||||
"test_frontend",
|
||||
)
|
||||
load(
|
||||
"scripts/drone/pipelines/verify_drone.star",
|
||||
"verify_drone",
|
||||
@@ -91,18 +83,6 @@ def pr_pipelines():
|
||||
),
|
||||
ver_mode,
|
||||
),
|
||||
test_frontend(
|
||||
get_pr_trigger(
|
||||
exclude_paths = ["pkg/**", "packaging/**", "go.sum", "go.mod"],
|
||||
),
|
||||
ver_mode,
|
||||
),
|
||||
lint_frontend_pipeline(
|
||||
get_pr_trigger(
|
||||
exclude_paths = ["pkg/**", "packaging/**", "go.sum", "go.mod"],
|
||||
),
|
||||
ver_mode,
|
||||
),
|
||||
test_backend(
|
||||
get_pr_trigger(
|
||||
include_paths = [
|
||||
|
||||
@@ -214,7 +214,7 @@ def rgm_main():
|
||||
name = "rgm-main-prerelease",
|
||||
trigger = main_trigger,
|
||||
steps = rgm_run("rgm-build", "drone_build_main.sh"),
|
||||
depends_on = ["main-test-backend", "main-test-frontend"],
|
||||
depends_on = ["main-test-backend"],
|
||||
)
|
||||
|
||||
def rgm_tag():
|
||||
|
||||
Reference in New Issue
Block a user