Skip to content

Commit 262c192

Browse files
committed
[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.
1 parent 361e715 commit 262c192

30 files changed

Lines changed: 142 additions & 57 deletions

.buildkite/pipelines/on_merge.yml

Lines changed: 54 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,36 @@ steps:
4646
- exit_status: '-1'
4747
limit: 3
4848

49+
- command: .buildkite/scripts/steps/lint.sh
50+
label: 'Linting'
51+
agents:
52+
image: family/kibana-ubuntu-2004
53+
imageProject: elastic-images-prod
54+
provider: gcp
55+
machineType: n2-standard-16
56+
preemptible: true
57+
key: linting
58+
timeout_in_minutes: 60
59+
retry:
60+
automatic:
61+
- exit_status: '-1'
62+
limit: 3
63+
64+
- command: .buildkite/scripts/steps/lint_with_types.sh
65+
label: 'Linting (with types)'
66+
agents:
67+
image: family/kibana-ubuntu-2004
68+
imageProject: elastic-images-prod
69+
provider: gcp
70+
machineType: n2-standard-32
71+
preemptible: true
72+
key: linting_with_types
73+
timeout_in_minutes: 90
74+
retry:
75+
automatic:
76+
- exit_status: '-1'
77+
limit: 3
78+
4979
- wait
5080

5181
- command: .buildkite/scripts/steps/on_merge_api_docs.sh
@@ -109,6 +139,8 @@ steps:
109139
depends_on:
110140
- build
111141
- quick_checks
142+
- linting
143+
- linting_with_types
112144
timeout_in_minutes: 60
113145
parallelism: 2
114146
retry:
@@ -127,6 +159,8 @@ steps:
127159
depends_on:
128160
- build
129161
- quick_checks
162+
- linting
163+
- linting_with_types
130164
timeout_in_minutes: 60
131165
parallelism: 4
132166
retry:
@@ -145,6 +179,8 @@ steps:
145179
depends_on:
146180
- build
147181
- quick_checks
182+
- linting
183+
- linting_with_types
148184
timeout_in_minutes: 60
149185
parallelism: 6
150186
retry:
@@ -163,6 +199,8 @@ steps:
163199
depends_on:
164200
- build
165201
- quick_checks
202+
- linting
203+
- linting_with_types
166204
timeout_in_minutes: 60
167205
parallelism: 5
168206
retry:
@@ -181,6 +219,8 @@ steps:
181219
depends_on:
182220
- build
183221
- quick_checks
222+
- linting
223+
- linting_with_types
184224
timeout_in_minutes: 60
185225
parallelism: 6
186226
retry:
@@ -199,6 +239,8 @@ steps:
199239
depends_on:
200240
- build
201241
- quick_checks
242+
- linting
243+
- linting_with_types
202244
timeout_in_minutes: 60
203245
parallelism: 1
204246
retry:
@@ -217,6 +259,8 @@ steps:
217259
depends_on:
218260
- build
219261
- quick_checks
262+
- linting
263+
- linting_with_types
220264
timeout_in_minutes: 60
221265
parallelism: 2
222266
retry:
@@ -235,6 +279,8 @@ steps:
235279
depends_on:
236280
- build
237281
- quick_checks
282+
- linting
283+
- linting_with_types
238284
timeout_in_minutes: 60
239285
parallelism: 2
240286
retry:
@@ -253,6 +299,8 @@ steps:
253299
depends_on:
254300
- build
255301
- quick_checks
302+
- linting
303+
- linting_with_types
256304
timeout_in_minutes: 60
257305
parallelism: 6
258306
retry:
@@ -271,6 +319,8 @@ steps:
271319
depends_on:
272320
- build
273321
- quick_checks
322+
- linting
323+
- linting_with_types
274324
timeout_in_minutes: 60
275325
parallelism: 8
276326
retry:
@@ -291,6 +341,8 @@ steps:
291341
depends_on:
292342
- build
293343
- quick_checks
344+
- linting
345+
- linting_with_types
294346
timeout_in_minutes: 60
295347
parallelism: 20
296348
retry:
@@ -304,42 +356,14 @@ steps:
304356
depends_on:
305357
- build
306358
- quick_checks
359+
- linting
360+
- linting_with_types
307361
agents:
308362
image: family/kibana-ubuntu-2004
309363
imageProject: elastic-images-prod
310364
provider: gcp
311365
machineType: n2-standard-2
312366

313-
- command: .buildkite/scripts/steps/lint.sh
314-
label: 'Linting'
315-
agents:
316-
image: family/kibana-ubuntu-2004
317-
imageProject: elastic-images-prod
318-
provider: gcp
319-
machineType: n2-standard-8
320-
preemptible: true
321-
key: linting
322-
timeout_in_minutes: 60
323-
retry:
324-
automatic:
325-
- exit_status: '-1'
326-
limit: 3
327-
328-
- command: .buildkite/scripts/steps/lint_with_types.sh
329-
label: 'Linting (with types)'
330-
agents:
331-
image: family/kibana-ubuntu-2004
332-
imageProject: elastic-images-prod
333-
provider: gcp
334-
machineType: n2-standard-16
335-
preemptible: true
336-
key: linting_with_types
337-
timeout_in_minutes: 90
338-
retry:
339-
automatic:
340-
- exit_status: '-1'
341-
limit: 3
342-
343367
- command: .buildkite/scripts/steps/checks.sh
344368
label: 'Checks'
345369
agents:

.buildkite/pipelines/pull_request/apm_cypress.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ steps:
77
depends_on:
88
- build
99
- quick_checks
10+
- linting
11+
- linting_with_types
1012
timeout_in_minutes: 120
1113
parallelism: 1 # TODO: Set parallelism when apm_cypress handles it
1214
retry:

.buildkite/pipelines/pull_request/base.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,30 @@ steps:
3232
- exit_status: '-1'
3333
limit: 3
3434

35+
- command: .buildkite/scripts/steps/lint.sh
36+
label: 'Linting'
37+
agents:
38+
machineType: n2-standard-16
39+
preemptible: true
40+
key: linting
41+
timeout_in_minutes: 60
42+
retry:
43+
automatic:
44+
- exit_status: '-1'
45+
limit: 3
46+
47+
- command: .buildkite/scripts/steps/lint_with_types.sh
48+
label: 'Linting (with types)'
49+
agents:
50+
machineType: n2-standard-32
51+
preemptible: true
52+
key: linting_with_types
53+
timeout_in_minutes: 90
54+
retry:
55+
automatic:
56+
- exit_status: '-1'
57+
limit: 3
58+
3559
- wait
3660

3761
- command: .buildkite/scripts/steps/ci_stats_ready.sh
@@ -61,18 +85,6 @@ steps:
6185
- exit_status: '*'
6286
limit: 1
6387

64-
- command: .buildkite/scripts/steps/lint.sh
65-
label: 'Linting'
66-
agents:
67-
machineType: n2-standard-8
68-
preemptible: true
69-
key: linting
70-
timeout_in_minutes: 60
71-
retry:
72-
automatic:
73-
- exit_status: '-1'
74-
limit: 3
75-
7688
- command: .buildkite/scripts/steps/check_types.sh
7789
label: 'Check Types'
7890
agents:
@@ -85,18 +97,6 @@ steps:
8597
- exit_status: '-1'
8698
limit: 3
8799

88-
- command: .buildkite/scripts/steps/lint_with_types.sh
89-
label: 'Linting (with types)'
90-
agents:
91-
machineType: n2-standard-16
92-
preemptible: true
93-
key: linting_with_types
94-
timeout_in_minutes: 90
95-
retry:
96-
automatic:
97-
- exit_status: '-1'
98-
limit: 3
99-
100100
- command: .buildkite/scripts/steps/checks.sh
101101
label: 'Checks'
102102
key: checks

.buildkite/pipelines/pull_request/deploy_cloud.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ steps:
77
depends_on:
88
- build
99
- quick_checks
10+
- linting
11+
- linting_with_types
1012
timeout_in_minutes: 30
1113
soft_fail: true
1214
retry:

.buildkite/pipelines/pull_request/exploratory_view_plugin.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ steps:
77
depends_on:
88
- build
99
- quick_checks
10+
- linting
11+
- linting_with_types
1012
timeout_in_minutes: 60
1113
artifact_paths:
1214
- 'x-pack/plugins/observability_solution/exploratory_view/e2e/.journeys/**/*'

.buildkite/pipelines/pull_request/fips.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ steps:
77
depends_on:
88
- build
99
- quick_checks
10+
- linting
11+
- linting_with_types
1012
timeout_in_minutes: 60
1113
soft_fail: true
1214
retry:

.buildkite/pipelines/pull_request/fleet_cypress.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ steps:
77
depends_on:
88
- build
99
- quick_checks
10+
- linting
11+
- linting_with_types
1012
timeout_in_minutes: 50
1113
parallelism: 6
1214
retry:

.buildkite/pipelines/pull_request/inventory_cypress.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ steps:
77
depends_on:
88
- build
99
- quick_checks
10+
- linting
11+
- linting_with_types
1012
timeout_in_minutes: 120
1113
parallelism: 1
1214
retry:

.buildkite/pipelines/pull_request/kbn_handlebars.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ steps:
77
depends_on:
88
- build
99
- quick_checks
10+
- linting
11+
- linting_with_types
1012
timeout_in_minutes: 5
1113
retry:
1214
automatic:

.buildkite/pipelines/pull_request/observability_onboarding_cypress.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ steps:
77
depends_on:
88
- build
99
- quick_checks
10+
- linting
11+
- linting_with_types
1012
timeout_in_minutes: 120
1113
retry:
1214
automatic:

0 commit comments

Comments
 (0)