From 930b85557942f250716b135a22825aa4cf49919a Mon Sep 17 00:00:00 2001 From: Kevin Mas Ruiz Date: Thu, 1 Oct 2026 09:06:37 +0200 Subject: [PATCH] fix(download-url): s3:// buckets for alpha do not end in -latest --- packages/download-url/src/index.ts | 12 +++++++----- packages/download-url/test/index.test.ts | 18 +++++++++--------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/packages/download-url/src/index.ts b/packages/download-url/src/index.ts index 101e9df0..6da0b93b 100644 --- a/packages/download-url/src/index.ts +++ b/packages/download-url/src/index.ts @@ -200,19 +200,21 @@ async function resolve(opts: ProcessedOptions): Promise { let download: DownloadInfo | undefined; if (opts.version === 'latest-alpha') { const targets = opts.target.map(({ value }) => value); - const arch = opts.arch.includes('arm64') ? 'arm64' : 'x86_64'; - const edition = opts.enterprise ? 'enterprise-' : ''; + const isArm64 = opts.arch.includes('arm64'); + const edition = opts.enterprise ? '-enterprise' : ''; let artifact: string | undefined; let target: string | undefined; if (targets.includes('macos')) { - artifact = `mongodb-macos-${arch}-${edition}latest.tgz`; + artifact = `mongodb-macos-${isArm64 ? 'arm64' : 'x86_64'}${edition}.tgz`; target = 'macos'; } else if (targets.includes('linux_x86_64')) { target = maximizer(opts.target, (candidate) => candidate.priority)!.value; - artifact = `mongodb-linux-${arch}-${edition}${target}-latest.tgz`; + artifact = `mongodb-linux-${ + isArm64 ? 'aarch64' : 'x86_64' + }${edition}-${target}.tgz`; } else if (targets.includes('windows_x86_64')) { target = 'windows'; - artifact = `mongodb-windows-${arch}-${edition}latest.zip`; + artifact = `mongodb-windows-x86_64${edition}.zip`; } if (artifact) { download = { diff --git a/packages/download-url/test/index.test.ts b/packages/download-url/test/index.test.ts index 8c04980a..a64f78fd 100644 --- a/packages/download-url/test/index.test.ts +++ b/packages/download-url/test/index.test.ts @@ -924,7 +924,7 @@ describe('mongodb-download-url', function () { }; await verify( query, - 's3://origin-mongodb-server-latest/server-latest/mongodb-mongo-master-nightly/mongodb-macos-arm64-enterprise-latest.tgz', + 's3://origin-mongodb-server-latest/server-latest/mongodb-mongo-master-nightly/mongodb-macos-arm64-enterprise.tgz', ); }); @@ -937,7 +937,7 @@ describe('mongodb-download-url', function () { }; await verify( query, - 's3://origin-mongodb-server-latest/server-latest/mongodb-mongo-master-nightly/mongodb-macos-x86_64-enterprise-latest.tgz', + 's3://origin-mongodb-server-latest/server-latest/mongodb-mongo-master-nightly/mongodb-macos-x86_64-enterprise.tgz', ); }); @@ -950,7 +950,7 @@ describe('mongodb-download-url', function () { } as const; await verify( query, - 's3://origin-mongodb-server-latest/server-latest/mongodb-mongo-master-nightly/mongodb-windows-x86_64-enterprise-latest.zip', + 's3://origin-mongodb-server-latest/server-latest/mongodb-mongo-master-nightly/mongodb-windows-x86_64-enterprise.zip', ); }); @@ -964,7 +964,7 @@ describe('mongodb-download-url', function () { } as const; await verify( query, - 's3://origin-mongodb-server-latest/server-latest/mongodb-mongo-master-nightly/mongodb-linux-x86_64-enterprise-ubuntu2004-latest.tgz', + 's3://origin-mongodb-server-latest/server-latest/mongodb-mongo-master-nightly/mongodb-linux-x86_64-enterprise-ubuntu2004.tgz', ); }); @@ -976,7 +976,7 @@ describe('mongodb-download-url', function () { }; await verify( query, - 's3://origin-mongodb-server-latest/server-latest/mongodb-mongo-master-nightly/mongodb-macos-x86_64-latest.tgz', + 's3://origin-mongodb-server-latest/server-latest/mongodb-mongo-master-nightly/mongodb-macos-x86_64.tgz', ); }); @@ -988,7 +988,7 @@ describe('mongodb-download-url', function () { } as const; await verify( query, - 's3://origin-mongodb-server-latest/server-latest/mongodb-mongo-master-nightly/mongodb-windows-x86_64-latest.zip', + 's3://origin-mongodb-server-latest/server-latest/mongodb-mongo-master-nightly/mongodb-windows-x86_64.zip', ); }); @@ -1001,7 +1001,7 @@ describe('mongodb-download-url', function () { } as const; await verify( query, - 's3://origin-mongodb-server-latest/server-latest/mongodb-mongo-master-nightly/mongodb-linux-x86_64-ubuntu2004-latest.tgz', + 's3://origin-mongodb-server-latest/server-latest/mongodb-mongo-master-nightly/mongodb-linux-x86_64-ubuntu2004.tgz', ); }); @@ -1015,7 +1015,7 @@ describe('mongodb-download-url', function () { } as const; await verify( query, - 's3://origin-mongodb-server-latest/server-latest/mongodb-mongo-master-nightly/mongodb-linux-x86_64-enterprise-amazon2023-latest.tgz', + 's3://origin-mongodb-server-latest/server-latest/mongodb-mongo-master-nightly/mongodb-linux-x86_64-enterprise-amazon2023.tgz', ); }); @@ -1028,7 +1028,7 @@ describe('mongodb-download-url', function () { } as const; await verify( query, - 's3://origin-mongodb-server-latest/server-latest/mongodb-mongo-master-nightly/mongodb-linux-x86_64-amazon2023-latest.tgz', + 's3://origin-mongodb-server-latest/server-latest/mongodb-mongo-master-nightly/mongodb-linux-x86_64-amazon2023.tgz', ); }); });