From c3b9b39b8d4207e8d438c545c5df816967b5bb24 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Fri, 4 Oct 2024 16:24:33 +0000 Subject: [PATCH] Build/Test Tools: Resolve access failure to continue sending commit performance data to Code Vitals dashboard. This originally broke in [58165] and unfortunately went unnoticed for a while because the failing request to send the data did not cause the GitHub workflows to fail. This changeset resolves the underlying access problem, which was happening because reusable GitHub workflows do not automatically receive secrets from the calling workflow. More concretely, the relevant `CODEVITALS_PROJECT_TOKEN` was not being explicitly passed to the reusable workflow. The changeset also includes a change so that in the future a failing request would cause the workflow to fail, which ensures a similar problem further down the road wouldn't go unnoticed. Props joemcgill, flixos90, swissspidy, mukesh27, sergeybiryukov Fixes #62153. See #61213. git-svn-id: https://develop.svn.wordpress.org/trunk@59170 602fd350-edb4-49c9-b593-d223f7449a82 --- .github/workflows/performance.yml | 2 ++ .github/workflows/reusable-performance.yml | 4 ++++ tests/performance/log-results.js | 1 + 3 files changed, 7 insertions(+) diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index dcd6010ad2c97..e4929763afa83 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -43,6 +43,8 @@ jobs: memcached: [ true, false ] with: memcached: ${{ matrix.memcached }} + secrets: + CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }} slack-notifications: name: Slack Notifications diff --git a/.github/workflows/reusable-performance.yml b/.github/workflows/reusable-performance.yml index bf6b31fc17a90..c6791aaf190dc 100644 --- a/.github/workflows/reusable-performance.yml +++ b/.github/workflows/reusable-performance.yml @@ -26,6 +26,10 @@ on: required: false type: 'boolean' default: false + secrets: + CODEVITALS_PROJECT_TOKEN: + description: 'The authorization token for https://www.codevitals.run/project/wordpress.' + required: true env: PUPPETEER_SKIP_DOWNLOAD: ${{ true }} diff --git a/tests/performance/log-results.js b/tests/performance/log-results.js index bf62721c1bfd8..581c0d39868b5 100644 --- a/tests/performance/log-results.js +++ b/tests/performance/log-results.js @@ -108,6 +108,7 @@ const req = https.request( options, ( res ) => { req.on( 'error', ( error ) => { console.error( error ); + process.exit( 1 ); } ); req.write( data );