Skip to content

Commit 2119344

Browse files
kibanamachinedelanniIkuni17
authored
[9.1] [ci] Dep updates and tidying logs (#226133) (#226376)
# Backport This will backport the following commits from `main` to `9.1`: - [[ci] Dep updates and tidying logs (#226133)](#226133) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Alex Szabo","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-07-03T10:19:37Z","message":"[ci] Dep updates and tidying logs (#226133)\n\n## Summary\n\n(1) Remove error outputs like:\n```\n./.buildkite/scripts/common/activate_service_account.sh: line 16: gcloud: command not found\n```\n\n(2) Clean up old dependencies from `.buildkite`, replace `mocha` <->\n`jest` (fixes https://github.com/elastic/kibana/issues/187878):\n```\n | v10.9.2\n-- | --\n  | npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported\n  | npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.\n  | npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported\n  | npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported\n  | \n  | added 291 packages, and audited 292 packages in 3s\n  |\n  | 40 packages are looking for funding\n  | run `npm fund` for details\n  |  \n  | 7 vulnerabilities (1 low, 6 moderate)\n  |\n  | To address issues that do not require attention, run:\n  | npm audit fix\n  |  \n | To address all issues (including breaking changes), run:\n | npm audit fix --force\n |  \n | Run `npm audit` for details.\n```\nNow looks like:\n```\n  | npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.\n  | npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported\n  |  \n  | added 420 packages, and audited 421 packages in 3s\n  |  \n  | 51 packages are looking for funding\n  | run `npm fund` for details\n  |  \n  | found 0 vulnerabilities\n```\nThe last 2 warnings will hopefully be soon merged:\nhttps://github.com/istanbuljs/babel-plugin-istanbul/pull/301\n\n---------\n\nCo-authored-by: Brad White <[email protected]>","sha":"5481f998ace12da30e9e55619ddfa61bb706c589","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Operations","release_note:skip","backport:prev-minor","backport:prev-major","backport:version","v9.2.0","v9.0.4"],"title":"[ci] Dep updates and tidying logs","number":226133,"url":"https://github.com/elastic/kibana/pull/226133","mergeCommit":{"message":"[ci] Dep updates and tidying logs (#226133)\n\n## Summary\n\n(1) Remove error outputs like:\n```\n./.buildkite/scripts/common/activate_service_account.sh: line 16: gcloud: command not found\n```\n\n(2) Clean up old dependencies from `.buildkite`, replace `mocha` <->\n`jest` (fixes https://github.com/elastic/kibana/issues/187878):\n```\n | v10.9.2\n-- | --\n  | npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported\n  | npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.\n  | npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported\n  | npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported\n  | \n  | added 291 packages, and audited 292 packages in 3s\n  |\n  | 40 packages are looking for funding\n  | run `npm fund` for details\n  |  \n  | 7 vulnerabilities (1 low, 6 moderate)\n  |\n  | To address issues that do not require attention, run:\n  | npm audit fix\n  |  \n | To address all issues (including breaking changes), run:\n | npm audit fix --force\n |  \n | Run `npm audit` for details.\n```\nNow looks like:\n```\n  | npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.\n  | npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported\n  |  \n  | added 420 packages, and audited 421 packages in 3s\n  |  \n  | 51 packages are looking for funding\n  | run `npm fund` for details\n  |  \n  | found 0 vulnerabilities\n```\nThe last 2 warnings will hopefully be soon merged:\nhttps://github.com/istanbuljs/babel-plugin-istanbul/pull/301\n\n---------\n\nCo-authored-by: Brad White <[email protected]>","sha":"5481f998ace12da30e9e55619ddfa61bb706c589"}},"sourceBranch":"main","suggestedTargetBranches":["9.0"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/226133","number":226133,"mergeCommit":{"message":"[ci] Dep updates and tidying logs (#226133)\n\n## Summary\n\n(1) Remove error outputs like:\n```\n./.buildkite/scripts/common/activate_service_account.sh: line 16: gcloud: command not found\n```\n\n(2) Clean up old dependencies from `.buildkite`, replace `mocha` <->\n`jest` (fixes https://github.com/elastic/kibana/issues/187878):\n```\n | v10.9.2\n-- | --\n  | npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported\n  | npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.\n  | npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported\n  | npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported\n  | \n  | added 291 packages, and audited 292 packages in 3s\n  |\n  | 40 packages are looking for funding\n  | run `npm fund` for details\n  |  \n  | 7 vulnerabilities (1 low, 6 moderate)\n  |\n  | To address issues that do not require attention, run:\n  | npm audit fix\n  |  \n | To address all issues (including breaking changes), run:\n | npm audit fix --force\n |  \n | Run `npm audit` for details.\n```\nNow looks like:\n```\n  | npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.\n  | npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported\n  |  \n  | added 420 packages, and audited 421 packages in 3s\n  |  \n  | 51 packages are looking for funding\n  | run `npm fund` for details\n  |  \n  | found 0 vulnerabilities\n```\nThe last 2 warnings will hopefully be soon merged:\nhttps://github.com/istanbuljs/babel-plugin-istanbul/pull/301\n\n---------\n\nCo-authored-by: Brad White <[email protected]>","sha":"5481f998ace12da30e9e55619ddfa61bb706c589"}},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --------- Co-authored-by: Alex Szabo <[email protected]> Co-authored-by: Brad White <[email protected]>
1 parent f51769a commit 2119344

File tree

15 files changed

+6528
-2414
lines changed

15 files changed

+6528
-2414
lines changed

.buildkite/.mocharc.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

.buildkite/jest.config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
const { createJsWithTsEsmPreset } = require('ts-jest');
11+
12+
const tsJestTransformCfg = createJsWithTsEsmPreset().transform;
13+
14+
/** @type {import("jest").Config} **/
15+
module.exports = {
16+
testEnvironment: 'node',
17+
transform: {
18+
...tsJestTransformCfg,
19+
},
20+
transformIgnorePatterns: [
21+
'node_modules/(?!(@octokit/.*|universal-user-agent|before-after-hook)/)',
22+
],
23+
};

.buildkite/package-lock.json

Lines changed: 6296 additions & 2319 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.buildkite/package.json

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
"version": "1.0.0",
44
"description": "Kibana Buildkite",
55
"scripts": {
6-
"test": "mocha",
7-
"test:watch": "mocha --watch"
8-
},
9-
"overrides": {
10-
"serialize-javascript": "^6.0.2"
6+
"test": "jest --config jest.config.js",
7+
"test:watch": "jest --config jest.config.js --watch",
8+
"typecheck": "tsc --noEmit"
119
},
1210
"dependencies": {
13-
"@octokit/rest": "^18.10.0",
11+
"@octokit/rest": "^22.0.0",
1412
"adm-zip": "^0.5.16",
1513
"axios": "^1.8.3",
1614
"globby": "^11.1.0",
@@ -20,18 +18,16 @@
2018
"tslib": "*"
2119
},
2220
"devDependencies": {
23-
"@types/chai": "^4.3.3",
21+
"@types/jest": "^30.0.0",
2422
"@types/js-yaml": "^4.0.9",
2523
"@types/jscodeshift": "^0.12.0",
2624
"@types/minimatch": "^3.0.5",
2725
"@types/minimist": "^1.2.5",
28-
"@types/mocha": "^10.0.1",
2926
"@types/node": "^15.12.2",
30-
"chai": "^4.3.10",
31-
"chai-snapshot-tests": "^0.6.0",
27+
"jest": "^30.0.3",
3228
"jscodeshift": "^17.1.2",
33-
"mocha": "^11.0.1",
3429
"nock": "^12.0.2",
30+
"ts-jest": "^29.4.0",
3531
"ts-node": "^10.9.2",
3632
"typescript": "^5.1.6"
3733
},

.buildkite/pipeline-utils/buildkite/client.test.ts

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10-
import { expect } from 'chai';
1110
import { BuildkiteClient } from './client';
1211
import { Build } from './types/build';
1312
import { Job } from './types/job';
@@ -45,9 +44,9 @@ describe('BuildkiteClient', () => {
4544
} as Build;
4645

4746
const buildStatus = buildkite.getBuildStatus(build);
48-
expect(buildStatus.success).to.eql(true);
49-
expect(buildStatus.hasRetries).to.eql(true);
50-
expect(buildStatus.hasNonPreemptionRetries).to.eql(false);
47+
expect(buildStatus.success).toEqual(true);
48+
expect(buildStatus.hasRetries).toEqual(true);
49+
expect(buildStatus.hasNonPreemptionRetries).toEqual(false);
5150
});
5251

