Skip to content

feat(protocol-visualization): port SlotDetailsEmptyState (#21249) #40003

feat(protocol-visualization): port SlotDetailsEmptyState (#21249)

feat(protocol-visualization): port SlotDetailsEmptyState (#21249) #40003

# Run tests, build PD, and deploy
name: 'PD test, build, and deploy'
on:
pull_request:
paths:
- 'protocol-designer/**'
- 'step-generation/**'
- 'shared-data/**'
- 'components/**'
- 'package.json'
- '.github/workflows/pd-test-build-deploy.yaml'
- '.github/actions/js/setup/action.yml'
- '.github/actions/git/resolve-tag/action.yml'
- '.github/actions/environment/complex-variables/action.yml'
- 'scripts/static-deploy/**'
- 'scripts/git-version-protocol-designer.mjs'
- 'scripts/git-version-v2.mjs'
- 'vitest.config.*'
push:
branches:
- 'edge'
- 'chore_release*'
tags:
- 'protocol-designer*'
- 'staging-protocol-designer*'
- 'pd-test*'
workflow_dispatch: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.ref_name != 'edge' || github.run_id}}-${{ github.ref_type != 'tag' || github.run_id }}
cancel-in-progress: true
defaults:
run:
shell: bash
env:
CI: 'true'
# This is the artifact directory as a relative path
# to the working-directory of our tools: scripts/static-deploy
# our script deploy_ci_config.py expects this ENV variable is set
RELATIVE_ARTIFACT_DIR: '../../dist'
jobs:
determine-deploy-config:
name: Determine Deployment Configuration
runs-on: ubuntu-24.04
outputs:
application: ${{ steps.deploy-config.outputs.APPLICATION }}
environment: ${{ steps.deploy-config.outputs.ENVIRONMENT }}
sandbox_prefix: ${{ steps.deploy-config.outputs.SANDBOX_PREFIX }}
relative_artifact_dir: ${{ steps.deploy-config.outputs.RELATIVE_ARTIFACT_DIR }}
steps:
- name: Checkout Repository
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- uses: ./.github/actions/git/resolve-tag
- name: Setup UV
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6
with:
python-version: '3.12'
- name: Setup Deploy Dependencies
working-directory: scripts/static-deploy
run: make setup
- name: Determine Deployment Configuration
id: deploy-config
working-directory: scripts/static-deploy
run: make resolve-ci
unit-test:
name: 'protocol designer unit tests'
runs-on: 'ubuntu-24.04'
timeout-minutes: 20
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
steps:
- name: 'Checkout Repository'
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- uses: ./.github/actions/js/setup
- name: 'run unit tests'
run: make -C protocol-designer test-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5
with:
flags: protocol-designer
token: ${{ secrets.CODECOV_TOKEN }}
build-pd:
timeout-minutes: 20
name: 'build protocol designer'
needs:
- determine-deploy-config
runs-on: 'ubuntu-24.04'
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
fetch-depth: 0 # Unlimited fetch depth. Required for getsentry/action-release.
- id: resolve-tag
uses: ./.github/actions/git/resolve-tag
- name: 'extract version from tag'
id: version
run: echo "number=${GITHUB_REF_NAME##*@}" >> $GITHUB_OUTPUT
- uses: ./.github/actions/js/setup
- name: 'build PD'
env:
CI: 'true'
NODE_OPTIONS: '--max-old-space-size=5120'
OT_PD_MIXPANEL_ID: ${{ secrets.OT_PD_MIXPANEL_ID }}
OT_PD_MIXPANEL_DEV_ID: ${{ secrets.OT_PD_MIXPANEL_DEV_ID }}
OT_PD_SENTRY_DSN: ${{ secrets.OT_PD_SENTRY_DSN }}
OT_PD_SENTRY_DEV_DSN: ${{ secrets.OT_PD_SENTRY_DEV_DSN }}
# Used by @sentry/vite-plugin (sourcemap upload is gated by OT_PD_SENTRY_PLUGIN_UPLOAD).
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
# Only meaningful for tagged releases; empty string is treated as absent.
SENTRY_RELEASE: ${{ github.ref_type == 'tag' && steps.version.outputs.number || '' }}
# Opt-in CI sourcemap upload via the Vite plugin (staging/prod tagged releases only).
OT_PD_SENTRY_PLUGIN_UPLOAD: ${{ github.ref_type == 'tag' && (startsWith(github.ref, 'refs/tags/protocol-designer') || startsWith(github.ref, 'refs/tags/staging-protocol-designer')) && (needs.determine-deploy-config.outputs.environment == 'production' || needs.determine-deploy-config.outputs.environment == 'staging') && 'true' || '' }}
run: |
make -C protocol-designer NODE_ENV=${{ (needs.determine-deploy-config.outputs.environment == 'production' || needs.determine-deploy-config.outputs.environment == 'staging') && 'production' || 'development' }} OT_PD_PRERELEASE_MODE=${{ needs.determine-deploy-config.outputs.environment == 'sandbox' && '1' || '0' }}
- name: 'update the release in Sentry with build metadata'
# Only on production or staging releases (protocol-designer* or staging-protocol-designer*)
if: github.ref_type == 'tag' && (startsWith(github.ref, 'refs/tags/protocol-designer') || startsWith(github.ref, 'refs/tags/staging-protocol-designer')) && (needs.determine-deploy-config.outputs.environment == 'production' || needs.determine-deploy-config.outputs.environment == 'staging')
uses: getsentry/action-release@5657c9e888b4e2cc85f4d29143ea4131fde4a73a # v3
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with:
release: ${{ steps.version.outputs.number }}
set_commits: auto
ignore_missing: true
finalize: false
environment: ${{ needs.determine-deploy-config.outputs.environment }}
- name: 'upload github artifact'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: 'pd-artifact'
path: protocol-designer/dist
deploy-pd:
timeout-minutes: 10
name: 'deploy protocol designer'
needs:
- determine-deploy-config
- build-pd
runs-on: 'ubuntu-24.04'
# Uses GitHub Environments to require manual approval in the UI before production deploys.
# Configure required reviewers on the `pd-prod` environment.
environment:
name: ${{ needs.determine-deploy-config.outputs.environment == 'production' && 'pd-prod' || 'pd-non-prod' }}
if: >-
always() &&
needs.build-pd.result == 'success' &&
needs.determine-deploy-config.result == 'success' &&
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
permissions:
id-token: write
contents: read
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4
with:
role-to-assume: ${{ vars.STATIC_DEPLOY_ROLE }}
aws-region: us-east-2
- name: Checkout Repository
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
fetch-depth: 0
- id: resolve-tag
uses: ./.github/actions/git/resolve-tag
- name: 'extract version from tag'
id: version
run: echo "number=${GITHUB_REF_NAME##*@}" >> $GITHUB_OUTPUT
- name: Setup UV
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6
with:
python-version: '3.12'
- name: Setup Deploy Dependencies
working-directory: scripts/static-deploy
run: |
make setup
- name: 'download PD build'
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: pd-artifact
path: ./dist # in the default workspace
# RELATIVE_ARTIFACT_DIR is set to ../../dist
# because that is the relative path from scripts/static-deploy
# to the this location
- name: Deploy to S3
working-directory: scripts/static-deploy
run: make deploy \
APPLICATION=${{ needs.determine-deploy-config.outputs.application }} \
ENVIRONMENT=${{ needs.determine-deploy-config.outputs.environment }} \
SANDBOX_PREFIX=${{ needs.determine-deploy-config.outputs.sandbox_prefix }} \
RELATIVE_ARTIFACT_DIR=${{ needs.determine-deploy-config.outputs.relative_artifact_dir }}
- name: 'finalize the production release in Sentry'
# Only on production or staging releases (protocol-designer* or staging-protocol-designer*)
if: github.ref_type == 'tag' && (startsWith(github.ref, 'refs/tags/protocol-designer') || startsWith(github.ref, 'refs/tags/staging-protocol-designer'))
uses: getsentry/action-release@5657c9e888b4e2cc85f4d29143ea4131fde4a73a # v3
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with:
release: ${{ steps.version.outputs.number }}
finalize: true
# Notification jobs for tagged builds
notify-success:
name: 'Notify Build Success'
runs-on: 'ubuntu-latest'
needs: [unit-test, build-pd, deploy-pd]
if: always() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && (needs.unit-test.result == 'success' || needs.unit-test.result == 'skipped') && needs.build-pd.result == 'success' && needs.deploy-pd.result == 'success'
steps:
- name: Checkout Repository
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: 'Send success alert'
uses: ./.github/actions/simple-build-alert
with:
status: 'success'
workflow_name: 'PD test, build, and deploy'
webhook_url: ${{ secrets.OT_APP_RELEASE_SLACK_NOTIFICATION_WEBHOOK_URL }}
notify-failure:
name: 'Notify Build Failure'
runs-on: 'ubuntu-latest'
needs: [unit-test, build-pd, deploy-pd]
if: always() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && (needs.unit-test.result == 'failure' || needs.build-pd.result == 'failure' || needs.deploy-pd.result == 'failure')
steps:
- name: Checkout Repository
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: 'Determine failed jobs'
id: failed-jobs
shell: bash
run: |
failed_jobs=()
if [[ "${{ needs.unit-test.result }}" == "failure" ]]; then
failed_jobs+=("unit-test")
fi
if [[ "${{ needs.build-pd.result }}" == "failure" ]]; then
failed_jobs+=("build-pd")
fi
if [[ "${{ needs.deploy-pd.result }}" == "failure" ]]; then
failed_jobs+=("deploy-pd")
fi
IFS=','
echo "failed_jobs=${failed_jobs[*]}" >> $GITHUB_OUTPUT
- name: 'Send failure alert'
uses: ./.github/actions/simple-build-alert
with:
status: 'failure'
workflow_name: 'PD test, build, and deploy'
failed_jobs: ${{ steps.failed-jobs.outputs.failed_jobs }}
webhook_url: ${{ secrets.OT_APP_RELEASE_SLACK_NOTIFICATION_WEBHOOK_URL }}
notify-cancelled:
name: 'Notify Build Cancelled'
runs-on: 'ubuntu-latest'
needs: [unit-test, build-pd, deploy-pd]
if: always() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && (needs.unit-test.result == 'cancelled' || needs.build-pd.result == 'cancelled' || needs.deploy-pd.result == 'cancelled')
steps:
- name: Checkout Repository
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: 'Send cancelled alert'
uses: ./.github/actions/simple-build-alert
with:
status: 'cancelled'
workflow_name: 'PD test, build, and deploy'
webhook_url: ${{ secrets.OT_APP_RELEASE_SLACK_NOTIFICATION_WEBHOOK_URL }}