[ci] Run linting before tests (#197310)

Linting is a frequent source of build failures. By increasing the cpu
count we can run this check before starting our highly-parallel tests
without impacting total build time.
This commit is contained in:
Jon 2024-10-28 12:24:00 -05:00 committed by GitHub
parent 9e9a6bb07d
commit 23b8bef073
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 184 additions and 57 deletions

View file

@ -46,6 +46,36 @@ steps:
- exit_status: '-1'
limit: 3
- command: .buildkite/scripts/steps/lint.sh
label: 'Linting'
agents:
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-16
preemptible: true
key: linting
timeout_in_minutes: 60
retry:
automatic:
- exit_status: '-1'
limit: 3
- command: .buildkite/scripts/steps/lint_with_types.sh
label: 'Linting (with types)'
agents:
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-32
preemptible: true
key: linting_with_types
timeout_in_minutes: 90
retry:
automatic:
- exit_status: '-1'
limit: 3
- wait
- command: .buildkite/scripts/steps/on_merge_api_docs.sh
@ -109,6 +139,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 3
retry:
@ -127,6 +159,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 2
retry:
@ -145,6 +179,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 8
retry:
@ -163,6 +199,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 5
retry:
@ -181,6 +219,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 1
retry:
@ -199,6 +239,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 4
retry:
@ -217,6 +259,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 6
retry:
@ -235,6 +279,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 5
retry:
@ -253,6 +299,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 6
retry:
@ -271,6 +319,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 5
retry:
@ -289,6 +339,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 6
retry:
@ -307,6 +359,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 1
retry:
@ -325,6 +379,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 1
retry:
@ -343,6 +399,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 2
retry:
@ -361,6 +419,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 2
retry:
@ -379,6 +439,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 6
retry:
@ -397,6 +459,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 8
retry:
@ -415,6 +479,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 8
retry:
@ -435,6 +501,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 20
retry:
@ -455,6 +523,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 14
retry:
@ -468,42 +538,14 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
agents:
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-2
- command: .buildkite/scripts/steps/lint.sh
label: 'Linting'
agents:
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-8
preemptible: true
key: linting
timeout_in_minutes: 60
retry:
automatic:
- exit_status: '-1'
limit: 3
- command: .buildkite/scripts/steps/lint_with_types.sh
label: 'Linting (with types)'
agents:
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-16
preemptible: true
key: linting_with_types
timeout_in_minutes: 90
retry:
automatic:
- exit_status: '-1'
limit: 3
- command: .buildkite/scripts/steps/checks.sh
label: 'Checks'
agents:

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 120
parallelism: 1 # TODO: Set parallelism when apm_cypress handles it
retry:

View file

@ -32,6 +32,30 @@ steps:
- exit_status: '-1'
limit: 3
- command: .buildkite/scripts/steps/lint.sh
label: 'Linting'
agents:
machineType: n2-standard-16
preemptible: true
key: linting
timeout_in_minutes: 60
retry:
automatic:
- exit_status: '-1'
limit: 3
- command: .buildkite/scripts/steps/lint_with_types.sh
label: 'Linting (with types)'
agents:
machineType: n2-standard-32
preemptible: true
key: linting_with_types
timeout_in_minutes: 90
retry:
automatic:
- exit_status: '-1'
limit: 3
- wait
- command: .buildkite/scripts/steps/ci_stats_ready.sh
@ -61,18 +85,6 @@ steps:
- exit_status: '*'
limit: 1
- command: .buildkite/scripts/steps/lint.sh
label: 'Linting'
agents:
machineType: n2-standard-8
preemptible: true
key: linting
timeout_in_minutes: 60
retry:
automatic:
- exit_status: '-1'
limit: 3
- command: .buildkite/scripts/steps/check_types.sh
label: 'Check Types'
agents:
@ -85,18 +97,6 @@ steps:
- exit_status: '-1'
limit: 3
- command: .buildkite/scripts/steps/lint_with_types.sh
label: 'Linting (with types)'
agents:
machineType: n2-standard-16
preemptible: true
key: linting_with_types
timeout_in_minutes: 90
retry:
automatic:
- exit_status: '-1'
limit: 3
- command: .buildkite/scripts/steps/checks.sh
label: 'Checks'
key: checks

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 30
soft_fail: true
retry:

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
artifact_paths:
- 'x-pack/plugins/observability_solution/exploratory_view/e2e/.journeys/**/*'

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
soft_fail: true
retry:

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 50
parallelism: 6
retry:

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 120
parallelism: 1
retry:

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 5
retry:
automatic:

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 120
retry:
automatic:

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 120
parallelism: 2
retry:

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 120
parallelism: 9
retry:

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 120
retry:
automatic:

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 1
retry:
@ -22,6 +24,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 1
retry:

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 1
retry:
@ -22,6 +24,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 1
retry:

View file

@ -9,6 +9,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
soft_fail: true
parallelism: 1
@ -25,6 +27,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
soft_fail: true
parallelism: 1
@ -39,6 +43,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 1
retry:
@ -53,6 +59,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 50
soft_fail: true
retry:

View file

@ -9,6 +9,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 20
retry:
@ -26,6 +28,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 14
retry:

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 5
retry:
@ -22,6 +24,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 2
retry:
@ -37,6 +41,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 5
retry:
@ -52,6 +58,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 2
retry:

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 3
retry:
@ -22,6 +24,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 2
retry:

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 2
retry:
@ -22,6 +24,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 2
retry:

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 7
retry:
@ -22,6 +24,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 8
retry:

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 8
retry:
@ -22,6 +24,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 8
retry:

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 1
retry:
@ -22,6 +24,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 1
retry:

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 5
retry:
@ -22,6 +24,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 1
retry:
@ -37,6 +41,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 4
retry:
@ -52,6 +58,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 2
retry:

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 30
artifact_paths:
- 'x-pack/plugins/observability_solution/slo/e2e/.journeys/**/*'

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
artifact_paths:
- 'x-pack/plugins/observability_solution/synthetics/e2e/.journeys/**/*'

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
artifact_paths:
- 'x-pack/plugins/observability_solution/synthetics/e2e/.journeys/**/*'

View file

@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
artifact_paths:
- 'x-pack/plugins/observability_solution/ux/e2e/.journeys/**/*'

View file

@ -1,4 +1,3 @@
.buildkite/scripts/steps/checks/precommit_hook.sh
.buildkite/scripts/steps/checks/ts_projects.sh
.buildkite/scripts/steps/checks/packages.sh
.buildkite/scripts/steps/checks/bazel_packages.sh

View file

@ -15,9 +15,9 @@ echo '--- Lint: eslint'
# after possibly commiting fixed files to the repo
set +e;
if is_pr && ! is_auto_commit_disabled; then
git ls-files | grep -E '\.(js|mjs|ts|tsx)$' | xargs -n 250 -P 4 node scripts/eslint --no-cache --fix
git ls-files | grep -E '\.(js|mjs|ts|tsx)$' | xargs -n 250 -P 8 node scripts/eslint --no-cache --fix
else
git ls-files | grep -E '\.(js|mjs|ts|tsx)$' | xargs -n 250 -P 4 node scripts/eslint --no-cache
git ls-files | grep -E '\.(js|mjs|ts|tsx)$' | xargs -n 250 -P 8 node scripts/eslint --no-cache
fi
eslint_exit=$?