From 2e703a4bb0901fcfdf4770b5cf406fabcd201713 Mon Sep 17 00:00:00 2001 From: Norbert Elter <72046715+itsyoboieltr@users.noreply.github.com> Date: Tue, 17 Dec 2024 18:22:30 +0400 Subject: [PATCH] fix: artifacts --- development/metamaskbot-build-announce.js | 34 +++++++---------------- 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/development/metamaskbot-build-announce.js b/development/metamaskbot-build-announce.js index 8fbb4fd0ffcb..f4d70d022a88 100755 --- a/development/metamaskbot-build-announce.js +++ b/development/metamaskbot-build-announce.js @@ -1,7 +1,5 @@ #!/usr/bin/env node -const { promises: fs } = require('fs'); -const path = require('path'); // Fetch is part of node js in future versions, thus triggering no-shadow // eslint-disable-next-line no-shadow const fetch = require('node-fetch'); @@ -199,14 +197,12 @@ async function start() { const benchmarkResults = {}; for (const platform of platforms) { - const benchmarkPath = path.resolve( - __dirname, - '..', - path.join('test-artifacts', platform, 'benchmark', 'pageload.json'), - ); try { - const data = await fs.readFile(benchmarkPath, 'utf8'); - const benchmark = JSON.parse(data); + const benchmark = await ( + await fetch( + `https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/test-artifacts/${platform}/benchmark/pageload.json`, + ) + ).json(); benchmarkResults[platform] = benchmark; } catch (error) { if (error.code === 'ENOENT') { @@ -303,22 +299,12 @@ async function start() { } try { - const prBundleSizeStats = JSON.parse( - await fs.readFile( - path.resolve( - __dirname, - '..', - path.join('test-artifacts', 'chrome', 'bundle_size.json'), - ), - 'utf-8', - ), - ); - - const devBundleSizeStats = await ( - await fetch(bundleSizeDataUrl, { - method: 'GET', - }) + const prBundleSizeStats = await ( + await fetch( + `https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/test-artifacts/chrome/bundle_size.json`, + ) ).json(); + const devBundleSizeStats = await (await fetch(bundleSizeDataUrl)).json(); const prSizes = { background: prBundleSizeStats.background.size,