Skip to content

Commit

Permalink
We're fully migrated to the new bucket (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot authored Dec 10, 2021
1 parent 601f2a1 commit c95ede2
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions src/pages/SizeComparison.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,6 @@ async function downloadSnapshot(
return response.json();
}

async function downloadS3Snapshot(key: unknown, downloadPath: string) {
const artifactServerLegacy =
"https://s3.eu-central-1.amazonaws.com/mui-org-material-ui";
const artifactServer = "https://s3.eu-central-1.amazonaws.com/mui-org-ci";
try {
return await downloadSnapshot(key, `${artifactServer}${downloadPath}`);
} catch (err) {
return downloadSnapshot(key, `${artifactServerLegacy}${downloadPath}`);
}
}

function useAzureSizeSnapshot({
azureBuildId,
circleCIBuildNumber,
Expand All @@ -157,11 +146,12 @@ function useAzureSizeSnapshot({
}

function useS3SizeSnapshot(ref: string, commitId: string): SizeSnapshot {
const downloadPath = `/artifacts/${ref}/${commitId}/size-snapshot.json`;
const artifactServer = "https://s3.eu-central-1.amazonaws.com/mui-org-ci";
const downloadUrl = `${artifactServer}/artifacts/${ref}/${commitId}/size-snapshot.json`;

const { data: sizeSnapshot } = useQuery(
["s3-snapshot-download", downloadPath],
downloadS3Snapshot
["s3-snapshot-download", downloadUrl],
downloadSnapshot
);

// NonNullable due to Suspense
Expand Down

0 comments on commit c95ede2

Please sign in to comment.