From f3b4e7c6b09c101c7fb6959da8b935850f652f56 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Thu, 27 Jul 2017 18:48:42 +0200 Subject: [PATCH] build: payload status should not show all digits (#6051) * Currently we always limit the difference in kilobytes to two digits after the decimal point. This also needs to be done for the full package size to avoid super long numbers. --- tools/dashboard/functions/payload-github-status.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/dashboard/functions/payload-github-status.ts b/tools/dashboard/functions/payload-github-status.ts index 60d939ac4db..4ab3915e88a 100644 --- a/tools/dashboard/functions/payload-github-status.ts +++ b/tools/dashboard/functions/payload-github-status.ts @@ -36,11 +36,12 @@ export const payloadGithubStatus = https.onRequest(async (request, response) => // Better message about the diff that shows whether the payload increased or decreased. const diffMessage = packageDiff < 0 ? 'decrease' : 'increase'; const diffFormatted = Math.abs(packageDiff).toFixed(2); + const packageSizeFormatted = packageSize.toFixed(2); await setGithubStatus(commitSha, { result: true, name: `${capitalizeFirstLetter(packageName)} Payload Size`, - description: `${packageSize}kb / ${diffFormatted}kb ${diffMessage} (ES2015 bundle)` + description: `${packageSizeFormatted}kb / ${diffFormatted}kb ${diffMessage} (ES2015 bundle)` }); response.json({message: 'Payload Github status successfully set.'});