From 46d65ae0dcce5800ce4ce3f6715ecf9f1dd4a97c Mon Sep 17 00:00:00 2001 From: Jordan Porter Date: Fri, 27 Dec 2024 10:56:16 -0700 Subject: [PATCH 01/11] add nightly run with trigger --- .github/workflows/nightly.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index b16ccacb9..a83c8cadc 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -14,6 +14,26 @@ jobs: browser-target: chrome@latest secrets: inherit + track-size: + name: Track Build Size + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: main + - uses: actions/setup-node@v4 + with: + node-version: 22.11.0 # See package.json for the stable node version that works with our testing. Do not change this unless you know what you are doing as some node versions do not play nicely with our testing server. + - name: Install project dependencies + run: npm ci + - name: Build dev + run: npm run cdn:build:dev + # track build size as custom event + - name: Report local stats as NR event + uses: './.github/actions/nr-report-build-size' + with: + nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} + verify-ab-assets: name: Verify A/B Assets timeout-minutes: 60 From 1251f946213aa91105c664c32b583019a2343bf8 Mon Sep 17 00:00:00 2001 From: Jordan Porter Date: Fri, 27 Dec 2024 11:00:14 -0700 Subject: [PATCH 02/11] add nightly run with trigger --- .github/workflows/nightly.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a83c8cadc..15b7ca262 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -33,6 +33,7 @@ jobs: uses: './.github/actions/nr-report-build-size' with: nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} + trigger: nightly verify-ab-assets: name: Verify A/B Assets From 6f8eb67aa842dbda2a165170686d276ced70ca94 Mon Sep 17 00:00:00 2001 From: Jordan Porter Date: Fri, 27 Dec 2024 13:35:21 -0700 Subject: [PATCH 03/11] add nightly run with trigger --- .github/workflows/nightly.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 15b7ca262..4be0480af 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -26,6 +26,7 @@ jobs: node-version: 22.11.0 # See package.json for the stable node version that works with our testing. Do not change this unless you know what you are doing as some node versions do not play nicely with our testing server. - name: Install project dependencies run: npm ci + # need to build so we have a stats file to reference - name: Build dev run: npm run cdn:build:dev # track build size as custom event From 2c193298c4d956fd573eb10adecf41dabe6fd6e6 Mon Sep 17 00:00:00 2001 From: Jordan Porter Date: Fri, 27 Dec 2024 13:40:41 -0700 Subject: [PATCH 04/11] point at nr repo --- .github/actions/nr-report-build-size/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/nr-report-build-size/action.yml b/.github/actions/nr-report-build-size/action.yml index d5a70790a..3c31d2d95 100644 --- a/.github/actions/nr-report-build-size/action.yml +++ b/.github/actions/nr-report-build-size/action.yml @@ -22,7 +22,7 @@ runs: full=$(cat ./build/nr-full-standard.stats.json); echo "full=$full" >> $GITHUB_OUTPUT; spa=$(cat ./build/nr-spa-standard.stats.json); echo "spa=$spa" >> $GITHUB_OUTPUT; - name: Report rum size to NR - uses: metal-messiah/webpack-build-size-action@main + uses: newrelic/capture-build-size@main with: nr-api-key: ${{ inputs.nr-api-key }} nr-account-id: '550352' @@ -30,7 +30,7 @@ runs: analysis-file-contents: ${{ steps.get-stats.outputs.rum }} file-name-filter: '.min.js' - name: Report full size to NR - uses: metal-messiah/webpack-build-size-action@main + uses: newrelic/capture-build-size@main with: nr-api-key: ${{ inputs.nr-api-key }} nr-account-id: '550352' @@ -38,7 +38,7 @@ runs: analysis-file-contents: ${{ steps.get-stats.outputs.full }} file-name-filter: '.min.js' - name: Report spa size to NR - uses: metal-messiah/webpack-build-size-action@main + uses: newrelic/capture-build-size@main with: nr-api-key: ${{ inputs.nr-api-key }} nr-account-id: '550352' From 6af07a95f7eb5511c0e6819e5729aa4a87c9d3cb Mon Sep 17 00:00:00 2001 From: Jordan Porter Date: Sat, 28 Dec 2024 18:36:38 -0700 Subject: [PATCH 05/11] update actions to capture dev and triggers --- .../actions/nr-report-build-size/action.yml | 47 -------------- .github/workflows/nightly.yml | 32 +++++++--- .github/workflows/publish-dev.yml | 35 ++++++++++- .github/workflows/pull-request-checks.yml | 61 ++++++++++++++++++- 4 files changed, 116 insertions(+), 59 deletions(-) delete mode 100644 .github/actions/nr-report-build-size/action.yml diff --git a/.github/actions/nr-report-build-size/action.yml b/.github/actions/nr-report-build-size/action.yml deleted file mode 100644 index 3c31d2d95..000000000 --- a/.github/actions/nr-report-build-size/action.yml +++ /dev/null @@ -1,47 +0,0 @@ -# This composite action is used to report the local build size to New Relic -# You must build the agent before running this action - -name: 'Report Build Size to New Relic' - -inputs: - nr-api-key: - description: 'NR API Key for reporting events' - required: true - -runs: - using: "composite" - steps: - - name: Install dependencies - run: npm install --silent --no-progress --prefix $GITHUB_ACTION_PATH/.. - shell: bash - - name: Get local stats - id: get-stats - shell: bash - run: | - rum=$(cat ./build/nr-rum-standard.stats.json); echo "rum=$rum" >> $GITHUB_OUTPUT; - full=$(cat ./build/nr-full-standard.stats.json); echo "full=$full" >> $GITHUB_OUTPUT; - spa=$(cat ./build/nr-spa-standard.stats.json); echo "spa=$spa" >> $GITHUB_OUTPUT; - - name: Report rum size to NR - uses: newrelic/capture-build-size@main - with: - nr-api-key: ${{ inputs.nr-api-key }} - nr-account-id: '550352' - nr-env: 'staging' - analysis-file-contents: ${{ steps.get-stats.outputs.rum }} - file-name-filter: '.min.js' - - name: Report full size to NR - uses: newrelic/capture-build-size@main - with: - nr-api-key: ${{ inputs.nr-api-key }} - nr-account-id: '550352' - nr-env: 'staging' - analysis-file-contents: ${{ steps.get-stats.outputs.full }} - file-name-filter: '.min.js' - - name: Report spa size to NR - uses: newrelic/capture-build-size@main - with: - nr-api-key: ${{ inputs.nr-api-key }} - nr-account-id: '550352' - nr-env: 'staging' - analysis-file-contents: ${{ steps.get-stats.outputs.spa }} - file-name-filter: '.min.js' diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 4be0480af..2d01a75d8 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -26,15 +26,33 @@ jobs: node-version: 22.11.0 # See package.json for the stable node version that works with our testing. Do not change this unless you know what you are doing as some node versions do not play nicely with our testing server. - name: Install project dependencies run: npm ci - # need to build so we have a stats file to reference - - name: Build dev - run: npm run cdn:build:dev - # track build size as custom event - - name: Report local stats as NR event - uses: './.github/actions/nr-report-build-size' + - name: Report lite size to NR + uses: newrelic/capture-build-size@main with: nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} - trigger: nightly + nr-account-id: '550352' + nr-env: 'staging' + analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-rum-standard.stats.json' + file-name-filter: '.min.js' + trigger: 'nightly' + - name: Report pro size to NR + uses: newrelic/capture-build-size@main + with: + nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} + nr-account-id: '550352' + nr-env: 'staging' + analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-full-standard.stats.json' + file-name-filter: '.min.js' + trigger: 'nightly' + - name: Report spa size to NR + uses: newrelic/capture-build-size@main + with: + nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} + nr-account-id: '550352' + nr-env: 'staging' + analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-full-standard.stats.json' + file-name-filter: '.min.js' + trigger: 'nightly' verify-ab-assets: name: Verify A/B Assets diff --git a/.github/workflows/publish-dev.yml b/.github/workflows/publish-dev.yml index 7408eed32..e06b0e334 100644 --- a/.github/workflows/publish-dev.yml +++ b/.github/workflows/publish-dev.yml @@ -99,11 +99,40 @@ jobs: commit: "${{ github.sha }}" version: "${{ github.ref_name }}" user: "${{ github.actor }}" - # track build size as custom event - - name: Report local stats as NR event - uses: './.github/actions/nr-report-build-size' + - name: Get local stats + id: get-stats + shell: bash + run: | + rum=$(cat ./build/nr-rum-standard.stats.json); echo "rum=$rum" >> $GITHUB_OUTPUT; + full=$(cat ./build/nr-full-standard.stats.json); echo "full=$full" >> $GITHUB_OUTPUT; + spa=$(cat ./build/nr-spa-standard.stats.json); echo "spa=$spa" >> $GITHUB_OUTPUT; + - name: Report lite size to NR + uses: newrelic/capture-build-size@main + with: + nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} + nr-account-id: '550352' + nr-env: 'staging' + analysis-file-contents: ${{ steps.get-stats.outputs.rum }} + file-name-filter: '.min.js' + trigger: 'publish-dev' + - name: Report pro size to NR + uses: newrelic/capture-build-size@main + with: + nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} + nr-account-id: '550352' + nr-env: 'staging' + analysis-file-contents: ${{ steps.get-stats.outputs.full }} + file-name-filter: '.min.js' + trigger: 'publish-dev' + - name: Report spa size to NR + uses: newrelic/capture-build-size@main with: nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} + nr-account-id: '550352' + nr-env: 'staging' + analysis-file-contents: ${{ steps.get-stats.outputs.spa }} + file-name-filter: '.min.js' + trigger: 'publish-dev' # Publish dev to staging NRDB # publish-dev-nr: diff --git a/.github/workflows/pull-request-checks.yml b/.github/workflows/pull-request-checks.yml index 2e70e552c..429448bd8 100644 --- a/.github/workflows/pull-request-checks.yml +++ b/.github/workflows/pull-request-checks.yml @@ -97,10 +97,67 @@ jobs: pr_number: ${{ github.event.number }} comment: ${{ steps.asset-size-report.outputs.results }} comment_tag: - - name: Report local stats as NR event - uses: './.github/actions/nr-report-build-size' + - name: Get local stats + id: get-stats + shell: bash + run: | + rum=$(cat ./build/nr-rum-standard.stats.json); echo "rum=$rum" >> $GITHUB_OUTPUT; + full=$(cat ./build/nr-full-standard.stats.json); echo "full=$full" >> $GITHUB_OUTPUT; + spa=$(cat ./build/nr-spa-standard.stats.json); echo "spa=$spa" >> $GITHUB_OUTPUT; + - name: Report lite size to NR + uses: newrelic/capture-build-size@main + with: + nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} + nr-account-id: '550352' + nr-env: 'staging' + analysis-file-contents: ${{ steps.get-stats.outputs.rum }} + file-name-filter: '.min.js' + trigger: 'pull-request-checks' + - name: Report pro size to NR + uses: newrelic/capture-build-size@main + with: + nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} + nr-account-id: '550352' + nr-env: 'staging' + analysis-file-contents: ${{ steps.get-stats.outputs.full }} + file-name-filter: '.min.js' + trigger: 'pull-request-checks' + - name: Report spa size to NR + uses: newrelic/capture-build-size@main + with: + nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} + nr-account-id: '550352' + nr-env: 'staging' + analysis-file-contents: ${{ steps.get-stats.outputs.spa }} + file-name-filter: '.min.js' + trigger: 'pull-request-checks' + - name: Report dev lite size to NR + uses: newrelic/capture-build-size@main + with: + nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} + nr-account-id: '550352' + nr-env: 'staging' + analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-rum-standard.stats.json' + file-name-filter: '.min.js' + trigger: 'pull-request-checks' + - name: Report dev pro size to NR + uses: newrelic/capture-build-size@main + with: + nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} + nr-account-id: '550352' + nr-env: 'staging' + analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-full-standard.stats.json' + file-name-filter: '.min.js' + trigger: 'pull-request-checks' + - name: Report dev spa size to NR + uses: newrelic/capture-build-size@main with: nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} + nr-account-id: '550352' + nr-env: 'staging' + analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-full-standard.stats.json' + file-name-filter: '.min.js' + trigger: 'pull-request-checks' # Jobs for workflow_dispatch events From 01dba6b04e709ff0ae3c7e518b787f97c9d8cd85 Mon Sep 17 00:00:00 2001 From: Jordan Porter Date: Sat, 28 Dec 2024 19:59:34 -0700 Subject: [PATCH 06/11] update actions to capture dev and triggers --- .github/workflows/pull-request-checks.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pull-request-checks.yml b/.github/workflows/pull-request-checks.yml index 429448bd8..0dec76f8a 100644 --- a/.github/workflows/pull-request-checks.yml +++ b/.github/workflows/pull-request-checks.yml @@ -140,6 +140,7 @@ jobs: analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-rum-standard.stats.json' file-name-filter: '.min.js' trigger: 'pull-request-checks' + version: 'main' - name: Report dev pro size to NR uses: newrelic/capture-build-size@main with: @@ -149,6 +150,7 @@ jobs: analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-full-standard.stats.json' file-name-filter: '.min.js' trigger: 'pull-request-checks' + version: 'main' - name: Report dev spa size to NR uses: newrelic/capture-build-size@main with: @@ -158,6 +160,7 @@ jobs: analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-full-standard.stats.json' file-name-filter: '.min.js' trigger: 'pull-request-checks' + version: 'main' # Jobs for workflow_dispatch events From e43762e310b4e2f00d63137717d70fbdd2c1b786 Mon Sep 17 00:00:00 2001 From: Jordan Porter Date: Sat, 28 Dec 2024 20:02:21 -0700 Subject: [PATCH 07/11] update actions to capture dev and triggers --- .github/workflows/pull-request-checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-checks.yml b/.github/workflows/pull-request-checks.yml index 0dec76f8a..9c8b972e4 100644 --- a/.github/workflows/pull-request-checks.yml +++ b/.github/workflows/pull-request-checks.yml @@ -157,7 +157,7 @@ jobs: nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} nr-account-id: '550352' nr-env: 'staging' - analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-full-standard.stats.json' + analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-spa-standard.stats.json' file-name-filter: '.min.js' trigger: 'pull-request-checks' version: 'main' From 5e45987fcb54dfb9a67bb88fba08dfe77a8ebad8 Mon Sep 17 00:00:00 2001 From: Jordan Porter Date: Mon, 30 Dec 2024 09:07:45 -0700 Subject: [PATCH 08/11] convert to secrets --- .github/workflows/nightly.yml | 6 +++--- .github/workflows/publish-dev.yml | 11 +++++++---- .github/workflows/pull-request-checks.yml | 12 ++++++------ 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 2d01a75d8..c8d2e171c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -30,7 +30,7 @@ jobs: uses: newrelic/capture-build-size@main with: nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} - nr-account-id: '550352' + nr-account-id: ${{ secrets.INTERNAL_STAGING_INGEST_ACCOUNT_ID }} nr-env: 'staging' analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-rum-standard.stats.json' file-name-filter: '.min.js' @@ -39,7 +39,7 @@ jobs: uses: newrelic/capture-build-size@main with: nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} - nr-account-id: '550352' + nr-account-id: ${{ secrets.INTERNAL_STAGING_INGEST_ACCOUNT_ID }} nr-env: 'staging' analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-full-standard.stats.json' file-name-filter: '.min.js' @@ -48,7 +48,7 @@ jobs: uses: newrelic/capture-build-size@main with: nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} - nr-account-id: '550352' + nr-account-id: ${{ secrets.INTERNAL_STAGING_INGEST_ACCOUNT_ID }} nr-env: 'staging' analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-full-standard.stats.json' file-name-filter: '.min.js' diff --git a/.github/workflows/publish-dev.yml b/.github/workflows/publish-dev.yml index e06b0e334..f506e1868 100644 --- a/.github/workflows/publish-dev.yml +++ b/.github/workflows/publish-dev.yml @@ -95,7 +95,7 @@ jobs: uses: newrelic/deployment-marker-action@v2.3.0 with: apiKey: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} - guid: NTUwMzUyfEJST1dTRVJ8QVBQTElDQVRJT058ODkzODM5MjI + guid: ${{ secrets.INTERNAL_STAGING_INGEST_ENTITY_GUID }} commit: "${{ github.sha }}" version: "${{ github.ref_name }}" user: "${{ github.actor }}" @@ -110,29 +110,32 @@ jobs: uses: newrelic/capture-build-size@main with: nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} - nr-account-id: '550352' + nr-account-id: ${{ secrets.INTERNAL_STAGING_INGEST_ACCOUNT_ID }} nr-env: 'staging' analysis-file-contents: ${{ steps.get-stats.outputs.rum }} file-name-filter: '.min.js' trigger: 'publish-dev' + traverse: true - name: Report pro size to NR uses: newrelic/capture-build-size@main with: nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} - nr-account-id: '550352' + nr-account-id: ${{ secrets.INTERNAL_STAGING_INGEST_ACCOUNT_ID }} nr-env: 'staging' analysis-file-contents: ${{ steps.get-stats.outputs.full }} file-name-filter: '.min.js' trigger: 'publish-dev' + traverse: true - name: Report spa size to NR uses: newrelic/capture-build-size@main with: nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} - nr-account-id: '550352' + nr-account-id: ${{ secrets.INTERNAL_STAGING_INGEST_ACCOUNT_ID }} nr-env: 'staging' analysis-file-contents: ${{ steps.get-stats.outputs.spa }} file-name-filter: '.min.js' trigger: 'publish-dev' + traverse: true # Publish dev to staging NRDB # publish-dev-nr: diff --git a/.github/workflows/pull-request-checks.yml b/.github/workflows/pull-request-checks.yml index 9c8b972e4..1265352db 100644 --- a/.github/workflows/pull-request-checks.yml +++ b/.github/workflows/pull-request-checks.yml @@ -108,7 +108,7 @@ jobs: uses: newrelic/capture-build-size@main with: nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} - nr-account-id: '550352' + nr-account-id: ${{ secrets.INTERNAL_STAGING_INGEST_ACCOUNT_ID }} nr-env: 'staging' analysis-file-contents: ${{ steps.get-stats.outputs.rum }} file-name-filter: '.min.js' @@ -117,7 +117,7 @@ jobs: uses: newrelic/capture-build-size@main with: nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} - nr-account-id: '550352' + nr-account-id: ${{ secrets.INTERNAL_STAGING_INGEST_ACCOUNT_ID }} nr-env: 'staging' analysis-file-contents: ${{ steps.get-stats.outputs.full }} file-name-filter: '.min.js' @@ -126,7 +126,7 @@ jobs: uses: newrelic/capture-build-size@main with: nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} - nr-account-id: '550352' + nr-account-id: ${{ secrets.INTERNAL_STAGING_INGEST_ACCOUNT_ID }} nr-env: 'staging' analysis-file-contents: ${{ steps.get-stats.outputs.spa }} file-name-filter: '.min.js' @@ -135,7 +135,7 @@ jobs: uses: newrelic/capture-build-size@main with: nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} - nr-account-id: '550352' + nr-account-id: ${{ secrets.INTERNAL_STAGING_INGEST_ACCOUNT_ID }} nr-env: 'staging' analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-rum-standard.stats.json' file-name-filter: '.min.js' @@ -145,7 +145,7 @@ jobs: uses: newrelic/capture-build-size@main with: nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} - nr-account-id: '550352' + nr-account-id: ${{ secrets.INTERNAL_STAGING_INGEST_ACCOUNT_ID }} nr-env: 'staging' analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-full-standard.stats.json' file-name-filter: '.min.js' @@ -155,7 +155,7 @@ jobs: uses: newrelic/capture-build-size@main with: nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} - nr-account-id: '550352' + nr-account-id: ${{ secrets.INTERNAL_STAGING_INGEST_ACCOUNT_ID }} nr-env: 'staging' analysis-file-url: 'https://js-agent.newrelic.com/dev/nr-spa-standard.stats.json' file-name-filter: '.min.js' From c4e63489864b93403d053041c91b769fc9387384 Mon Sep 17 00:00:00 2001 From: Jordan Porter Date: Mon, 30 Dec 2024 12:19:13 -0700 Subject: [PATCH 09/11] track build size for published assets --- .github/workflows/publish-release.yml | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 90ccb7d6b..b42872fdc 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -61,6 +61,46 @@ jobs: fastly_key: ${{ secrets.FASTLY_PURGE_KEY }} fastly_service: staging-js-agent.newrelic.com asset_path: ${{ join(fromJson(steps.s3-upload.outputs.results).*.Key, ' ') }} + - name: Get version number + id: agent-loader-version + run: echo "results=$(cat package.json | jq -r '.version')" >> $GITHUB_OUTPUT + - name: Get local stats + id: get-stats + shell: bash + run: | + rum=$(cat ./build/nr-rum-standard.stats.json); echo "rum=$rum" >> $GITHUB_OUTPUT; + full=$(cat ./build/nr-full-standard.stats.json); echo "full=$full" >> $GITHUB_OUTPUT; + spa=$(cat ./build/nr-spa-standard.stats.json); echo "spa=$spa" >> $GITHUB_OUTPUT; + - name: Report lite size to NR + uses: newrelic/capture-build-size@main + with: + nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} + nr-account-id: ${{ secrets.INTERNAL_STAGING_INGEST_ACCOUNT_ID }} + nr-env: 'staging' + analysis-file-contents: ${{ steps.get-stats.outputs.rum }} + file-name-filter: '.min.js' + trigger: 'publish-release' + version: v${{ steps.agent-loader-version.outputs.results }} + - name: Report pro size to NR + uses: newrelic/capture-build-size@main + with: + nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} + nr-account-id: ${{ secrets.INTERNAL_STAGING_INGEST_ACCOUNT_ID }} + nr-env: 'staging' + analysis-file-contents: ${{ steps.get-stats.outputs.full }} + file-name-filter: '.min.js' + trigger: 'publish-release' + version: v${{ steps.agent-loader-version.outputs.results }} + - name: Report spa size to NR + uses: newrelic/capture-build-size@main + with: + nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} + nr-account-id: ${{ secrets.INTERNAL_STAGING_INGEST_ACCOUNT_ID }} + nr-env: 'staging' + analysis-file-contents: ${{ steps.get-stats.outputs.spa }} + file-name-filter: '.min.js' + trigger: 'publish-release' + version: v${{ steps.agent-loader-version.outputs.results }} # Publish the new "current" version to s3 before the prod a/b scripts have been built publish-current-to-s3: From 2d83c9724d1677a4d7b5783a665e165c73875356 Mon Sep 17 00:00:00 2001 From: Jordan Porter Date: Wed, 22 Jan 2025 16:41:48 -0700 Subject: [PATCH 10/11] include build version for release stats --- .github/workflows/publish-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index b42872fdc..525fae7a6 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -68,9 +68,9 @@ jobs: id: get-stats shell: bash run: | - rum=$(cat ./build/nr-rum-standard.stats.json); echo "rum=$rum" >> $GITHUB_OUTPUT; - full=$(cat ./build/nr-full-standard.stats.json); echo "full=$full" >> $GITHUB_OUTPUT; - spa=$(cat ./build/nr-spa-standard.stats.json); echo "spa=$spa" >> $GITHUB_OUTPUT; + rum=$(cat ./build/nr-rum-standard-${{ steps.agent-loader-version.outputs.results }}.stats.json); echo "rum=$rum" >> $GITHUB_OUTPUT; + full=$(cat ./build/nr-full-standard-${{ steps.agent-loader-version.outputs.results }}.stats.json); echo "full=$full" >> $GITHUB_OUTPUT; + spa=$(cat ./build/nr-spa-standard-${{ steps.agent-loader-version.outputs.results }}.stats.json); echo "spa=$spa" >> $GITHUB_OUTPUT; - name: Report lite size to NR uses: newrelic/capture-build-size@main with: From f907290f521f4ca0a30f7d7078c790f913b33fb9 Mon Sep 17 00:00:00 2001 From: Jordan Porter Date: Thu, 23 Jan 2025 09:02:44 -0700 Subject: [PATCH 11/11] move to separate job after all the critical jobs have finished --- .github/workflows/publish-release.yml | 97 ++++++++++++++++----------- 1 file changed, 57 insertions(+), 40 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 525fae7a6..58421602b 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -61,46 +61,6 @@ jobs: fastly_key: ${{ secrets.FASTLY_PURGE_KEY }} fastly_service: staging-js-agent.newrelic.com asset_path: ${{ join(fromJson(steps.s3-upload.outputs.results).*.Key, ' ') }} - - name: Get version number - id: agent-loader-version - run: echo "results=$(cat package.json | jq -r '.version')" >> $GITHUB_OUTPUT - - name: Get local stats - id: get-stats - shell: bash - run: | - rum=$(cat ./build/nr-rum-standard-${{ steps.agent-loader-version.outputs.results }}.stats.json); echo "rum=$rum" >> $GITHUB_OUTPUT; - full=$(cat ./build/nr-full-standard-${{ steps.agent-loader-version.outputs.results }}.stats.json); echo "full=$full" >> $GITHUB_OUTPUT; - spa=$(cat ./build/nr-spa-standard-${{ steps.agent-loader-version.outputs.results }}.stats.json); echo "spa=$spa" >> $GITHUB_OUTPUT; - - name: Report lite size to NR - uses: newrelic/capture-build-size@main - with: - nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} - nr-account-id: ${{ secrets.INTERNAL_STAGING_INGEST_ACCOUNT_ID }} - nr-env: 'staging' - analysis-file-contents: ${{ steps.get-stats.outputs.rum }} - file-name-filter: '.min.js' - trigger: 'publish-release' - version: v${{ steps.agent-loader-version.outputs.results }} - - name: Report pro size to NR - uses: newrelic/capture-build-size@main - with: - nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} - nr-account-id: ${{ secrets.INTERNAL_STAGING_INGEST_ACCOUNT_ID }} - nr-env: 'staging' - analysis-file-contents: ${{ steps.get-stats.outputs.full }} - file-name-filter: '.min.js' - trigger: 'publish-release' - version: v${{ steps.agent-loader-version.outputs.results }} - - name: Report spa size to NR - uses: newrelic/capture-build-size@main - with: - nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} - nr-account-id: ${{ secrets.INTERNAL_STAGING_INGEST_ACCOUNT_ID }} - nr-env: 'staging' - analysis-file-contents: ${{ steps.get-stats.outputs.spa }} - file-name-filter: '.min.js' - trigger: 'publish-release' - version: v${{ steps.agent-loader-version.outputs.results }} # Publish the new "current" version to s3 before the prod a/b scripts have been built publish-current-to-s3: @@ -330,3 +290,60 @@ jobs: repo_owner: newrelic repo_name: newrelic-browser-agent-release event_type: new_release + + track-build-size: + needs: [notify-release-repo] + runs-on: ubuntu-latest + timeout-minutes: 30 + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22.11.0 # See package.json for the stable node version that works with our testing. Do not change this unless you know what you are doing as some node versions do not play nicely with our testing server. + - name: Install project dependencies + run: npm ci + - name: Build prod + run: npm run cdn:build:prod + - name: Get version number + id: agent-loader-version + run: echo "results=$(cat package.json | jq -r '.version')" >> $GITHUB_OUTPUT + - name: Get local stats + id: get-stats + shell: bash + run: | + rum=$(cat ./build/nr-rum-standard-${{ steps.agent-loader-version.outputs.results }}.stats.json); echo "rum=$rum" >> $GITHUB_OUTPUT; + full=$(cat ./build/nr-full-standard-${{ steps.agent-loader-version.outputs.results }}.stats.json); echo "full=$full" >> $GITHUB_OUTPUT; + spa=$(cat ./build/nr-spa-standard-${{ steps.agent-loader-version.outputs.results }}.stats.json); echo "spa=$spa" >> $GITHUB_OUTPUT; + - name: Report lite size to NR + uses: newrelic/capture-build-size@main + with: + nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} + nr-account-id: ${{ secrets.INTERNAL_STAGING_INGEST_ACCOUNT_ID }} + nr-env: 'staging' + analysis-file-contents: ${{ steps.get-stats.outputs.rum }} + file-name-filter: '.min.js' + trigger: 'publish-release' + version: v${{ steps.agent-loader-version.outputs.results }} + - name: Report pro size to NR + uses: newrelic/capture-build-size@main + with: + nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} + nr-account-id: ${{ secrets.INTERNAL_STAGING_INGEST_ACCOUNT_ID }} + nr-env: 'staging' + analysis-file-contents: ${{ steps.get-stats.outputs.full }} + file-name-filter: '.min.js' + trigger: 'publish-release' + version: v${{ steps.agent-loader-version.outputs.results }} + - name: Report spa size to NR + uses: newrelic/capture-build-size@main + with: + nr-api-key: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }} + nr-account-id: ${{ secrets.INTERNAL_STAGING_INGEST_ACCOUNT_ID }} + nr-env: 'staging' + analysis-file-contents: ${{ steps.get-stats.outputs.spa }} + file-name-filter: '.min.js' + trigger: 'publish-release' + version: v${{ steps.agent-loader-version.outputs.results }}