[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot]
2025-07-31 02:40:25 +00:00
committed by GitHub
parent 6d667b5f13
commit 49dff7d3f3
131 changed files with 2812 additions and 2838 deletions

View File

@@ -146,14 +146,14 @@ async function doBuildkiteAgent(action) {
const flags = ["enable-job-log-tmpfile", "no-feature-reporting"];
const options = {
"name": getHostname(),
"token": token || "xxx",
"shell": shell,
name: getHostname(),
token: token || "xxx",
shell: shell,
"job-log-path": logsPath,
"build-path": join(homePath, "builds"),
"hooks-path": join(homePath, "hooks"),
"plugins-path": join(homePath, "plugins"),
"experiment": "normalised-upload-paths,resolve-commit-after-checkout,agent-api",
experiment: "normalised-upload-paths,resolve-commit-after-checkout,agent-api",
};
let ephemeral;
@@ -174,14 +174,14 @@ async function doBuildkiteAgent(action) {
}
const tags = {
"os": getOs(),
"arch": getArch(),
"kernel": getKernel(),
"abi": getAbi(),
os: getOs(),
arch: getArch(),
kernel: getKernel(),
abi: getAbi(),
"abi-version": getAbiVersion(),
"distro": getDistro(),
distro: getDistro(),
"distro-version": getDistroVersion(),
"cloud": cloud,
cloud: cloud,
};
if (cloud) {

View File

@@ -152,14 +152,14 @@ const failedJobs =
// Platform emoji mapping
const platformMap = {
"darwin": "🍎",
"macos": "🍎",
"ubuntu": "🐧",
"debian": "🐧",
"alpine": "🐧",
"linux": "🐧",
"windows": "🪟",
"win": "🪟",
darwin: "🍎",
macos: "🍎",
ubuntu: "🐧",
debian: "🐧",
alpine: "🐧",
linux: "🐧",
windows: "🪟",
win: "🪟",
};
// Fetch annotations by scraping the build page

View File

@@ -293,14 +293,14 @@ export const google = {
}
const instance = await google.createInstance({
"name": name,
"zone": "us-central1-a",
"image": imageUrl,
name: name,
zone: "us-central1-a",
image: imageUrl,
"machine-type": instanceType || (arch === "aarch64" ? "t2a-standard-2" : "t2d-standard-2"),
"boot-disk-auto-delete": true,
"boot-disk-size": `${getDiskSize(options)}GB`,
"metadata": this.getMetadata(metadata),
"labels": Object.entries(tags || {})
metadata: this.getMetadata(metadata),
labels: Object.entries(tags || {})
.filter(([, value]) => value !== undefined)
.map(([key, value]) => `${this.getLabel(key)}=${value}`)
.join(","),

View File

@@ -342,7 +342,7 @@ const aws = {
await aws.waitImage("image-available", imageId);
const [availableImage] = await aws.describeImages({
"state": "available",
state: "available",
"image-id": imageId,
});
@@ -396,9 +396,9 @@ const aws = {
}
const baseImages = await aws.describeImages({
"state": "available",
state: "available",
"owner-alias": owner,
"name": name,
name: name,
});
if (!baseImages.length) {
@@ -485,10 +485,10 @@ const aws = {
["user-data"]: userData,
["block-device-mappings"]: JSON.stringify(blockDeviceMappings),
["metadata-options"]: JSON.stringify({
"HttpTokens": "optional",
"HttpEndpoint": "enabled",
"HttpProtocolIpv6": "enabled",
"InstanceMetadataTags": "enabled",
HttpTokens: "optional",
HttpEndpoint: "enabled",
HttpProtocolIpv6: "enabled",
InstanceMetadataTags: "enabled",
}),
["tag-specifications"]: JSON.stringify(tagSpecification),
["key-name"]: keyName,
@@ -1128,33 +1128,33 @@ async function main() {
const { values: args } = parseArgs({
allowPositionals: true,
options: {
"cloud": { type: "string", default: "aws" },
"os": { type: "string", default: "linux" },
"arch": { type: "string", default: "x64" },
"distro": { type: "string" },
"release": { type: "string" },
"name": { type: "string" },
cloud: { type: "string", default: "aws" },
os: { type: "string", default: "linux" },
arch: { type: "string", default: "x64" },
distro: { type: "string" },
release: { type: "string" },
name: { type: "string" },
"instance-type": { type: "string" },
"image-id": { type: "string" },
"image-name": { type: "string" },
"cpu-count": { type: "string" },
"memory-gb": { type: "string" },
"disk-size-gb": { type: "string" },
"preemptible": { type: "boolean" },
"spot": { type: "boolean" },
"detached": { type: "boolean" },
"tag": { type: "string", multiple: true },
"ci": { type: "boolean" },
"rdp": { type: "boolean" },
"vnc": { type: "boolean" },
"feature": { type: "string", multiple: true },
preemptible: { type: "boolean" },
spot: { type: "boolean" },
detached: { type: "boolean" },
tag: { type: "string", multiple: true },
ci: { type: "boolean" },
rdp: { type: "boolean" },
vnc: { type: "boolean" },
feature: { type: "string", multiple: true },
"user-data": { type: "string" },
"authorized-user": { type: "string", multiple: true },
"authorized-org": { type: "string", multiple: true },
"no-bootstrap": { type: "boolean" },
"buildkite-token": { type: "string" },
"tailscale-authkey": { type: "string" },
"docker": { type: "boolean" },
docker: { type: "boolean" },
},
});
@@ -1169,8 +1169,8 @@ async function main() {
}
const tags = {
"robobun": "true",
"robobun2": "true",
robobun: "true",
robobun2: "true",
"buildkite:token": args["buildkite-token"],
"tailscale:authkey": args["tailscale-authkey"],
...Object.fromEntries(args["tag"]?.map(tag => tag.split("=")) ?? []),
@@ -1257,20 +1257,20 @@ async function main() {
console.log("Creating machine:");
console.table({
"Operating System": os,
"Architecture": arch,
"Distribution": distro ? `${distro} ${release}` : release,
"CI": ci ? "Yes" : "No",
Architecture: arch,
Distribution: distro ? `${distro} ${release}` : release,
CI: ci ? "Yes" : "No",
});
const result = await cloud.createMachine(options);
const { id, name, imageId, instanceType, region, publicIp } = result;
console.log("Created machine:");
console.table({
"ID": id,
"Name": name || "N/A",
ID: id,
Name: name || "N/A",
"Image ID": imageId,
"Instance Type": instanceType,
"Region": region,
Region: region,
"IP Address": publicIp || "TBD",
});

View File

@@ -2445,7 +2445,7 @@ async function uploadJUnitToBuildKite(junitFile) {
const response = await fetch(url, {
method: "POST",
headers: {
"Authorization": `Token token="${getBuildkiteAnalyticsToken()}"`,
Authorization: `Token token="${getBuildkiteAnalyticsToken()}"`,
},
body: formData,
});

View File

@@ -48,10 +48,10 @@ export const tart = {
throw new Error(`Unsupported platform: ${inspect(platform)}`);
}
const distros = {
"15": "sequoia",
"14": "sonoma",
"13": "ventura",
"12": "monterey",
15: "sequoia",
14: "sonoma",
13: "ventura",
12: "monterey",
};
const distro = distros[release];
if (!distro) {

View File

@@ -2200,8 +2200,8 @@ export async function getCloudMetadata(name, cloud) {
*/
export function getCloudMetadataTag(tag, cloud) {
const metadata = {
"aws": `tags/instance/${tag}`,
"google": `labels/${tag.replace(":", "-")}`,
aws: `tags/instance/${tag}`,
google: `labels/${tag.replace(":", "-")}`,
};
return getCloudMetadata(metadata, cloud);