5352
it('has hasNonPreemptionRetries for spot non-preemption retries', async () => {
@@ -75,9 +74,9 @@ describe('BuildkiteClient', () => {
7574
} as Build;
7675

7776
const buildStatus = buildkite.getBuildStatus(build);
78-
expect(buildStatus.success).to.eql(true);
79-
expect(buildStatus.hasRetries).to.eql(true);
80-
expect(buildStatus.hasNonPreemptionRetries).to.eql(true);
77+
expect(buildStatus.success).toEqual(true);
78+
expect(buildStatus.hasRetries).toEqual(true);
79+
expect(buildStatus.hasNonPreemptionRetries).toEqual(true);
8180
});
8281

8382
it('has hasNonPreemptionRetries for non-spot retries with exit code -1', async () => {
@@ -103,9 +102,9 @@ describe('BuildkiteClient', () => {
103102
} as Build;
104103

105104
const buildStatus = buildkite.getBuildStatus(build);
106-
expect(buildStatus.success).to.eql(true);
107-
expect(buildStatus.hasRetries).to.eql(true);
108-
expect(buildStatus.hasNonPreemptionRetries).to.eql(true);
105+
expect(buildStatus.success).toEqual(true);
106+
expect(buildStatus.hasRetries).toEqual(true);
107+
expect(buildStatus.hasNonPreemptionRetries).toEqual(true);
109108
});
110109

111110
it('returns failure if build is failed and all jobs passed', async () => {
@@ -121,7 +120,7 @@ describe('BuildkiteClient', () => {
121120
} as Build;
122121

123122
const result = buildkite.getBuildStatus(build);
124-
expect(result.success).to.eql(false);
123+
expect(result.success).toEqual(false);
125124
});
126125
});
127126

@@ -140,7 +139,7 @@ describe('BuildkiteClient', () => {
140139
} as Build;
141140

142141
const result = buildkite.getJobStatus(build, job);
143-
expect(result.success).to.eql(true);
142+
expect(result.success).toEqual(true);
144143
});
145144

