Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions .buildkite/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .buildkite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@types/jscodeshift": "^0.12.0",
"@types/minimatch": "^3.0.5",
"@types/minimist": "^1.2.5",
"@types/node": "22.19.0",
"@types/node": "24.10.13",
"jest": "^30.0.3",
"jscodeshift": "^17.1.2",
"nock": "^12.0.2",
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.22.0
24.14.1
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.22.0
24.14.1
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"url": "https://github.com/elastic/kibana.git"
},
"engines": {
"node": "22.22.0",
"node": "24.14.1",
"yarn": "^1.22.19"
},
"resolutions": {
Expand All @@ -85,7 +85,7 @@
"**/@hono/node-server": "1.19.14",
"**/@langchain/core": "1.1.31",
"**/@langchain/google-common": "2.1.24",
"**/@types/node": "22.19.1",
"**/@types/node": "24.10.13",
"**/@types/prop-types": "15.7.5",
"**/@typescript-eslint/utils": "8.46.3",
"**/baseline-browser-mapping": "2.9.14",
Expand Down Expand Up @@ -1530,7 +1530,7 @@
"type-fest": "4.41.0",
"typescript-fsa": "3.0.0",
"typescript-fsa-reducers": "1.2.2",
"undici": "6.23.0",
"undici": "7.24.4",
"unidiff": "1.0.4",
"unified": "9.2.2",
"use-resize-observer": "9.1.0",
Expand Down Expand Up @@ -1949,7 +1949,7 @@
"@types/moment-duration-format": "2.2.7",
"@types/mustache": "4.2.5",
"@types/nock": "10.0.3",
"@types/node": "22.19.0",
"@types/node": "24.10.13",
"@types/node-fetch": "2.6.4",
"@types/node-forge": "1.3.14",
"@types/nodemailer": "7.0.6",
Expand Down
35 changes: 22 additions & 13 deletions packages/kbn-plugin-helpers/src/tasks/optimize_worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { WorkerConfig } from '@kbn/optimizer/src/common';
import { parseBundles, BundleRemotes } from '@kbn/optimizer/src/common';
import { getWebpackConfig } from '@kbn/optimizer/src/worker/webpack.config';

const send = process.send;
const send = process.send?.bind(process);
if (!send) {
throw new Error('must be run as a node.js fork');
}
Expand All @@ -36,25 +36,34 @@ process.on('message', (msg: any) => {
},
(error, stats) => {
if (error) {
send.call(process, {
success: false,
error: error.message,
});
send(
{
success: false,
error: error.message,
},
undefined
);
return;
}

if (stats?.hasErrors()) {
send.call(process, {
success: false,
error: `Failed to compile with webpack:\n${stats.toString()}`,
});
send(
{
success: false,
error: `Failed to compile with webpack:\n${stats.toString()}`,
},
undefined
);
return;
}

send.call(process, {
success: true,
warnings: stats?.hasWarnings() ? stats.toString() : '',
});
send(
{
success: true,
warnings: stats?.hasWarnings() ? stats.toString() : '',
},
undefined
);
}
);
});
27 changes: 12 additions & 15 deletions packages/kbn-relocate/healthcheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ const checkIfResourceExists = (baseDir: string, reference: string): boolean => {

const getAllFiles = (
dirPath: string,
arrayOfFiles: fs.Dirent[] = [],
arrayOfFiles: string[] = [],
extensions?: string[]
): fs.Dirent[] => {
): string[] => {
const files = fs.readdirSync(dirPath, { withFileTypes: true });

files.forEach((file) => {
Expand All @@ -77,12 +77,10 @@ const getAllFiles = (
!EXCLUDED_FOLDERS.some((folder) => filePath.startsWith(join(BASE_FOLDER, folder))) &&
!EXCLUDED_FOLDER_NAMES.includes(file.name)
) {
if (fs.statSync(filePath).isDirectory()) {
arrayOfFiles = getAllFiles(filePath, arrayOfFiles);
} else {
if (!extensions || extensions.find((ext) => file.name.endsWith(ext))) {
arrayOfFiles.push(file);
}
if (file.isDirectory()) {
arrayOfFiles = getAllFiles(filePath, arrayOfFiles, extensions);
} else if (!extensions || extensions.find((ext) => file.name.endsWith(ext))) {
arrayOfFiles.push(filePath);
}
}
});
Expand All @@ -95,14 +93,14 @@ export const findBrokenReferences = async (log: ToolingLog) => {
const moduleNames = packages.map((pkg) => pkg.directory.split('/').pop()!);
const files = getAllFiles(BASE_FOLDER, [], EXTENSIONS);

for (const file of files) {
const fileBrokenReferences = [];
const filePath = join(file.path, file.name);
for (const filePath of files) {
const fileBrokenReferences: string[] = [];
const baseDir = path.dirname(filePath);
const content = fs.readFileSync(filePath, 'utf-8');
const references = findPaths(content);

for (const ref of references) {
if (isModuleReference(moduleNames, ref) && !checkIfResourceExists(file.path, ref)) {
if (isModuleReference(moduleNames, ref) && !checkIfResourceExists(baseDir, ref)) {
fileBrokenReferences.push(ref);
}
}
Expand All @@ -116,9 +114,8 @@ export const findBrokenReferences = async (log: ToolingLog) => {
export const findBrokenLinks = async (log: ToolingLog) => {
const files = getAllFiles(BASE_FOLDER);

for (const file of files) {
const fileBrokenLinks = [];
const filePath = join(file.path, file.name);
for (const filePath of files) {
const fileBrokenLinks: string[] = [];
const content = fs.readFileSync(filePath, 'utf-8');
const references = findUrls(content);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const walkDirectory = async (dirPath: string): Promise<Meta> => {
let usesOnlyStyledComponents = true;

for (const file of await fs.readdir(dirPath, { withFileTypes: true })) {
const fullPath = path.join(file.path, file.name);
const fullPath = path.join(dirPath, file.name);

if (file.isDirectory()) {
const meta = await walkDirectory(fullPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@
*/

import { Socket } from 'net';
import type { Agent } from 'http';
import { IncomingMessage } from 'http';
import type { Agent, ClientRequest } from 'http';
import { getAgentsSocketsStats } from './get_agents_sockets_stats';
import { getHttpAgentMock, getHttpsAgentMock } from './get_agents_sockets_stats.test.mocks';

jest.mock('net');

const mockSocket = new Socket();
const mockIncomingMessage = new IncomingMessage(mockSocket);
const mockClientRequest = {} as unknown as ClientRequest;

describe('getAgentsSocketsStats()', () => {
it('extracts aggregated stats from the specified agents', () => {
Expand All @@ -30,7 +29,7 @@ describe('getAgentsSocketsStats()', () => {
node3: [mockSocket, mockSocket, mockSocket, mockSocket],
},
requests: {
node1: [mockIncomingMessage, mockIncomingMessage],
node1: [mockClientRequest, mockClientRequest],
},
});

Expand All @@ -43,7 +42,7 @@ describe('getAgentsSocketsStats()', () => {
node3: [mockSocket, mockSocket, mockSocket, mockSocket],
},
requests: {
node4: [mockIncomingMessage, mockIncomingMessage, mockIncomingMessage, mockIncomingMessage],
node4: [mockClientRequest, mockClientRequest, mockClientRequest, mockClientRequest],
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function getErrorMessage(payload?: ResponseError): string {
}

function isStreamOrBuffer(payload: ResponseError): payload is stream.Stream | Buffer {
return Buffer.isBuffer(payload) || stream.isReadable(payload as stream.Readable);
return Buffer.isBuffer(payload) || stream.isReadable(payload as stream.Readable) === true;
}

function getErrorAttributes(payload?: ResponseError): ResponseErrorAttributes | undefined {
Expand Down
13 changes: 2 additions & 11 deletions src/dev/build/lib/get_build_number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,9 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import os from 'os';
import execa from 'execa';

export async function getBuildNumber() {
if (/^win/.test(os.platform())) {
// Windows does not have the wc process and `find /C /V ""` does not consistently work
const log = await execa('git', ['log', '--format="%h"']);
return log.stdout.split('\n').length;
}

const wc = await execa.command('git log --format="%h" | wc -l', {
shell: true,
});
return parseFloat(wc.stdout.trim());
const count = await execa('git', ['rev-list', '--count', 'HEAD']);
return parseFloat(count.stdout.trim());
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ import { args } from './args';
describe('headless webgl arm mac workaround', () => {
const originalPlatform = process.platform;
afterEach(() => {
jest.restoreAllMocks();
Object.defineProperty(process, 'platform', {
value: originalPlatform,
});
});

const simulateEnv = (platform: string, arch: string) => {
const simulateEnv = (platform: string, arch: ReturnType<typeof os.arch>) => {
Object.defineProperty(process, 'platform', { value: platform });
jest.spyOn(os, 'arch').mockReturnValue(arch);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
@types/lodash@4.17.0
@types/mdast@3.0.3
@types/minimatch@3.0.3
@types/node@22.19.1
@types/node@24.10.13
@types/numeral@2.0.5
@types/parse-json@4.0.0
@types/parse5@5.0.3
Expand Down Expand Up @@ -485,7 +485,7 @@ tslib@1.14.1
tslib@2.8.1
tty-browserify@0.0.1
typed-array-buffer@1.0.3
undici-types@6.21.0
undici-types@7.16.0
unherit@1.1.0
unified@9.2.2
unist-builder@2.0.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@types/estree@1.0.8
@types/js-cookie@2.2.6
@types/json-schema@7.0.11
@types/node@22.19.1
@types/node@24.10.13
@types/trusted-types@2.0.7
@webassemblyjs/ast@1.12.1
@webassemblyjs/floating-point-hex-parser@1.11.6
Expand Down Expand Up @@ -145,7 +145,7 @@ toggle-selection@1.0.6
ts-easing@0.2.0
tslib@1.14.1
tslib@2.8.1
undici-types@6.21.0
undici-types@7.16.0
update-browserslist-db@1.2.3
uri-js@4.2.2
util-deprecate@1.0.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@types/estree@0.0.50
@types/estree@1.0.8
@types/json-schema@7.0.11
@types/node@22.19.1
@types/node@24.10.13
@webassemblyjs/ast@1.12.1
@webassemblyjs/floating-point-hex-parser@1.11.6
@webassemblyjs/helper-api-error@1.11.6
Expand Down Expand Up @@ -94,7 +94,7 @@ tapable@2.3.0
terser-webpack-plugin@5.3.17
terser@5.40.0
tslib@1.14.1
undici-types@6.21.0
undici-types@7.16.0
update-browserslist-db@1.2.3
uri-js@4.2.2
vscode-jsonrpc@8.2.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ export async function bootstrap({ dir, log }: CheckoutAndBootstrapOptions) {
await writeVersionFile(log, Path.join(dir, '.nvmrc'), currentNodeVersion, false);

// set ignore-engines to true to prevent validation errors from other spawned processes
await exec(`yarn config set ignore-engines true`, {
await exec('yarn', ['config', 'set', 'ignore-engines', 'true'], {
cwd: dir,
log,
});

await exec(`yarn kbn bootstrap --force-install`, {
await exec('yarn', ['kbn', 'bootstrap', '--force-install'], {
log,
cwd: dir,
env: {
Expand Down
Loading
Loading