Skip to content

Commit

Permalink
[ci] Run linting before tests (#197310)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jbudz authored Oct 28, 2024
1 parent 9e9a6bb commit 23b8bef
Show file tree
Hide file tree
Showing 30 changed files with 184 additions and 57 deletions.
102 changes: 72 additions & 30 deletions .buildkite/pipelines/on_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -109,6 +139,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 3
retry:
Expand All @@ -127,6 +159,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 2
retry:
Expand All @@ -145,6 +179,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 8
retry:
Expand All @@ -163,6 +199,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 5
retry:
Expand All @@ -181,6 +219,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 1
retry:
Expand All @@ -199,6 +239,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 4
retry:
Expand All @@ -217,6 +259,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 6
retry:
Expand All @@ -235,6 +279,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 5
retry:
Expand All @@ -253,6 +299,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 6
retry:
Expand All @@ -271,6 +319,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 5
retry:
Expand All @@ -289,6 +339,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 6
retry:
Expand All @@ -307,6 +359,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 1
retry:
Expand All @@ -325,6 +379,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 1
retry:
Expand All @@ -343,6 +399,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 2
retry:
Expand All @@ -361,6 +419,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 2
retry:
Expand All @@ -379,6 +439,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 6
retry:
Expand All @@ -397,6 +459,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 8
retry:
Expand All @@ -415,6 +479,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 8
retry:
Expand All @@ -435,6 +501,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 20
retry:
Expand All @@ -455,6 +523,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
parallelism: 14
retry:
Expand All @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions .buildkite/pipelines/pull_request/apm_cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
48 changes: 24 additions & 24 deletions .buildkite/pipelines/pull_request/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .buildkite/pipelines/pull_request/deploy_cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 30
soft_fail: true
retry:
Expand Down
2 changes: 2 additions & 0 deletions .buildkite/pipelines/pull_request/exploratory_view_plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/**/*'
Expand Down
2 changes: 2 additions & 0 deletions .buildkite/pipelines/pull_request/fips.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 60
soft_fail: true
retry:
Expand Down
2 changes: 2 additions & 0 deletions .buildkite/pipelines/pull_request/fleet_cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 50
parallelism: 6
retry:
Expand Down
2 changes: 2 additions & 0 deletions .buildkite/pipelines/pull_request/inventory_cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 120
parallelism: 1
retry:
Expand Down
2 changes: 2 additions & 0 deletions .buildkite/pipelines/pull_request/kbn_handlebars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ steps:
depends_on:
- build
- quick_checks
- linting
- linting_with_types
timeout_in_minutes: 5
retry:
automatic:
Expand Down
Loading

0 comments on commit 23b8bef

Please sign in to comment.