146145
it('returns failure if job is unsuccessful', async () => {
@@ -157,7 +156,7 @@ describe('BuildkiteClient', () => {
157156
} as Build;
158157

159158
const result = buildkite.getJobStatus(build, job);
160-
expect(result.success).to.eql(false);
159+
expect(result.success).toEqual(false);
161160
});
162161

163162
it('returns success if retried job is successful', async () => {
@@ -180,7 +179,7 @@ describe('BuildkiteClient', () => {
180179
} as Build;
181180

182181
const result = buildkite.getJobStatus(build, job);
183-
expect(result.success).to.eql(true);
182+
expect(result.success).toEqual(true);
184183
});
185184

186185
it('returns failure if retried job is unsuccessful', async () => {
@@ -203,7 +202,7 @@ describe('BuildkiteClient', () => {
203202
} as Build;
204203

205204
const result = buildkite.getJobStatus(build, job);
206-
expect(result.success).to.eql(false);
205+
expect(result.success).toEqual(false);
207206
});
208207

209208
it('returns failure if job is waiting_failed', async () => {
@@ -219,7 +218,7 @@ describe('BuildkiteClient', () => {
219218
} as Build;
220219

221220
const result = buildkite.getJobStatus(build, job);
222-
expect(result.success).to.eql(false);
221+
expect(result.success).toEqual(false);
223222
});
224223

225224
it('returns success if job is broken but of type: manual', async () => {
@@ -236,7 +235,7 @@ describe('BuildkiteClient', () => {
236235
} as Build;
237236

238237
const result = buildkite.getJobStatus(build, job);
239-
expect(result.success).to.eql(true);
238+
expect(result.success).toEqual(true);
240239
});
241240

242241
it('returns success if job is broken but has no exit status', async () => {
@@ -254,7 +253,7 @@ describe('BuildkiteClient', () => {
254253
} as Build;
255254

256255
const result = buildkite.getJobStatus(build, job);
257-
expect(result.success).to.eql(true);
256+
expect(result.success).toEqual(true);
258257
});
259258
});
260259
});

.buildkite/pipeline-utils/buildkite/parse_link_header.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10-
import { expect } from 'chai';
1110
import { parseLinkHeader } from './parse_link_header';
1211

1312
describe('parseLinkHeader', () => {
@@ -16,7 +15,7 @@ describe('parseLinkHeader', () => {
1615
'<https://api.buildkite.com/v2/organizations/elastic/agents?page=2&per_page=1>; rel="next", <https://api.buildkite.com/v2/organizations/elastic/agents?page=5&per_page=1>; rel="last"'
1716
);
1817

19-
expect(result).to.eql({
18+
expect(result).toEqual({
2019
last: 'https://api.buildkite.com/v2/organizations/elastic/agents?page=5&per_page=1',
2120
next: 'https://api.buildkite.com/v2/organizations/elastic/agents?page=2&per_page=1',
2221
});
@@ -28,7 +27,7 @@ describe('parseLinkHeader', () => {
2827
'https://api.buildkite.com'
2928
);
3029

31-
expect(result).to.eql({
30+
expect(result).toEqual({
3231
last: '/v2/organizations/elastic/agents?page=5&per_page=1',
3332
next: '/v2/organizations/elastic/agents?page=2&per_page=1',
3433
});

.buildkite/pipeline-utils/github/github.test.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
*/
99

1010
import { RestEndpointMethodTypes } from '@octokit/rest';
11-
import { expect } from 'chai';
1211
import { areChangesSkippable, doAnyChangesMatch } from './github';
1312

1413
describe('github', () => {
@@ -29,7 +28,7 @@ describe('github', () => {
2928
getMockChangedFile('/package.json'),
3029
]);
3130

32-
expect(match).to.eql(true);
31+
expect(match).toEqual(true);
3332
});
3433

3534
it('when all files match', async () => {
@@ -38,15 +37,15 @@ describe('github', () => {
3837
getMockChangedFile('/required/package.json'),
3938
]);
4039

41-
expect(match).to.eql(true);
40+
expect(match).toEqual(true);
4241
});
4342
});
4443

4544
describe('should return false', () => {
4645
it('when no files match with one file', async () => {
4746
const match = await doAnyChangesMatch(required, [getMockChangedFile('/index.js')]);
4847

49-
expect(match).to.eql(false);
48+
expect(match).toEqual(false);
5049
});
5150

5251
it('when no files match with multiple files', async () => {
@@ -55,7 +54,7 @@ describe('github', () => {
5554
getMockChangedFile('/package.json'),
5655
]);
5756

58-
expect(match).to.eql(false);
57+
expect(match).toEqual(false);
5958
});
6059
});
6160
});
@@ -71,15 +70,15 @@ describe('github', () => {
7170
getMockChangedFile('package.json'),
7271
]);
7372

74-
expect(execute).to.eql(false);
73+
expect(execute).toEqual(false);
7574
});
7675

7776
it('when all files are non-skippable, non-required', async () => {
7877
const execute = await areChangesSkippable(skippable, required, [
7978
getMockChangedFile('package.json'),
8079
]);
8180

82-
expect(execute).to.eql(false);
81+
expect(execute).toEqual(false);
8382
});
8483

8584
it('when a required file is present', async () => {
@@ -88,15 +87,15 @@ describe('github', () => {
8887
getMockChangedFile('docs/whatever.md'),
8988
]);
9089

91-
expect(execute).to.eql(false);
90+
expect(execute).toEqual(false);
9291
});
9392

9493
it('when a required file is renamed', async () => {
9594
const execute = await areChangesSkippable(skippable, required, [
9695
getMockChangedFile('docs/skipme.md', 'docs/required.md'),
9796
]);
9897

99-
expect(execute).to.eql(false);
98+
expect(execute).toEqual(false);
10099
});
101100
});
102101

@@ -107,7 +106,7 @@ describe('github', () => {
107106
getMockChangedFile('README.md'),
108107
]);
109108

110-
expect(execute).to.eql(true);
109+
expect(execute).toEqual(true);
111110
});
112111

113112
it('when all files are skippable and no required files are passed in', async () => {
@@ -117,7 +116,7 @@ describe('github', () => {
117116
[getMockChangedFile('docs/index.js'), getMockChangedFile('README.md')]
118117
);
119118

120-
expect(execute).to.eql(true);
119+
expect(execute).toEqual(true);
121120
});
122121

123122
it('when renamed files new and old locations are skippable', async () => {
@@ -126,7 +125,7 @@ describe('github', () => {
126125
getMockChangedFile('README.md', 'DOCS.md'),
127126
]);
128127

129-
expect(execute).to.eql(true);
128+
expect(execute).toEqual(true);
130129
});
131130
});
132131
});

0 commit comments

Comments
 (0)