Skip to content

chore: Fix typos in code comments and descriptions (#1703) #1416

chore: Fix typos in code comments and descriptions (#1703)

chore: Fix typos in code comments and descriptions (#1703) #1416

Workflow file for this run

# This workflow runs on push to the main branch. This is to execute checks
# like jest, upload test coverage to keep codecov updates, and build and deploy
# the main branch changes to our internal dev and stage environment. This workflow
# can be manually executed but only on the main branch.
name: Publish Dev
on:
workflow_call:
workflow_dispatch:
push:
branches:
- 'main'
# Only allow one instance of this workflow to run at a time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
jest-tests:
if: github.ref == 'refs/heads/main' && github.event_name != 'workflow_call'
name: Jest tests
uses: ./.github/workflows/jest.yml
secrets: inherit
with:
coverage: true
# Build and publish the latest code from the main branch
publish-dev-to-s3:
if: always() && !cancelled() && !contains(needs.*.result, 'failure')
needs: [jest-tests]
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
shell: bash
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
- name: Upload dev assets to S3
id: s3-upload
uses: ./.github/actions/s3-upload
with:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_role: ${{ secrets.AWS_ROLE_ARN }}
aws_bucket_name: ${{ secrets.AWS_BUCKET }}
local_dir: $GITHUB_WORKSPACE/build
bucket_dir: dev/
- name: Gather dev purge paths
id: dev-purge-paths
run: echo "results=$(echo '${{ steps.s3-upload.outputs.results }}' | jq -j '.[].Key + " "')" >> $GITHUB_OUTPUT
- name: Purge production cdn
uses: ./.github/actions/fastly-purge
with:
fastly_key: ${{ secrets.FASTLY_PURGE_KEY }}
fastly_service: js-agent.newrelic.com
purge_path: ${{ steps.dev-purge-paths.outputs.results }}
- name: Purge staging cdn
uses: ./.github/actions/fastly-purge
with:
fastly_key: ${{ secrets.FASTLY_PURGE_KEY }}
fastly_service: staging-js-agent.newrelic.com
purge_path: ${{ steps.dev-purge-paths.outputs.results }}
- name: Verify production cdn assets
uses: ./.github/actions/fastly-verify
with:
fastly_key: ${{ secrets.FASTLY_PURGE_KEY }}
fastly_service: js-agent.newrelic.com
asset_path: ${{ join(fromJson(steps.s3-upload.outputs.results).*.Key, ' ') }}
- name: Verify staging cdn assets
uses: ./.github/actions/fastly-verify
with:
fastly_key: ${{ secrets.FASTLY_PURGE_KEY }}
fastly_service: staging-js-agent.newrelic.com
asset_path: ${{ join(fromJson(steps.s3-upload.outputs.results).*.Key, ' ') }}
# This step creates a new Change Tracking Marker
- name: New Relic Application Deployment Marker
continue-on-error: true
uses: newrelic/deployment-marker-action@v2.3.0
with:
apiKey: ${{ secrets.INTERNAL_STAGING_INGEST_LICENSE_KEY }}
guid: ${{ secrets.INTERNAL_STAGING_INGEST_ENTITY_GUID }}
commit: "${{ github.sha }}"
version: "${{ github.ref_name }}"
user: "${{ github.actor }}"
- name: Get local stats
continue-on-error: true
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
continue-on-error: true
uses: newrelic-apps/capture-build-size@v1.0.1
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-dev'
traverse: true
- name: Report pro size to NR
continue-on-error: true
uses: newrelic-apps/capture-build-size@v1.0.1
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-dev'
traverse: true
- name: Report spa size to NR
continue-on-error: true
uses: newrelic-apps/capture-build-size@v1.0.1
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-dev'
traverse: true
# Publish dev to staging NRDB
# publish-dev-nr:
# needs: [publish-dev-to-s3]
# runs-on: ubuntu-latest
# timeout-minutes: 30
# defaults:
# run:
# shell: bash
# 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: Publish dev loader to nr
# uses: ./.github/actions/nr-upload-dev
# with:
# nr_stage_api_key: ${{ secrets.NR_API_KEY_STAGING }}
# Publish Agent2Query assets
publish-agent2query:
if: github.event_name != 'workflow_call'
needs: [jest-tests]
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
shell: bash
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: Build Agent2Query assets
uses: ./.github/actions/build-agent2query
with:
released_license_key: ${{ secrets.A2Q_RELEASED_LICENSE_KEY }}
latest_license_key: ${{ secrets.A2Q_LATEST_LICENSE_KEY }}
- name: Upload Agent2Query assets to S3
id: s3-upload-agent2query
uses: ./.github/actions/s3-upload
with:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_role: ${{ secrets.AWS_ROLE_ARN }}
aws_bucket_name: ${{ secrets.AWS_BUCKET }}
local_dir: $GITHUB_WORKSPACE/temp/agent-2-query
bucket_dir: agent-2-query/
- name: Gather agent-2-query purge paths
id: dev-purge-paths-agent2query
run: echo "results=$(echo '${{ steps.s3-upload-agent2query.outputs.results }}' | jq -j '.[].Key + " "')" >> $GITHUB_OUTPUT
- name: Purge production cdn - agent2query
uses: ./.github/actions/fastly-purge
with:
fastly_key: ${{ secrets.FASTLY_PURGE_KEY }}
fastly_service: js-agent.newrelic.com
purge_path: ${{ steps.dev-purge-paths-agent2query.outputs.results }}
- name: Purge staging cdn - agent2query
uses: ./.github/actions/fastly-purge
with:
fastly_key: ${{ secrets.FASTLY_PURGE_KEY }}
fastly_service: staging-js-agent.newrelic.com
purge_path: ${{ steps.dev-purge-paths-agent2query.outputs.results }}
- name: Verify production cdn assets - agent2query
uses: ./.github/actions/fastly-verify
with:
fastly_key: ${{ secrets.FASTLY_PURGE_KEY }}
fastly_service: js-agent.newrelic.com
asset_path: ${{ join(fromJson(steps.s3-upload-agent2query.outputs.results).*.Key, ' ') }}
- name: Verify staging cdn assets - agent2query
uses: ./.github/actions/fastly-verify
with:
fastly_key: ${{ secrets.FASTLY_PURGE_KEY }}
fastly_service: staging-js-agent.newrelic.com
asset_path: ${{ join(fromJson(steps.s3-upload-agent2query.outputs.results).*.Key, ' ') }}
# Rebuild and publish the dev environment A/B script
publish-dev-ab:
needs: [publish-dev-to-s3]
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
shell: bash
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: Publish dev a/b script
uses: ./.github/actions/internal-ab
with:
nr_environment: dev
nrba_app_id: ${{ secrets.INTERNAL_DEV_APPLICATION_ID }}
nrba_license_key: ${{ secrets.INTERNAL_LICENSE_KEY }}
nrba_ab_app_id: ${{ secrets.INTERNAL_AB_DEV_APPLICATION_ID }}
nrba_ab_license_key: ${{ secrets.INTERNAL_AB_LICENSE_KEY }}
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_role: ${{ secrets.AWS_ROLE_ARN }}
aws_bucket_name: ${{ secrets.AWS_BUCKET }}
fastly_key: ${{ secrets.FASTLY_PURGE_KEY }}
# Rebuild and publish the staging environment A/B script
publish-staging-ab:
needs: [publish-dev-to-s3]
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
shell: bash
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: Deploy staging a/b script
uses: ./.github/actions/internal-ab
with:
nr_environment: staging
nrba_app_id: ${{ secrets.INTERNAL_STAGING_APPLICATION_ID }}
nrba_license_key: ${{ secrets.INTERNAL_LICENSE_KEY }}
nrba_ab_app_id: ${{ secrets.INTERNAL_AB_STAGING_APPLICATION_ID }}
nrba_ab_license_key: ${{ secrets.INTERNAL_AB_LICENSE_KEY }}
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_role: ${{ secrets.AWS_ROLE_ARN }}
aws_bucket_name: ${{ secrets.AWS_BUCKET }}
fastly_key: ${{ secrets.FASTLY_PURGE_KEY }}