From cc06e02df0e82da7313fb6d2242c50b43dbd68d1 Mon Sep 17 00:00:00 2001 From: shrunyan Date: Tue, 19 Mar 2024 14:58:03 -0700 Subject: [PATCH 01/23] fix: split cd by environment --- .github/workflows/cd-beta.yaml | 100 +++++++++++ .../workflows/{cd.yaml => cd-dev-stage.yaml} | 166 +++++++++--------- .github/workflows/cd-stable.yaml | 87 +++++++++ 3 files changed, 272 insertions(+), 81 deletions(-) create mode 100644 .github/workflows/cd-beta.yaml rename .github/workflows/{cd.yaml => cd-dev-stage.yaml} (51%) create mode 100644 .github/workflows/cd-stable.yaml diff --git a/.github/workflows/cd-beta.yaml b/.github/workflows/cd-beta.yaml new file mode 100644 index 0000000000..814d158f15 --- /dev/null +++ b/.github/workflows/cd-beta.yaml @@ -0,0 +1,100 @@ +# name: cd-beta + +# on: +# # Uncomment to work on CD in development mode. +# # pull_request: +# # branches: [ master ] +# push: +# branches: +# - beta + +# jobs: +# deploy_to_beta: +# runs-on: ubuntu-latest +# env: +# ENV: "beta" + +# steps: +# # This Clean step simply checks if there's already a workflow running from the last +# # commit and cancels it if there is. This helps us save on cloud cost in the long run. +# # See https://github.com/rokroskar/workflow-run-cleanup-action for more information. +# - name: Clean +# uses: rokroskar/workflow-run-cleanup-action@v0.2.2 +# env: +# GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" +# if: "github.ref != 'refs/heads/master'" +# - name: Checkout Repo +# uses: actions/checkout@v2 +# - name: Auth with Gcloud +# uses: google-github-actions/auth@v0 +# with: +# credentials_json: ${{ secrets.GCP_DEV_SA_KEY }} +# - name: Set up Gcloud SDK +# uses: google-github-actions/setup-gcloud@v0 +# with: +# project_id: zesty-dev +# - name: Set up Node +# uses: actions/setup-node@v2 +# with: +# node-version: "16.5.0" +# cache: "npm" +# cache-dependency-path: package-lock.json +# - name: Install Dependencies +# run: npm install +# - name: Build +# run: npm run build:dev +# env: +# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} +# - name: Deploy to Dev +# run: gcloud app deploy app.yaml --quiet --project zesty-dev +# - name: Post Successful Dev Deploy Notification To Slack +# uses: rtCamp/action-slack-notify@v2 +# env: +# SLACK_CHANNEL: devops +# SLACK_COLOR: ${{ job.status }} +# SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png +# SLACK_MESSAGE: | +# Use :eyes: to signal you have seen this message. +# Use :white_check_mark: to signal you have successfully manually tested the deployed changes. +# Use :x: to signal manual tests on deployed changes were unsuccessful and start a thread under this alert describing your remediation steps. +# SLACK_TITLE: Successfully Deployed manager-ui to Dev +# SLACK_USERNAME: Deploy Bot +# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} +# cancel_workflow_if_beta_deploy_failed: +# runs-on: ubuntu-latest +# if: ${{ failure() }} +# needs: +# - deploy_to_beta +# steps: +# - name: Post Failed Beta Deploy Notification To Slack +# uses: rtCamp/action-slack-notify@v2 +# env: +# SLACK_CHANNEL: devops +# SLACK_COLOR: "#FF0000" +# SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png +# SLACK_MESSAGE: "PR merge by ${{ github.actor }} has failed to deploy to beta." +# SLACK_TITLE: Beta Deployment Failed for manager-ui +# SLACK_USERNAME: Deploy Bot +# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} +# - name: Cancel current workflow run +# uses: actions/github-script@v4 +# with: +# script: | +# github.actions.cancelWorkflowRun({ +# owner: context.repo.owner, +# repo: context.repo.repo, +# run_id: context.runId +# }) +# create_stable_pr: +# runs-on: ubuntu-latest +# needs: +# - deploy_to_beta + +# steps: +# - name: Create Stable Release PR +# uses: peter-evans/create-pull-request@v6 +# with: +# branch: beta +# base: master +# title: master +# # labels: diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd-dev-stage.yaml similarity index 51% rename from .github/workflows/cd.yaml rename to .github/workflows/cd-dev-stage.yaml index 4def727501..bc9e2a6b99 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd-dev-stage.yaml @@ -1,4 +1,4 @@ -name: cd +name: cd-dev-stage on: # Uncomment to work on CD in development mode. @@ -7,8 +7,6 @@ on: push: branches: - dev - workflow_dispatch: - jobs: deploy_to_dev: runs-on: ubuntu-latest @@ -61,13 +59,6 @@ jobs: SLACK_TITLE: Successfully Deployed manager-ui to Dev SLACK_USERNAME: Deploy Bot SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - - name: Create Pull Request - uses: peter-evans/create-pull-request@v6 - with: - branch: dev - base: beta - title: beta - # labels: cancel_workflow_if_dev_deploy_failed: runs-on: ubuntu-latest if: ${{ failure() }} @@ -93,76 +84,89 @@ jobs: repo: context.repo.repo, run_id: context.runId }) - # create_beta_pr: - # runs-on: ubuntu-latest - # steps: - # deploy_to_stage: - # runs-on: ubuntu-latest - # env: - # ENV: "stage" - # needs: - # - deploy_to_dev + deploy_to_stage: + runs-on: ubuntu-latest + env: + ENV: "stage" + needs: + - deploy_to_dev - # steps: - # # This Clean step simply checks if there's already a workflow running from the last - # # commit and cancels it if there is. This helps us save on cloud cost in the long run. - # # See https://github.com/rokroskar/workflow-run-cleanup-action for more information. - # - name: Clean - # uses: rokroskar/workflow-run-cleanup-action@v0.2.2 - # env: - # GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - # if: "github.ref != 'refs/heads/master'" - # - name: Checkout Repo - # uses: actions/checkout@v2 - # - name: Auth with Gcloud - # uses: google-github-actions/auth@v0 - # with: - # credentials_json: ${{ secrets.GCP_SA_KEY }} - # - name: Set up Gcloud SDK - # uses: google-github-actions/setup-gcloud@v0 - # with: - # project_id: zesty-stage - # - name: Set up Node - # uses: actions/setup-node@v2 - # with: - # node-version: "16.5.0" - # cache: "npm" - # cache-dependency-path: package-lock.json - # - name: Install Dependencies - # run: npm install - # - name: Build - # run: npm run build:stage - # env: - # SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - # - name: Deploy to Staging - # run: gcloud app deploy app.yaml --quiet --project zesty-stage - # - name: Post Successful Stage Deploy Notification To Slack - # uses: rtCamp/action-slack-notify@v2 - # env: - # SLACK_CHANNEL: devops - # SLACK_COLOR: ${{ job.status }} - # SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png - # SLACK_MESSAGE: | - # Use :eyes: to signal you have seen this message. - # Use :white_check_mark: to signal you have successfully manually tested the deployed changes. - # Use :x: to signal manual tests on deployed changes were unsuccessful and start a thread under this alert describing your remediation steps. - # SLACK_TITLE: Successfully Deployed manager-ui to Stage - # SLACK_USERNAME: Deploy Bot - # SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - # post_failed_stage_deploy_notification_to_slack: - # runs-on: ubuntu-latest - # if: ${{ failure() }} - # needs: - # - deploy_to_stage - # steps: - # - name: Post Failed Staging Deploy Notification To Slack - # uses: rtCamp/action-slack-notify@v2 - # env: - # SLACK_CHANNEL: devops - # SLACK_COLOR: "#FF0000" - # SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png - # SLACK_MESSAGE: "PR merge by ${{ github.actor }} has failed to deploy to staging." - # SLACK_TITLE: Staging Deployment Failed for manager-ui - # SLACK_USERNAME: Deploy Bot - # SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + steps: + # This Clean step simply checks if there's already a workflow running from the last + # commit and cancels it if there is. This helps us save on cloud cost in the long run. + # See https://github.com/rokroskar/workflow-run-cleanup-action for more information. + - name: Clean + uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + if: "github.ref != 'refs/heads/master'" + - name: Checkout Repo + uses: actions/checkout@v2 + - name: Auth with Gcloud + uses: google-github-actions/auth@v0 + with: + credentials_json: ${{ secrets.GCP_SA_KEY }} + - name: Set up Gcloud SDK + uses: google-github-actions/setup-gcloud@v0 + with: + project_id: zesty-stage + - name: Set up Node + uses: actions/setup-node@v2 + with: + node-version: "16.5.0" + cache: "npm" + cache-dependency-path: package-lock.json + - name: Install Dependencies + run: npm install + - name: Build + run: npm run build:stage + env: + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + - name: Deploy to Staging + run: gcloud app deploy app.yaml --quiet --project zesty-stage + - name: Post Successful Stage Deploy Notification To Slack + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_CHANNEL: devops + SLACK_COLOR: ${{ job.status }} + SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png + SLACK_MESSAGE: | + Use :eyes: to signal you have seen this message. + Use :white_check_mark: to signal you have successfully manually tested the deployed changes. + Use :x: to signal manual tests on deployed changes were unsuccessful and start a thread under this alert describing your remediation steps. + SLACK_TITLE: Successfully Deployed manager-ui to Stage + SLACK_USERNAME: Deploy Bot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + post_failed_stage_deploy_notification_to_slack: + runs-on: ubuntu-latest + if: ${{ failure() }} + needs: + - deploy_to_stage + steps: + - name: Post Failed Staging Deploy Notification To Slack + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_CHANNEL: devops + SLACK_COLOR: "#FF0000" + SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png + SLACK_MESSAGE: "PR merge by ${{ github.actor }} has failed to deploy to staging." + SLACK_TITLE: Staging Deployment Failed for manager-ui + SLACK_USERNAME: Deploy Bot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + + create_beta_pr: + runs-on: ubuntu-latest + needs: + - deploy_to_dev + - deploy_to_stage + + steps: + - uses: actions/checkout@v4 + - name: Create Beta Release PR + uses: peter-evans/create-pull-request@v6 + with: + branch: dev + base: beta + title: beta + # labels: diff --git a/.github/workflows/cd-stable.yaml b/.github/workflows/cd-stable.yaml new file mode 100644 index 0000000000..0993a50d8e --- /dev/null +++ b/.github/workflows/cd-stable.yaml @@ -0,0 +1,87 @@ +# name: cd-stable + +# on: +# # Uncomment to work on CD in development mode. +# # pull_request: +# # branches: [ master ] +# push: +# branches: +# - master + +# jobs: +# deploy_to_stable: +# runs-on: ubuntu-latest +# env: +# ENV: "stable" + +# steps: +# # This Clean step simply checks if there's already a workflow running from the last +# # commit and cancels it if there is. This helps us save on cloud cost in the long run. +# # See https://github.com/rokroskar/workflow-run-cleanup-action for more information. +# - name: Clean +# uses: rokroskar/workflow-run-cleanup-action@v0.2.2 +# env: +# GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" +# if: "github.ref != 'refs/heads/master'" +# - name: Checkout Repo +# uses: actions/checkout@v2 +# - name: Auth with Gcloud +# uses: google-github-actions/auth@v0 +# with: +# credentials_json: ${{ secrets.GCP_DEV_SA_KEY }} +# - name: Set up Gcloud SDK +# uses: google-github-actions/setup-gcloud@v0 +# with: +# project_id: zesty-dev +# - name: Set up Node +# uses: actions/setup-node@v2 +# with: +# node-version: "16.5.0" +# cache: "npm" +# cache-dependency-path: package-lock.json +# - name: Install Dependencies +# run: npm install +# - name: Build +# run: npm run build:dev +# env: +# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} +# - name: Deploy to Dev +# run: gcloud app deploy app.yaml --quiet --project zesty-dev +# - name: Post Successful Dev Deploy Notification To Slack +# uses: rtCamp/action-slack-notify@v2 +# env: +# SLACK_CHANNEL: devops +# SLACK_COLOR: ${{ job.status }} +# SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png +# SLACK_MESSAGE: | +# Use :eyes: to signal you have seen this message. +# Use :white_check_mark: to signal you have successfully manually tested the deployed changes. +# Use :x: to signal manual tests on deployed changes were unsuccessful and start a thread under this alert describing your remediation steps. +# SLACK_TITLE: Successfully Deployed manager-ui to Dev +# SLACK_USERNAME: Deploy Bot +# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} +# cancel_workflow_if_beta_deploy_failed: +# runs-on: ubuntu-latest +# if: ${{ failure() }} +# needs: +# - deploy_to_stable +# steps: +# - name: Post Failed Dev Deploy Notification To Slack +# uses: rtCamp/action-slack-notify@v2 +# env: +# SLACK_CHANNEL: devops +# SLACK_COLOR: "#FF0000" +# SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png +# SLACK_MESSAGE: "PR merge by ${{ github.actor }} has failed to deploy to dev." +# SLACK_TITLE: Dev Deployment Failed for manager-ui +# SLACK_USERNAME: Deploy Bot +# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} +# - name: Cancel current workflow run +# uses: actions/github-script@v4 +# with: +# script: | +# github.actions.cancelWorkflowRun({ +# owner: context.repo.owner, +# repo: context.repo.repo, +# run_id: context.runId +# }) From 9103360b8fca5fc71fc6c6f4b7cfd15801a86501 Mon Sep 17 00:00:00 2001 From: shrunyan Date: Tue, 19 Mar 2024 15:20:02 -0700 Subject: [PATCH 02/23] improve slack alerts for cd --- .github/workflows/cd-dev-stage.yaml | 62 ++++++++++++----------------- 1 file changed, 25 insertions(+), 37 deletions(-) diff --git a/.github/workflows/cd-dev-stage.yaml b/.github/workflows/cd-dev-stage.yaml index bc9e2a6b99..1aa1f4a8d2 100644 --- a/.github/workflows/cd-dev-stage.yaml +++ b/.github/workflows/cd-dev-stage.yaml @@ -59,38 +59,10 @@ jobs: SLACK_TITLE: Successfully Deployed manager-ui to Dev SLACK_USERNAME: Deploy Bot SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - cancel_workflow_if_dev_deploy_failed: - runs-on: ubuntu-latest - if: ${{ failure() }} - needs: - - deploy_to_dev - steps: - - name: Post Failed Dev Deploy Notification To Slack - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_CHANNEL: devops - SLACK_COLOR: "#FF0000" - SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png - SLACK_MESSAGE: "PR merge by ${{ github.actor }} has failed to deploy to dev." - SLACK_TITLE: Dev Deployment Failed for manager-ui - SLACK_USERNAME: Deploy Bot - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - - name: Cancel current workflow run - uses: actions/github-script@v4 - with: - script: | - github.actions.cancelWorkflowRun({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: context.runId - }) - deploy_to_stage: runs-on: ubuntu-latest env: ENV: "stage" - needs: - - deploy_to_dev steps: # This Clean step simply checks if there's already a workflow running from the last @@ -138,20 +110,36 @@ jobs: SLACK_TITLE: Successfully Deployed manager-ui to Stage SLACK_USERNAME: Deploy Bot SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - post_failed_stage_deploy_notification_to_slack: + + failed_deploy_notification_to_slack: runs-on: ubuntu-latest if: ${{ failure() }} - needs: - - deploy_to_stage + needs: [deploy_to_dev, deploy_to_stage] steps: - - name: Post Failed Staging Deploy Notification To Slack + - name: Failed Deploy Notification To Slack uses: rtCamp/action-slack-notify@v2 env: - SLACK_CHANNEL: devops + SLACK_CHANNEL: code-deploy + SLACK_COLOR: "#FF0000" + SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png + SLACK_MESSAGE: "PR merge by ${{ github.actor }} failed to deploy." + SLACK_TITLE: Deployment Failed for manager-ui + SLACK_USERNAME: Deploy Bot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + + success_deploy_notification_to_slack: + runs-on: ubuntu-latest + if: ${{ success() }} + needs: [deploy_to_stage] + steps: + - name: Success Deploy Notification To Slack + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_CHANNEL: code-deploy SLACK_COLOR: "#FF0000" SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png - SLACK_MESSAGE: "PR merge by ${{ github.actor }} has failed to deploy to staging." - SLACK_TITLE: Staging Deployment Failed for manager-ui + SLACK_MESSAGE: "PR merge by ${{ github.actor }} has been deployed to stage." + SLACK_TITLE: Stage Deployment for manager-ui SLACK_USERNAME: Deploy Bot SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} @@ -166,7 +154,7 @@ jobs: - name: Create Beta Release PR uses: peter-evans/create-pull-request@v6 with: - branch: dev - base: beta + branch: beta + # base: dev title: beta # labels: From 26ab502a5acc0ee484726bde5d7d91a7521986f0 Mon Sep 17 00:00:00 2001 From: Stuart Runyan Date: Tue, 19 Mar 2024 15:34:55 -0700 Subject: [PATCH 03/23] testing new branching strategy CD (#2598) From 3d26a5bfc8addc3d9103bb8903fbd90de466887f Mon Sep 17 00:00:00 2001 From: shrunyan Date: Tue, 19 Mar 2024 15:46:34 -0700 Subject: [PATCH 04/23] WIP: branching strategy --- .github/workflows/cd-beta.yaml | 65 +++++++++++++---------------- .github/workflows/cd-dev-stage.yaml | 50 +++++----------------- .github/workflows/cd-stable.yaml | 61 ++++++++++++--------------- 3 files changed, 67 insertions(+), 109 deletions(-) diff --git a/.github/workflows/cd-beta.yaml b/.github/workflows/cd-beta.yaml index 814d158f15..b8744816a0 100644 --- a/.github/workflows/cd-beta.yaml +++ b/.github/workflows/cd-beta.yaml @@ -9,10 +9,10 @@ # - beta # jobs: -# deploy_to_beta: +# deploy_beta: # runs-on: ubuntu-latest # env: -# ENV: "beta" +# ENV: "prod" # steps: # # This Clean step simply checks if there's already a workflow running from the last @@ -32,7 +32,7 @@ # - name: Set up Gcloud SDK # uses: google-github-actions/setup-gcloud@v0 # with: -# project_id: zesty-dev +# project_id: zesty-prod # - name: Set up Node # uses: actions/setup-node@v2 # with: @@ -42,59 +42,54 @@ # - name: Install Dependencies # run: npm install # - name: Build -# run: npm run build:dev +# run: npm run build:prod # env: # SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} -# - name: Deploy to Dev -# run: gcloud app deploy app.yaml --quiet --project zesty-dev -# - name: Post Successful Dev Deploy Notification To Slack +# - name: Deploy to Beta +# run: gcloud app deploy app.yaml --quiet --project --version beta zesty-prod + +# failed_deploy_notification_to_slack: +# runs-on: ubuntu-latest +# if: ${{ failure() }} +# needs: deploy_beta +# steps: +# - name: Failed Deploy Notification To Slack # uses: rtCamp/action-slack-notify@v2 # env: -# SLACK_CHANNEL: devops -# SLACK_COLOR: ${{ job.status }} +# SLACK_CHANNEL: code-deploy +# SLACK_COLOR: "#FF0000" # SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png -# SLACK_MESSAGE: | -# Use :eyes: to signal you have seen this message. -# Use :white_check_mark: to signal you have successfully manually tested the deployed changes. -# Use :x: to signal manual tests on deployed changes were unsuccessful and start a thread under this alert describing your remediation steps. -# SLACK_TITLE: Successfully Deployed manager-ui to Dev +# SLACK_MESSAGE: "PR merge by ${{ github.actor }} failed to deploy." +# SLACK_TITLE: FAILED Beta Deployment for manager-ui # SLACK_USERNAME: Deploy Bot # SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} -# cancel_workflow_if_beta_deploy_failed: + +# success_deploy_notification_to_slack: # runs-on: ubuntu-latest -# if: ${{ failure() }} -# needs: -# - deploy_to_beta +# if: ${{ success() }} +# needs: [deploy_beta] # steps: -# - name: Post Failed Beta Deploy Notification To Slack +# - name: Success Deploy Notification To Slack # uses: rtCamp/action-slack-notify@v2 # env: -# SLACK_CHANNEL: devops +# SLACK_CHANNEL: code-deploy # SLACK_COLOR: "#FF0000" # SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png -# SLACK_MESSAGE: "PR merge by ${{ github.actor }} has failed to deploy to beta." -# SLACK_TITLE: Beta Deployment Failed for manager-ui +# SLACK_MESSAGE: "PR merge by ${{ github.actor }} has been deployed to stage." +# SLACK_TITLE: Beta Deployment for manager-ui # SLACK_USERNAME: Deploy Bot # SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} -# - name: Cancel current workflow run -# uses: actions/github-script@v4 -# with: -# script: | -# github.actions.cancelWorkflowRun({ -# owner: context.repo.owner, -# repo: context.repo.repo, -# run_id: context.runId -# }) + # create_stable_pr: # runs-on: ubuntu-latest # needs: -# - deploy_to_beta +# - deploy_beta # steps: # - name: Create Stable Release PR # uses: peter-evans/create-pull-request@v6 # with: -# branch: beta -# base: master -# title: master +# branch: master +# # base: master +# title: Stable Release # # labels: diff --git a/.github/workflows/cd-dev-stage.yaml b/.github/workflows/cd-dev-stage.yaml index 1aa1f4a8d2..1ced1be06b 100644 --- a/.github/workflows/cd-dev-stage.yaml +++ b/.github/workflows/cd-dev-stage.yaml @@ -8,7 +8,7 @@ on: branches: - dev jobs: - deploy_to_dev: + deploy_dev: runs-on: ubuntu-latest env: ENV: "dev" @@ -46,20 +46,8 @@ jobs: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - name: Deploy to Dev run: gcloud app deploy app.yaml --quiet --project zesty-dev - - name: Post Successful Dev Deploy Notification To Slack - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_CHANNEL: devops - SLACK_COLOR: ${{ job.status }} - SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png - SLACK_MESSAGE: | - Use :eyes: to signal you have seen this message. - Use :white_check_mark: to signal you have successfully manually tested the deployed changes. - Use :x: to signal manual tests on deployed changes were unsuccessful and start a thread under this alert describing your remediation steps. - SLACK_TITLE: Successfully Deployed manager-ui to Dev - SLACK_USERNAME: Deploy Bot - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - deploy_to_stage: + + deploy_stage: runs-on: ubuntu-latest env: ENV: "stage" @@ -95,26 +83,13 @@ jobs: run: npm run build:stage env: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - - name: Deploy to Staging + - name: Deploy to Stage run: gcloud app deploy app.yaml --quiet --project zesty-stage - - name: Post Successful Stage Deploy Notification To Slack - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_CHANNEL: devops - SLACK_COLOR: ${{ job.status }} - SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png - SLACK_MESSAGE: | - Use :eyes: to signal you have seen this message. - Use :white_check_mark: to signal you have successfully manually tested the deployed changes. - Use :x: to signal manual tests on deployed changes were unsuccessful and start a thread under this alert describing your remediation steps. - SLACK_TITLE: Successfully Deployed manager-ui to Stage - SLACK_USERNAME: Deploy Bot - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} failed_deploy_notification_to_slack: runs-on: ubuntu-latest if: ${{ failure() }} - needs: [deploy_to_dev, deploy_to_stage] + needs: [deploy_dev, deploy_stage] steps: - name: Failed Deploy Notification To Slack uses: rtCamp/action-slack-notify@v2 @@ -123,14 +98,14 @@ jobs: SLACK_COLOR: "#FF0000" SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png SLACK_MESSAGE: "PR merge by ${{ github.actor }} failed to deploy." - SLACK_TITLE: Deployment Failed for manager-ui + SLACK_TITLE: FAILED Dev/Stage Deployment for manager-ui SLACK_USERNAME: Deploy Bot SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} success_deploy_notification_to_slack: runs-on: ubuntu-latest if: ${{ success() }} - needs: [deploy_to_stage] + needs: [deploy_stage] steps: - name: Success Deploy Notification To Slack uses: rtCamp/action-slack-notify@v2 @@ -145,16 +120,13 @@ jobs: create_beta_pr: runs-on: ubuntu-latest - needs: - - deploy_to_dev - - deploy_to_stage - + needs: [deploy_dev, deploy_stage] steps: - uses: actions/checkout@v4 - name: Create Beta Release PR uses: peter-evans/create-pull-request@v6 with: - branch: beta - # base: dev - title: beta + branch: dev + base: beta + title: Beta Release # labels: diff --git a/.github/workflows/cd-stable.yaml b/.github/workflows/cd-stable.yaml index 0993a50d8e..01ab125e87 100644 --- a/.github/workflows/cd-stable.yaml +++ b/.github/workflows/cd-stable.yaml @@ -1,18 +1,15 @@ # name: cd-stable # on: -# # Uncomment to work on CD in development mode. -# # pull_request: -# # branches: [ master ] # push: # branches: -# - master +# - stable # jobs: -# deploy_to_stable: +# deploy_stable: # runs-on: ubuntu-latest # env: -# ENV: "stable" +# ENV: "prod" # steps: # # This Clean step simply checks if there's already a workflow running from the last @@ -32,7 +29,7 @@ # - name: Set up Gcloud SDK # uses: google-github-actions/setup-gcloud@v0 # with: -# project_id: zesty-dev +# project_id: zesty-prod # - name: Set up Node # uses: actions/setup-node@v2 # with: @@ -42,46 +39,40 @@ # - name: Install Dependencies # run: npm install # - name: Build -# run: npm run build:dev +# run: npm run build:prod # env: # SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} -# - name: Deploy to Dev -# run: gcloud app deploy app.yaml --quiet --project zesty-dev -# - name: Post Successful Dev Deploy Notification To Slack +# - name: Deploy Stable +# run: gcloud app deploy app.yaml --quiet --project zesty-prod + +# failed_deploy_notification_to_slack: +# runs-on: ubuntu-latest +# if: ${{ failure() }} +# needs: deploy_stable +# steps: +# - name: Failed Deploy Notification To Slack # uses: rtCamp/action-slack-notify@v2 # env: -# SLACK_CHANNEL: devops -# SLACK_COLOR: ${{ job.status }} +# SLACK_CHANNEL: code-deploy +# SLACK_COLOR: "#FF0000" # SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png -# SLACK_MESSAGE: | -# Use :eyes: to signal you have seen this message. -# Use :white_check_mark: to signal you have successfully manually tested the deployed changes. -# Use :x: to signal manual tests on deployed changes were unsuccessful and start a thread under this alert describing your remediation steps. -# SLACK_TITLE: Successfully Deployed manager-ui to Dev +# SLACK_MESSAGE: "PR merge by ${{ github.actor }} failed to deploy." +# SLACK_TITLE: FAILED Stable Deployment for manager-ui # SLACK_USERNAME: Deploy Bot # SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} -# cancel_workflow_if_beta_deploy_failed: + +# success_deploy_notification_to_slack: # runs-on: ubuntu-latest -# if: ${{ failure() }} -# needs: -# - deploy_to_stable +# if: ${{ success() }} +# needs: [deploy_stable] # steps: -# - name: Post Failed Dev Deploy Notification To Slack +# - name: Success Deploy Notification To Slack # uses: rtCamp/action-slack-notify@v2 # env: -# SLACK_CHANNEL: devops +# SLACK_CHANNEL: code-deploy # SLACK_COLOR: "#FF0000" # SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png -# SLACK_MESSAGE: "PR merge by ${{ github.actor }} has failed to deploy to dev." -# SLACK_TITLE: Dev Deployment Failed for manager-ui +# SLACK_MESSAGE: "PR merge by ${{ github.actor }} has been deployed to stage." +# SLACK_TITLE: Stable Deployment for manager-ui # SLACK_USERNAME: Deploy Bot # SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} -# - name: Cancel current workflow run -# uses: actions/github-script@v4 -# with: -# script: | -# github.actions.cancelWorkflowRun({ -# owner: context.repo.owner, -# repo: context.repo.repo, -# run_id: context.runId -# }) From 9a43ee5670bdc0dbb83a5b84dc71992a19718657 Mon Sep 17 00:00:00 2001 From: shrunyan Date: Wed, 20 Mar 2024 11:22:39 -0700 Subject: [PATCH 05/23] bump node version --- .github/workflows/cd-beta.yaml | 2 +- .github/workflows/cd-dev-stage.yaml | 4 ++-- .github/workflows/cd-stable.yaml | 2 +- .github/workflows/ci.yaml | 2 +- package-lock.json | 12 +----------- package.json | 3 +-- 6 files changed, 7 insertions(+), 18 deletions(-) diff --git a/.github/workflows/cd-beta.yaml b/.github/workflows/cd-beta.yaml index b8744816a0..756ce8b993 100644 --- a/.github/workflows/cd-beta.yaml +++ b/.github/workflows/cd-beta.yaml @@ -36,7 +36,7 @@ # - name: Set up Node # uses: actions/setup-node@v2 # with: -# node-version: "16.5.0" +# node-version: "20.11.1" # cache: "npm" # cache-dependency-path: package-lock.json # - name: Install Dependencies diff --git a/.github/workflows/cd-dev-stage.yaml b/.github/workflows/cd-dev-stage.yaml index 1ced1be06b..88a0073677 100644 --- a/.github/workflows/cd-dev-stage.yaml +++ b/.github/workflows/cd-dev-stage.yaml @@ -35,7 +35,7 @@ jobs: - name: Set up Node uses: actions/setup-node@v2 with: - node-version: "16.5.0" + node-version: "20.11.1" cache: "npm" cache-dependency-path: package-lock.json - name: Install Dependencies @@ -74,7 +74,7 @@ jobs: - name: Set up Node uses: actions/setup-node@v2 with: - node-version: "16.5.0" + node-version: "20.11.1" cache: "npm" cache-dependency-path: package-lock.json - name: Install Dependencies diff --git a/.github/workflows/cd-stable.yaml b/.github/workflows/cd-stable.yaml index 01ab125e87..df7ab78740 100644 --- a/.github/workflows/cd-stable.yaml +++ b/.github/workflows/cd-stable.yaml @@ -33,7 +33,7 @@ # - name: Set up Node # uses: actions/setup-node@v2 # with: -# node-version: "16.5.0" +# node-version: "20.11.1" # cache: "npm" # cache-dependency-path: package-lock.json # - name: Install Dependencies diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a071f742bb..7f0b647176 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,7 +32,7 @@ jobs: - name: Set up Node uses: actions/setup-node@v2 with: - node-version: "16.5.0" + node-version: "20.11.1" cache: "npm" cache-dependency-path: package-lock.json - name: Install Dependencies diff --git a/package-lock.json b/package-lock.json index a149c759a2..9e2289d1e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,10 +5,10 @@ "requires": true, "packages": { "": { + "name": "manager-ui", "version": "1.0.1", "license": "Commons Clause License Condition v1.0", "dependencies": { - "-": "^0.0.1", "@aeaton/react-prosemirror": "^0.21.1", "@aeaton/react-prosemirror-config-default": "^0.11.0", "@babel/runtime": "^7.10.4", @@ -126,11 +126,6 @@ "webpack-dev-server": "^3.11.2" } }, - "node_modules/-": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/-/-/--0.0.1.tgz", - "integrity": "sha512-3HfneK3DGAm05fpyj20sT3apkNcvPpCuccOThOPdzz8sY7GgQGe0l93XH9bt+YzibcTIgUAIMoyVJI740RtgyQ==" - }, "node_modules/@aeaton/prosemirror-footnotes": { "version": "0.1.0", "license": "MIT", @@ -15730,11 +15725,6 @@ } }, "dependencies": { - "-": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/-/-/--0.0.1.tgz", - "integrity": "sha512-3HfneK3DGAm05fpyj20sT3apkNcvPpCuccOThOPdzz8sY7GgQGe0l93XH9bt+YzibcTIgUAIMoyVJI740RtgyQ==" - }, "@aeaton/prosemirror-footnotes": { "version": "0.1.0", "requires": { diff --git a/package.json b/package.json index 5c85f668d0..5423f40e28 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "test:open": "./node_modules/.bin/cypress open" }, "dependencies": { - "-": "^0.0.1", "@aeaton/react-prosemirror": "^0.21.1", "@aeaton/react-prosemirror-config-default": "^0.11.0", "@babel/runtime": "^7.10.4", @@ -155,6 +154,6 @@ "webpack-dev-server": "^3.11.2" }, "volta": { - "node": "16.5.0" + "node": "20.11.1" } } From 102b6901af6882f1658121c6359e906be1a013b4 Mon Sep 17 00:00:00 2001 From: shrunyan Date: Wed, 20 Mar 2024 11:31:33 -0700 Subject: [PATCH 06/23] revert: node version bump --- .github/workflows/cd-beta.yaml | 2 +- .github/workflows/cd-dev-stage.yaml | 4 ++-- .github/workflows/cd-stable.yaml | 2 +- .github/workflows/ci.yaml | 2 +- package.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cd-beta.yaml b/.github/workflows/cd-beta.yaml index 756ce8b993..b8744816a0 100644 --- a/.github/workflows/cd-beta.yaml +++ b/.github/workflows/cd-beta.yaml @@ -36,7 +36,7 @@ # - name: Set up Node # uses: actions/setup-node@v2 # with: -# node-version: "20.11.1" +# node-version: "16.5.0" # cache: "npm" # cache-dependency-path: package-lock.json # - name: Install Dependencies diff --git a/.github/workflows/cd-dev-stage.yaml b/.github/workflows/cd-dev-stage.yaml index 88a0073677..1ced1be06b 100644 --- a/.github/workflows/cd-dev-stage.yaml +++ b/.github/workflows/cd-dev-stage.yaml @@ -35,7 +35,7 @@ jobs: - name: Set up Node uses: actions/setup-node@v2 with: - node-version: "20.11.1" + node-version: "16.5.0" cache: "npm" cache-dependency-path: package-lock.json - name: Install Dependencies @@ -74,7 +74,7 @@ jobs: - name: Set up Node uses: actions/setup-node@v2 with: - node-version: "20.11.1" + node-version: "16.5.0" cache: "npm" cache-dependency-path: package-lock.json - name: Install Dependencies diff --git a/.github/workflows/cd-stable.yaml b/.github/workflows/cd-stable.yaml index df7ab78740..01ab125e87 100644 --- a/.github/workflows/cd-stable.yaml +++ b/.github/workflows/cd-stable.yaml @@ -33,7 +33,7 @@ # - name: Set up Node # uses: actions/setup-node@v2 # with: -# node-version: "20.11.1" +# node-version: "16.5.0" # cache: "npm" # cache-dependency-path: package-lock.json # - name: Install Dependencies diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7f0b647176..a071f742bb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,7 +32,7 @@ jobs: - name: Set up Node uses: actions/setup-node@v2 with: - node-version: "20.11.1" + node-version: "16.5.0" cache: "npm" cache-dependency-path: package-lock.json - name: Install Dependencies diff --git a/package.json b/package.json index 5423f40e28..937c2be707 100644 --- a/package.json +++ b/package.json @@ -154,6 +154,6 @@ "webpack-dev-server": "^3.11.2" }, "volta": { - "node": "20.11.1" + "node": "16.5.0" } } From f9023b0ce6ac04cb1ad050f1efc712b944e6389b Mon Sep 17 00:00:00 2001 From: shrunyan Date: Wed, 20 Mar 2024 11:57:48 -0700 Subject: [PATCH 07/23] WIP: CD create beta release pr --- .github/workflows/cd-dev-stage.yaml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cd-dev-stage.yaml b/.github/workflows/cd-dev-stage.yaml index 1ced1be06b..3602d22e86 100644 --- a/.github/workflows/cd-dev-stage.yaml +++ b/.github/workflows/cd-dev-stage.yaml @@ -111,7 +111,7 @@ jobs: uses: rtCamp/action-slack-notify@v2 env: SLACK_CHANNEL: code-deploy - SLACK_COLOR: "#FF0000" + SLACK_COLOR: "#36a64f" SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png SLACK_MESSAGE: "PR merge by ${{ github.actor }} has been deployed to stage." SLACK_TITLE: Stage Deployment for manager-ui @@ -122,11 +122,15 @@ jobs: runs-on: ubuntu-latest needs: [deploy_dev, deploy_stage] steps: - - uses: actions/checkout@v4 - name: Create Beta Release PR - uses: peter-evans/create-pull-request@v6 - with: - branch: dev - base: beta - title: Beta Release - # labels: + run: gh pr create -B beta -H dev --title 'Beta Release' --body 'Created by Github action' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - uses: actions/checkout@v4 + # - name: Create Beta Release PR + # uses: peter-evans/create-pull-request@v6 + # with: + # branch: dev + # base: beta + # title: Beta Release + # # labels: From 28854eff69ece94cfaff2fad08825e033f9f0541 Mon Sep 17 00:00:00 2001 From: shrunyan Date: Wed, 20 Mar 2024 12:08:48 -0700 Subject: [PATCH 08/23] fix: CD create beta release pr --- .github/workflows/cd-dev-stage.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd-dev-stage.yaml b/.github/workflows/cd-dev-stage.yaml index 3602d22e86..32d2a7044e 100644 --- a/.github/workflows/cd-dev-stage.yaml +++ b/.github/workflows/cd-dev-stage.yaml @@ -105,7 +105,7 @@ jobs: success_deploy_notification_to_slack: runs-on: ubuntu-latest if: ${{ success() }} - needs: [deploy_stage] + needs: [deploy_dev, deploy_stage] steps: - name: Success Deploy Notification To Slack uses: rtCamp/action-slack-notify@v2 @@ -122,6 +122,8 @@ jobs: runs-on: ubuntu-latest needs: [deploy_dev, deploy_stage] steps: + - name: Checkout Repo + uses: actions/checkout@v2 - name: Create Beta Release PR run: gh pr create -B beta -H dev --title 'Beta Release' --body 'Created by Github action' env: From 1d78f249c33c4bd80b107ac2b7cef458dbe79330 Mon Sep 17 00:00:00 2001 From: shrunyan Date: Wed, 20 Mar 2024 12:19:25 -0700 Subject: [PATCH 09/23] fix: show future cd workflow names --- .github/workflows/cd-beta.yaml | 15 ++++++--------- .github/workflows/cd-stable.yaml | 12 ++++++------ 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cd-beta.yaml b/.github/workflows/cd-beta.yaml index b8744816a0..d21b7b37de 100644 --- a/.github/workflows/cd-beta.yaml +++ b/.github/workflows/cd-beta.yaml @@ -1,14 +1,11 @@ -# name: cd-beta +name: cd-beta -# on: -# # Uncomment to work on CD in development mode. -# # pull_request: -# # branches: [ master ] -# push: -# branches: -# - beta +on: + push: + branches: + - beta -# jobs: +jobs: # deploy_beta: # runs-on: ubuntu-latest # env: diff --git a/.github/workflows/cd-stable.yaml b/.github/workflows/cd-stable.yaml index 01ab125e87..b4abe2e85f 100644 --- a/.github/workflows/cd-stable.yaml +++ b/.github/workflows/cd-stable.yaml @@ -1,11 +1,11 @@ -# name: cd-stable +name: cd-stable -# on: -# push: -# branches: -# - stable +on: + push: + branches: + - stable -# jobs: +jobs: # deploy_stable: # runs-on: ubuntu-latest # env: From bbe679c186bf1b2465f548d3edbb2f46a6dbc2c4 Mon Sep 17 00:00:00 2001 From: shrunyan Date: Wed, 20 Mar 2024 12:31:28 -0700 Subject: [PATCH 10/23] dep: bump github action versions --- .github/workflows/cd-dev-stage.yaml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cd-dev-stage.yaml b/.github/workflows/cd-dev-stage.yaml index 32d2a7044e..ce49589f21 100644 --- a/.github/workflows/cd-dev-stage.yaml +++ b/.github/workflows/cd-dev-stage.yaml @@ -25,11 +25,11 @@ jobs: - name: Checkout Repo uses: actions/checkout@v2 - name: Auth with Gcloud - uses: google-github-actions/auth@v0 + uses: google-github-actions/auth@v2 with: credentials_json: ${{ secrets.GCP_DEV_SA_KEY }} - name: Set up Gcloud SDK - uses: google-github-actions/setup-gcloud@v0 + uses: google-github-actions/setup-gcloud@v2 with: project_id: zesty-dev - name: Set up Node @@ -105,7 +105,7 @@ jobs: success_deploy_notification_to_slack: runs-on: ubuntu-latest if: ${{ success() }} - needs: [deploy_dev, deploy_stage] + needs: [deploy_stage] steps: - name: Success Deploy Notification To Slack uses: rtCamp/action-slack-notify@v2 @@ -128,11 +128,3 @@ jobs: run: gh pr create -B beta -H dev --title 'Beta Release' --body 'Created by Github action' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - uses: actions/checkout@v4 - # - name: Create Beta Release PR - # uses: peter-evans/create-pull-request@v6 - # with: - # branch: dev - # base: beta - # title: Beta Release - # # labels: From 2a2ec47ae73c61d046e8d3f9a80942e572dd5d67 Mon Sep 17 00:00:00 2001 From: shrunyan Date: Wed, 20 Mar 2024 12:42:28 -0700 Subject: [PATCH 11/23] turn on stable release pr creation --- .github/workflows/cd-beta.yaml | 157 ++++++++++++++++----------------- 1 file changed, 77 insertions(+), 80 deletions(-) diff --git a/.github/workflows/cd-beta.yaml b/.github/workflows/cd-beta.yaml index d21b7b37de..78957899f4 100644 --- a/.github/workflows/cd-beta.yaml +++ b/.github/workflows/cd-beta.yaml @@ -6,87 +6,84 @@ on: - beta jobs: -# deploy_beta: -# runs-on: ubuntu-latest -# env: -# ENV: "prod" + # deploy_beta: + # runs-on: ubuntu-latest + # env: + # ENV: "prod" -# steps: -# # This Clean step simply checks if there's already a workflow running from the last -# # commit and cancels it if there is. This helps us save on cloud cost in the long run. -# # See https://github.com/rokroskar/workflow-run-cleanup-action for more information. -# - name: Clean -# uses: rokroskar/workflow-run-cleanup-action@v0.2.2 -# env: -# GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" -# if: "github.ref != 'refs/heads/master'" -# - name: Checkout Repo -# uses: actions/checkout@v2 -# - name: Auth with Gcloud -# uses: google-github-actions/auth@v0 -# with: -# credentials_json: ${{ secrets.GCP_DEV_SA_KEY }} -# - name: Set up Gcloud SDK -# uses: google-github-actions/setup-gcloud@v0 -# with: -# project_id: zesty-prod -# - name: Set up Node -# uses: actions/setup-node@v2 -# with: -# node-version: "16.5.0" -# cache: "npm" -# cache-dependency-path: package-lock.json -# - name: Install Dependencies -# run: npm install -# - name: Build -# run: npm run build:prod -# env: -# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} -# - name: Deploy to Beta -# run: gcloud app deploy app.yaml --quiet --project --version beta zesty-prod + # steps: + # # This Clean step simply checks if there's already a workflow running from the last + # # commit and cancels it if there is. This helps us save on cloud cost in the long run. + # # See https://github.com/rokroskar/workflow-run-cleanup-action for more information. + # - name: Clean + # uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + # env: + # GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + # if: "github.ref != 'refs/heads/master'" + # - name: Checkout Repo + # uses: actions/checkout@v2 + # - name: Auth with Gcloud + # uses: google-github-actions/auth@v0 + # with: + # credentials_json: ${{ secrets.GCP_DEV_SA_KEY }} + # - name: Set up Gcloud SDK + # uses: google-github-actions/setup-gcloud@v0 + # with: + # project_id: zesty-prod + # - name: Set up Node + # uses: actions/setup-node@v2 + # with: + # node-version: "16.5.0" + # cache: "npm" + # cache-dependency-path: package-lock.json + # - name: Install Dependencies + # run: npm install + # - name: Build + # run: npm run build:prod + # env: + # SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + # - name: Deploy to Beta + # run: gcloud app deploy app.yaml --quiet --no-promote --version beta --project zesty-prod -# failed_deploy_notification_to_slack: -# runs-on: ubuntu-latest -# if: ${{ failure() }} -# needs: deploy_beta -# steps: -# - name: Failed Deploy Notification To Slack -# uses: rtCamp/action-slack-notify@v2 -# env: -# SLACK_CHANNEL: code-deploy -# SLACK_COLOR: "#FF0000" -# SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png -# SLACK_MESSAGE: "PR merge by ${{ github.actor }} failed to deploy." -# SLACK_TITLE: FAILED Beta Deployment for manager-ui -# SLACK_USERNAME: Deploy Bot -# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + # failed_deploy_notification_to_slack: + # runs-on: ubuntu-latest + # if: ${{ failure() }} + # needs: deploy_beta + # steps: + # - name: Failed Deploy Notification To Slack + # uses: rtCamp/action-slack-notify@v2 + # env: + # SLACK_CHANNEL: code-deploy + # SLACK_COLOR: "#FF0000" + # SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png + # SLACK_MESSAGE: "PR merge by ${{ github.actor }} failed to deploy." + # SLACK_TITLE: FAILED Beta Deployment for manager-ui + # SLACK_USERNAME: Deploy Bot + # SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} -# success_deploy_notification_to_slack: -# runs-on: ubuntu-latest -# if: ${{ success() }} -# needs: [deploy_beta] -# steps: -# - name: Success Deploy Notification To Slack -# uses: rtCamp/action-slack-notify@v2 -# env: -# SLACK_CHANNEL: code-deploy -# SLACK_COLOR: "#FF0000" -# SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png -# SLACK_MESSAGE: "PR merge by ${{ github.actor }} has been deployed to stage." -# SLACK_TITLE: Beta Deployment for manager-ui -# SLACK_USERNAME: Deploy Bot -# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + # success_deploy_notification_to_slack: + # runs-on: ubuntu-latest + # if: ${{ success() }} + # needs: [deploy_beta] + # steps: + # - name: Success Deploy Notification To Slack + # uses: rtCamp/action-slack-notify@v2 + # env: + # SLACK_CHANNEL: code-deploy + # SLACK_COLOR: "#FF0000" + # SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png + # SLACK_MESSAGE: "PR merge by ${{ github.actor }} has been deployed to stage." + # SLACK_TITLE: Beta Deployment for manager-ui + # SLACK_USERNAME: Deploy Bot + # SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} -# create_stable_pr: -# runs-on: ubuntu-latest -# needs: -# - deploy_beta - -# steps: -# - name: Create Stable Release PR -# uses: peter-evans/create-pull-request@v6 -# with: -# branch: master -# # base: master -# title: Stable Release -# # labels: + create_stable_pr: + runs-on: ubuntu-latest + # needs: [deploy_beta] + steps: + - name: Checkout Repo + uses: actions/checkout@v2 + - name: Create Stable Release PR + run: gh pr create -B stable -H beta --title 'Stable Release' --body 'Created by Github action' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 1eba5bc291dbbac2d569f385dfea4f2d9e56c2b5 Mon Sep 17 00:00:00 2001 From: shrunyan Date: Wed, 20 Mar 2024 12:53:49 -0700 Subject: [PATCH 12/23] add: Darwins existing PR check --- .github/workflows/cd-dev-stage.yaml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd-dev-stage.yaml b/.github/workflows/cd-dev-stage.yaml index ce49589f21..efb9a22e23 100644 --- a/.github/workflows/cd-dev-stage.yaml +++ b/.github/workflows/cd-dev-stage.yaml @@ -124,7 +124,24 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v2 - - name: Create Beta Release PR + + - name: Check if PR exists + id: check + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + prs=$(gh pr list \ + --repo "$GITHUB_REPOSITORY" \ + --head 'dev' \ + --base 'beta' \ + --json title \ + --jq 'length') + if ((prs > 0)); then + echo "skip=true" >> "$GITHUB_OUTPUT" + fi + + - name: Create Beta Release + if: "!steps.check.outputs.skip" run: gh pr create -B beta -H dev --title 'Beta Release' --body 'Created by Github action' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From a71a552722275eed4f2d7562d280383c1612a241 Mon Sep 17 00:00:00 2001 From: shrunyan Date: Wed, 20 Mar 2024 12:57:49 -0700 Subject: [PATCH 13/23] add: use zesty branding for automated slack notifications --- .github/workflows/cd-dev-stage.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cd-dev-stage.yaml b/.github/workflows/cd-dev-stage.yaml index efb9a22e23..a93c28b6c4 100644 --- a/.github/workflows/cd-dev-stage.yaml +++ b/.github/workflows/cd-dev-stage.yaml @@ -95,8 +95,8 @@ jobs: uses: rtCamp/action-slack-notify@v2 env: SLACK_CHANNEL: code-deploy - SLACK_COLOR: "#FF0000" - SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png + SLACK_COLOR: "#FF2A08" + SLACK_ICON: https://brand.zesty.io/zesty-io-logo.svg SLACK_MESSAGE: "PR merge by ${{ github.actor }} failed to deploy." SLACK_TITLE: FAILED Dev/Stage Deployment for manager-ui SLACK_USERNAME: Deploy Bot @@ -111,8 +111,8 @@ jobs: uses: rtCamp/action-slack-notify@v2 env: SLACK_CHANNEL: code-deploy - SLACK_COLOR: "#36a64f" - SLACK_ICON: https://clipart.world/wp-content/uploads/2021/06/Rocket-Ship-clipart-png.png + SLACK_COLOR: "#75BF43" + SLACK_ICON: https://brand.zesty.io/zesty-io-logo.svg SLACK_MESSAGE: "PR merge by ${{ github.actor }} has been deployed to stage." SLACK_TITLE: Stage Deployment for manager-ui SLACK_USERNAME: Deploy Bot From 732c8bbe2538ab89fe6a38117c7b1b4be000b2c8 Mon Sep 17 00:00:00 2001 From: shrunyan Date: Wed, 20 Mar 2024 13:31:39 -0700 Subject: [PATCH 14/23] improve slack notice message --- .github/workflows/cd-dev-stage.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cd-dev-stage.yaml b/.github/workflows/cd-dev-stage.yaml index a93c28b6c4..095d94cffb 100644 --- a/.github/workflows/cd-dev-stage.yaml +++ b/.github/workflows/cd-dev-stage.yaml @@ -98,7 +98,7 @@ jobs: SLACK_COLOR: "#FF2A08" SLACK_ICON: https://brand.zesty.io/zesty-io-logo.svg SLACK_MESSAGE: "PR merge by ${{ github.actor }} failed to deploy." - SLACK_TITLE: FAILED Dev/Stage Deployment for manager-ui + SLACK_TITLE: "FAILED: Dev/Stage Deployment for manager-ui" SLACK_USERNAME: Deploy Bot SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} @@ -113,8 +113,8 @@ jobs: SLACK_CHANNEL: code-deploy SLACK_COLOR: "#75BF43" SLACK_ICON: https://brand.zesty.io/zesty-io-logo.svg - SLACK_MESSAGE: "PR merge by ${{ github.actor }} has been deployed to stage." - SLACK_TITLE: Stage Deployment for manager-ui + # SLACK_MESSAGE: "PR merge by ${{ github.actor }} has been deployed to stage." + SLACK_TITLE: "SUCCESS: Stage Deployment of manager-ui" SLACK_USERNAME: Deploy Bot SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} From d6f76e6035e2219946d7ce207b96a31dcd4efcaf Mon Sep 17 00:00:00 2001 From: Stuart Runyan Date: Wed, 20 Mar 2024 14:01:12 -0700 Subject: [PATCH 15/23] Test/branching strategy (#2601) * testing new branching strategy CD * fix: readme node version requirement --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b27e26c1f2..d878e66101 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ A redux store is used to manage state across all of the potential sub-apps. The ## Requirements -- Node.js version 12 LTS +- Node.js version 16 LTS - Web browser: Chrome / Firefox / Edge / Safari (latest) - Redux DevTools Extension - https://github.com/zalmoxisus/redux-devtools-extension From 14f08dba4a64c84a4ce9a69d028f6c732977cca9 Mon Sep 17 00:00:00 2001 From: Nar Cuenca <28705606+theofficialnar@users.noreply.github.com> Date: Thu, 21 Mar 2024 05:05:11 +0800 Subject: [PATCH 16/23] Convert media spaces in media filename to dashes (#2594) * task: change spaces to dashes in file upload * task: change spaces to dashes in file rename --- .../components/FileModal/RenameFileModal.tsx | 18 +++++++++++++----- .../components/Thumbnail/ThumbnailContent.tsx | 10 ++++++++-- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/apps/media/src/app/components/FileModal/RenameFileModal.tsx b/src/apps/media/src/app/components/FileModal/RenameFileModal.tsx index e3c76fb40c..b20530b51c 100644 --- a/src/apps/media/src/app/components/FileModal/RenameFileModal.tsx +++ b/src/apps/media/src/app/components/FileModal/RenameFileModal.tsx @@ -14,6 +14,10 @@ import { } from "@mui/material"; import { alpha } from "@mui/material/styles"; +import { withCursorPosition } from "../../../../../../shell/components/withCursorPosition"; + +const TextFieldWithCursorPosition = withCursorPosition(TextField); + interface Props { handleUpdateMutation: (renamedFilename: string) => void; onClose?: () => void; @@ -72,7 +76,7 @@ export const RenameFileModal: FC = ({ New File Name - = ({ }, }} autoFocus - onFocus={(evt) => evt.target.select()} + onFocus={(evt: React.FocusEvent) => + evt.target.select() + } value={renamedFilename} - onChange={(evt) => { - setRenamedFilename(evt.target.value); + onChange={(evt: React.ChangeEvent) => { + setRenamedFilename(evt.target.value.replace(" ", "-")); }} - onKeyPress={(event) => event.key === "Enter" && handleUpdate()} + onKeyPress={(event: React.KeyboardEvent) => + event.key === "Enter" && handleUpdate() + } InputProps={{ disableUnderline: true, endAdornment: ( diff --git a/src/apps/media/src/app/components/Thumbnail/ThumbnailContent.tsx b/src/apps/media/src/app/components/Thumbnail/ThumbnailContent.tsx index 43d56564d9..6ce30ef6a5 100644 --- a/src/apps/media/src/app/components/Thumbnail/ThumbnailContent.tsx +++ b/src/apps/media/src/app/components/Thumbnail/ThumbnailContent.tsx @@ -9,6 +9,10 @@ import { import { alpha } from "@mui/material/styles"; +import { withCursorPosition } from "../../../../../../shell/components/withCursorPosition"; + +const TextFieldWithCursorPosition = withCursorPosition(TextField); + interface Props { filename: string; onFilenameChange?: (value: string) => void; @@ -45,13 +49,15 @@ export const ThumbnailContent: FC = ({ {onFilenameChange ? ( - onFilenameChange(e.target.value)} + onChange={(e: React.ChangeEvent) => + onFilenameChange(e.target.value.replace(" ", "-")) + } sx={{ "& .MuiInputBase-root.MuiOutlinedInput-root": { borderRadius: 0, From a61a26d7e4f8fb570eba4ecab4cc50f374ed9be5 Mon Sep 17 00:00:00 2001 From: Stuart Runyan Date: Wed, 20 Mar 2024 14:51:28 -0700 Subject: [PATCH 17/23] Test/branching strategy (#2611) * testing new branching strategy CD * fix: readme node version requirement * dep: move bable/runtime to devDep list --- package-lock.json | 188 ++++++++++++++++++---------------------------- package.json | 2 +- 2 files changed, 73 insertions(+), 117 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9e2289d1e6..8f2a2fd6ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,13 +5,11 @@ "requires": true, "packages": { "": { - "name": "manager-ui", "version": "1.0.1", "license": "Commons Clause License Condition v1.0", "dependencies": { "@aeaton/react-prosemirror": "^0.21.1", "@aeaton/react-prosemirror-config-default": "^0.11.0", - "@babel/runtime": "^7.10.4", "@fortawesome/fontawesome-svg-core": "^1.2.35", "@fortawesome/free-brands-svg-icons": "^5.15.3", "@fortawesome/free-solid-svg-icons": "^5.14.0", @@ -84,6 +82,7 @@ "@babel/plugin-transform-runtime": "^7.10.4", "@babel/preset-env": "^7.14.7", "@babel/preset-react": "^7.14.5", + "@babel/runtime": "^7.10.4", "@foreachbe/cypress-tinymce": "^1.0.0", "@sentry/cli": "^2.2.0", "@sentry/webpack-plugin": "^1.18.9", @@ -199,7 +198,6 @@ }, "node_modules/@ampproject/remapping": { "version": "2.2.0", - "dev": true, "license": "Apache-2.0", "dependencies": { "@jridgewell/gen-mapping": "^0.1.0", @@ -249,7 +247,6 @@ }, "node_modules/@babel/compat-data": { "version": "7.17.10", - "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" @@ -257,7 +254,6 @@ }, "node_modules/@babel/core": { "version": "7.17.12", - "dev": true, "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.1.0", @@ -286,7 +282,6 @@ }, "node_modules/@babel/generator": { "version": "7.18.7", - "dev": true, "license": "MIT", "dependencies": { "@babel/types": "^7.18.7", @@ -299,7 +294,6 @@ }, "node_modules/@babel/generator/node_modules/@jridgewell/gen-mapping": { "version": "0.3.2", - "dev": true, "license": "MIT", "dependencies": { "@jridgewell/set-array": "^1.0.1", @@ -335,7 +329,6 @@ }, "node_modules/@babel/helper-compilation-targets": { "version": "7.17.10", - "dev": true, "license": "MIT", "dependencies": { "@babel/compat-data": "^7.17.10", @@ -405,7 +398,6 @@ }, "node_modules/@babel/helper-environment-visitor": { "version": "7.18.6", - "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" @@ -424,7 +416,6 @@ }, "node_modules/@babel/helper-function-name": { "version": "7.18.6", - "dev": true, "license": "MIT", "dependencies": { "@babel/template": "^7.18.6", @@ -436,7 +427,6 @@ }, "node_modules/@babel/helper-hoist-variables": { "version": "7.18.6", - "dev": true, "license": "MIT", "dependencies": { "@babel/types": "^7.18.6" @@ -468,7 +458,6 @@ }, "node_modules/@babel/helper-module-transforms": { "version": "7.17.12", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-environment-visitor": "^7.16.7", @@ -532,7 +521,6 @@ }, "node_modules/@babel/helper-simple-access": { "version": "7.17.7", - "dev": true, "license": "MIT", "dependencies": { "@babel/types": "^7.17.0" @@ -554,7 +542,6 @@ }, "node_modules/@babel/helper-split-export-declaration": { "version": "7.18.6", - "dev": true, "license": "MIT", "dependencies": { "@babel/types": "^7.18.6" @@ -572,7 +559,6 @@ }, "node_modules/@babel/helper-validator-option": { "version": "7.18.6", - "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" @@ -594,7 +580,6 @@ }, "node_modules/@babel/helpers": { "version": "7.17.9", - "dev": true, "license": "MIT", "dependencies": { "@babel/template": "^7.16.7", @@ -619,7 +604,6 @@ }, "node_modules/@babel/parser": { "version": "7.18.8", - "dev": true, "license": "MIT", "bin": { "parser": "bin/babel-parser.js" @@ -1767,7 +1751,6 @@ }, "node_modules/@babel/template": { "version": "7.18.6", - "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.18.6", @@ -1780,7 +1763,6 @@ }, "node_modules/@babel/traverse": { "version": "7.18.8", - "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.18.6", @@ -2277,7 +2259,6 @@ }, "node_modules/@jridgewell/gen-mapping": { "version": "0.1.1", - "dev": true, "license": "MIT", "dependencies": { "@jridgewell/set-array": "^1.0.0", @@ -2289,7 +2270,6 @@ }, "node_modules/@jridgewell/resolve-uri": { "version": "3.0.7", - "dev": true, "license": "MIT", "engines": { "node": ">=6.0.0" @@ -2297,7 +2277,6 @@ }, "node_modules/@jridgewell/set-array": { "version": "1.1.1", - "dev": true, "license": "MIT", "engines": { "node": ">=6.0.0" @@ -2305,12 +2284,10 @@ }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.13", - "dev": true, "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.13", - "dev": true, "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", @@ -3543,7 +3520,7 @@ "version": "16.18.57", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.57.tgz", "integrity": "sha512-piPoDozdPaX1hNWFJQzzgWqE40gh986VvVx/QO9RU4qYRE55ld7iepDVgZ3ccGUw0R4wge0Oy1dd+3xOQNkkUQ==", - "dev": true + "devOptional": true }, "node_modules/@types/parse-json": { "version": "4.0.0", @@ -4819,7 +4796,6 @@ }, "node_modules/browserslist": { "version": "4.20.3", - "dev": true, "funding": [ { "type": "opencollective", @@ -4974,7 +4950,6 @@ }, "node_modules/caniuse-lite": { "version": "1.0.30001341", - "dev": true, "funding": [ { "type": "opencollective", @@ -6263,12 +6238,11 @@ }, "node_modules/dayjs": { "version": "1.11.2", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/debug": { "version": "4.3.4", - "dev": true, "license": "MIT", "dependencies": { "ms": "2.1.2" @@ -6798,7 +6772,6 @@ }, "node_modules/electron-to-chromium": { "version": "1.4.137", - "dev": true, "license": "ISC" }, "node_modules/elliptic": { @@ -7930,7 +7903,6 @@ }, "node_modules/gensync": { "version": "1.0.0-beta.2", - "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" @@ -8064,7 +8036,6 @@ }, "node_modules/globals": { "version": "11.12.0", - "dev": true, "license": "MIT", "engines": { "node": ">=4" @@ -9435,7 +9406,6 @@ }, "node_modules/jsesc": { "version": "2.5.2", - "dev": true, "license": "MIT", "bin": { "jsesc": "bin/jsesc" @@ -9471,7 +9441,6 @@ }, "node_modules/json5": { "version": "2.2.1", - "dev": true, "license": "MIT", "bin": { "json5": "lib/cli.js" @@ -10269,7 +10238,6 @@ }, "node_modules/ms": { "version": "2.1.2", - "dev": true, "license": "MIT" }, "node_modules/multicast-dns": { @@ -10478,7 +10446,6 @@ }, "node_modules/node-releases": { "version": "2.0.4", - "dev": true, "license": "MIT" }, "node_modules/nopt": { @@ -11041,7 +11008,6 @@ }, "node_modules/picocolors": { "version": "1.0.0", - "dev": true, "license": "ISC" }, "node_modules/picomatch": { @@ -12543,7 +12509,6 @@ }, "node_modules/semver": { "version": "6.3.0", - "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -15782,7 +15747,6 @@ }, "@ampproject/remapping": { "version": "2.2.0", - "dev": true, "requires": { "@jridgewell/gen-mapping": "^0.1.0", "@jridgewell/trace-mapping": "^0.3.9" @@ -15810,12 +15774,10 @@ } }, "@babel/compat-data": { - "version": "7.17.10", - "dev": true + "version": "7.17.10" }, "@babel/core": { "version": "7.17.12", - "dev": true, "requires": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.16.7", @@ -15836,7 +15798,6 @@ }, "@babel/generator": { "version": "7.18.7", - "dev": true, "requires": { "@babel/types": "^7.18.7", "@jridgewell/gen-mapping": "^0.3.2", @@ -15845,7 +15806,6 @@ "dependencies": { "@jridgewell/gen-mapping": { "version": "0.3.2", - "dev": true, "requires": { "@jridgewell/set-array": "^1.0.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -15871,7 +15831,6 @@ }, "@babel/helper-compilation-targets": { "version": "7.17.10", - "dev": true, "requires": { "@babel/compat-data": "^7.17.10", "@babel/helper-validator-option": "^7.16.7", @@ -15915,8 +15874,7 @@ } }, "@babel/helper-environment-visitor": { - "version": "7.18.6", - "dev": true + "version": "7.18.6" }, "@babel/helper-explode-assignable-expression": { "version": "7.16.7", @@ -15927,7 +15885,6 @@ }, "@babel/helper-function-name": { "version": "7.18.6", - "dev": true, "requires": { "@babel/template": "^7.18.6", "@babel/types": "^7.18.6" @@ -15935,7 +15892,6 @@ }, "@babel/helper-hoist-variables": { "version": "7.18.6", - "dev": true, "requires": { "@babel/types": "^7.18.6" } @@ -15955,7 +15911,6 @@ }, "@babel/helper-module-transforms": { "version": "7.17.12", - "dev": true, "requires": { "@babel/helper-environment-visitor": "^7.16.7", "@babel/helper-module-imports": "^7.16.7", @@ -15999,7 +15954,6 @@ }, "@babel/helper-simple-access": { "version": "7.17.7", - "dev": true, "requires": { "@babel/types": "^7.17.0" } @@ -16013,7 +15967,6 @@ }, "@babel/helper-split-export-declaration": { "version": "7.18.6", - "dev": true, "requires": { "@babel/types": "^7.18.6" } @@ -16022,8 +15975,7 @@ "version": "7.18.6" }, "@babel/helper-validator-option": { - "version": "7.18.6", - "dev": true + "version": "7.18.6" }, "@babel/helper-wrap-function": { "version": "7.16.8", @@ -16037,7 +15989,6 @@ }, "@babel/helpers": { "version": "7.17.9", - "dev": true, "requires": { "@babel/template": "^7.16.7", "@babel/traverse": "^7.17.9", @@ -16053,8 +16004,7 @@ } }, "@babel/parser": { - "version": "7.18.8", - "dev": true + "version": "7.18.8" }, "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { "version": "7.17.12", @@ -16720,7 +16670,6 @@ }, "@babel/template": { "version": "7.18.6", - "dev": true, "requires": { "@babel/code-frame": "^7.18.6", "@babel/parser": "^7.18.6", @@ -16729,7 +16678,6 @@ }, "@babel/traverse": { "version": "7.18.8", - "dev": true, "requires": { "@babel/code-frame": "^7.18.6", "@babel/generator": "^7.18.7", @@ -17063,27 +17011,22 @@ }, "@jridgewell/gen-mapping": { "version": "0.1.1", - "dev": true, "requires": { "@jridgewell/set-array": "^1.0.0", "@jridgewell/sourcemap-codec": "^1.4.10" } }, "@jridgewell/resolve-uri": { - "version": "3.0.7", - "dev": true + "version": "3.0.7" }, "@jridgewell/set-array": { - "version": "1.1.1", - "dev": true + "version": "1.1.1" }, "@jridgewell/sourcemap-codec": { - "version": "1.4.13", - "dev": true + "version": "1.4.13" }, "@jridgewell/trace-mapping": { "version": "0.3.13", - "dev": true, "requires": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -17240,7 +17183,8 @@ "@mui/types": { "version": "7.2.9", "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.9.tgz", - "integrity": "sha512-k1lN/PolaRZfNsRdAqXtcR71sTnv3z/VCCGPxU8HfdftDkzi335MdJ6scZxvofMAd/K/9EbzCZTFBmlNpQVdCg==" + "integrity": "sha512-k1lN/PolaRZfNsRdAqXtcR71sTnv3z/VCCGPxU8HfdftDkzi335MdJ6scZxvofMAd/K/9EbzCZTFBmlNpQVdCg==", + "requires": {} }, "@mui/utils": { "version": "5.14.18", @@ -17463,12 +17407,14 @@ }, "dependencies": { "redux-thunk": { - "version": "2.4.1" + "version": "2.4.1", + "requires": {} } } }, "@researchgate/react-intersection-observer": { - "version": "1.3.5" + "version": "1.3.5", + "requires": {} }, "@riotjs/observable": { "version": "4.1.1" @@ -17775,7 +17721,7 @@ "version": "16.18.57", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.57.tgz", "integrity": "sha512-piPoDozdPaX1hNWFJQzzgWqE40gh986VvVx/QO9RU4qYRE55ld7iepDVgZ3ccGUw0R4wge0Oy1dd+3xOQNkkUQ==", - "dev": true + "devOptional": true }, "@types/parse-json": { "version": "4.0.0" @@ -18000,7 +17946,8 @@ }, "@webpack-cli/configtest": { "version": "1.1.1", - "dev": true + "dev": true, + "requires": {} }, "@webpack-cli/info": { "version": "1.4.1", @@ -18011,7 +17958,8 @@ }, "@webpack-cli/serve": { "version": "1.6.1", - "dev": true + "dev": true, + "requires": {} }, "@welldone-software/why-did-you-render": { "version": "6.2.3", @@ -18075,7 +18023,8 @@ }, "acorn-import-assertions": { "version": "1.8.0", - "dev": true + "dev": true, + "requires": {} }, "agent-base": { "version": "6.0.2", @@ -18104,7 +18053,8 @@ }, "ajv-errors": { "version": "1.0.1", - "dev": true + "dev": true, + "requires": {} }, "ajv-formats": { "version": "2.1.1", @@ -18131,7 +18081,8 @@ }, "ajv-keywords": { "version": "3.5.2", - "dev": true + "dev": true, + "requires": {} }, "ansi-align": { "version": "2.0.0", @@ -18667,7 +18618,6 @@ }, "browserslist": { "version": "4.20.3", - "dev": true, "requires": { "caniuse-lite": "^1.0.30001332", "electron-to-chromium": "^1.4.118", @@ -18757,8 +18707,7 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001341", - "dev": true + "version": "1.0.30001341" }, "caseless": { "version": "0.12.0", @@ -18783,10 +18732,12 @@ "version": "3.8.0" }, "chartjs-adapter-moment": { - "version": "1.0.1" + "version": "1.0.1", + "requires": {} }, "chartjs-plugin-datalabels": { - "version": "2.0.0" + "version": "2.0.0", + "requires": {} }, "check-more-types": { "version": "2.24.0", @@ -19600,7 +19551,8 @@ }, "cypress-iframe": { "version": "1.0.1", - "dev": true + "dev": true, + "requires": {} }, "dashdash": { "version": "1.14.1", @@ -19616,11 +19568,10 @@ }, "dayjs": { "version": "1.11.2", - "dev": true + "devOptional": true }, "debug": { "version": "4.3.4", - "dev": true, "requires": { "ms": "2.1.2" } @@ -19979,8 +19930,7 @@ "dev": true }, "electron-to-chromium": { - "version": "1.4.137", - "dev": true + "version": "1.4.137" }, "elliptic": { "version": "6.5.4", @@ -20756,8 +20706,7 @@ } }, "gensync": { - "version": "1.0.0-beta.2", - "dev": true + "version": "1.0.0-beta.2" }, "get-caller-file": { "version": "2.0.5" @@ -20839,8 +20788,7 @@ } }, "globals": { - "version": "11.12.0", - "dev": true + "version": "11.12.0" }, "globby": { "version": "11.1.0", @@ -21266,7 +21214,8 @@ }, "icss-utils": { "version": "5.1.0", - "dev": true + "dev": true, + "requires": {} }, "idb-keyval": { "version": "5.1.5", @@ -21629,7 +21578,8 @@ "dev": true }, "ismounted": { - "version": "0.1.8" + "version": "0.1.8", + "requires": {} }, "isobject": { "version": "3.0.1" @@ -21695,8 +21645,7 @@ "dev": true }, "jsesc": { - "version": "2.5.2", - "dev": true + "version": "2.5.2" }, "json-parse-even-better-errors": { "version": "2.3.1" @@ -21721,8 +21670,7 @@ "version": "1.0.2" }, "json5": { - "version": "2.2.1", - "dev": true + "version": "2.2.1" }, "jsonfile": { "version": "6.1.0", @@ -22228,8 +22176,7 @@ "dev": true }, "ms": { - "version": "2.1.2", - "dev": true + "version": "2.1.2" }, "multicast-dns": { "version": "6.2.3", @@ -22376,8 +22323,7 @@ } }, "node-releases": { - "version": "2.0.4", - "dev": true + "version": "2.0.4" }, "nopt": { "version": "5.0.0", @@ -22741,8 +22687,7 @@ "dev": true }, "picocolors": { - "version": "1.0.0", - "dev": true + "version": "1.0.0" }, "picomatch": { "version": "2.3.1", @@ -22817,7 +22762,8 @@ }, "postcss-modules-extract-imports": { "version": "3.0.0", - "dev": true + "dev": true, + "requires": {} }, "postcss-modules-local-by-default": { "version": "4.0.0", @@ -23209,13 +23155,16 @@ } }, "react-chartjs-2": { - "version": "4.3.1" + "version": "4.3.1", + "requires": {} }, "react-codemirror2": { - "version": "7.2.1" + "version": "7.2.1", + "requires": {} }, "react-cool-onclickoutside": { - "version": "1.7.0" + "version": "1.7.0", + "requires": {} }, "react-dnd": { "version": "14.0.5", @@ -23350,7 +23299,8 @@ } }, "react-universal-interface": { - "version": "0.6.2" + "version": "0.6.2", + "requires": {} }, "react-use": { "version": "17.3.2", @@ -23377,10 +23327,12 @@ } }, "react-virtualized-auto-sizer": { - "version": "1.0.7" + "version": "1.0.7", + "requires": {} }, "react-virtualized-sticky-tree": { - "version": "2.1.30" + "version": "2.1.30", + "requires": {} }, "react-window": { "version": "1.8.7", @@ -23420,7 +23372,8 @@ } }, "redux-devtools-extension": { - "version": "2.13.9" + "version": "2.13.9", + "requires": {} }, "redux-sentry-middleware": { "version": "0.2.2" @@ -23622,7 +23575,8 @@ "dev": true }, "rifm": { - "version": "0.12.1" + "version": "0.12.1", + "requires": {} }, "rimraf": { "version": "3.0.2", @@ -23724,8 +23678,7 @@ } }, "semver": { - "version": "6.3.0", - "dev": true + "version": "6.3.0" }, "send": { "version": "0.18.0", @@ -24490,7 +24443,8 @@ }, "style-loader": { "version": "3.3.1", - "dev": true + "dev": true, + "requires": {} }, "stylis": { "version": "4.0.13" @@ -25008,11 +24962,13 @@ }, "use-composed-ref": { "version": "1.3.0", - "dev": true + "dev": true, + "requires": {} }, "use-isomorphic-layout-effect": { "version": "1.1.2", - "dev": true + "dev": true, + "requires": {} }, "use-latest": { "version": "1.2.1", diff --git a/package.json b/package.json index 937c2be707..a6697fd282 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,6 @@ "dependencies": { "@aeaton/react-prosemirror": "^0.21.1", "@aeaton/react-prosemirror-config-default": "^0.11.0", - "@babel/runtime": "^7.10.4", "@fortawesome/fontawesome-svg-core": "^1.2.35", "@fortawesome/free-brands-svg-icons": "^5.15.3", "@fortawesome/free-solid-svg-icons": "^5.14.0", @@ -112,6 +111,7 @@ "@babel/plugin-transform-runtime": "^7.10.4", "@babel/preset-env": "^7.14.7", "@babel/preset-react": "^7.14.5", + "@babel/runtime": "^7.10.4", "@foreachbe/cypress-tinymce": "^1.0.0", "@sentry/cli": "^2.2.0", "@sentry/webpack-plugin": "^1.18.9", From b00a280bae8ed2a4b2b66fa07d171908d6f546db Mon Sep 17 00:00:00 2001 From: Gian Espinosa <44116036+glespinosa@users.noreply.github.com> Date: Fri, 22 Mar 2024 03:43:36 +0800 Subject: [PATCH 18/23] fix the issue on showing published state on a selected version (#2590) --- .../components/ItemEditHeader/ItemEditHeaderActions.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/apps/content-editor/src/app/views/ItemEdit/components/ItemEditHeader/ItemEditHeaderActions.tsx b/src/apps/content-editor/src/app/views/ItemEdit/components/ItemEditHeader/ItemEditHeaderActions.tsx index f8255933b3..6200aed622 100644 --- a/src/apps/content-editor/src/app/views/ItemEdit/components/ItemEditHeader/ItemEditHeaderActions.tsx +++ b/src/apps/content-editor/src/app/views/ItemEdit/components/ItemEditHeader/ItemEditHeaderActions.tsx @@ -289,7 +289,8 @@ export const ItemEditHeaderActions = ({ {itemState === ITEM_STATES.draft || itemState === ITEM_STATES.dirty || publishAfterSave || - isFetching ? ( + isFetching || + saving ? ( Date: Fri, 22 Mar 2024 06:39:45 +0800 Subject: [PATCH 19/23] task: add proper settings item route (#2613) --- .../app/views/ActivityLog/views/ResourceDetails.js | 8 +++++++- src/shell/services/types.ts | 2 +- src/utility/resolveResourceUrlFromAudit.ts | 11 ++++++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/apps/reports/src/app/views/ActivityLog/views/ResourceDetails.js b/src/apps/reports/src/app/views/ActivityLog/views/ResourceDetails.js index d44a7e5cb8..fc0b521d15 100644 --- a/src/apps/reports/src/app/views/ActivityLog/views/ResourceDetails.js +++ b/src/apps/reports/src/app/views/ActivityLog/views/ResourceDetails.js @@ -19,6 +19,7 @@ import { filterByParams } from "utility/filterByParams"; import { resolveUrlFromAudit } from "../../../../../../../utility/resolveResourceUrlFromAudit"; import { CustomBreadcrumbs } from "../../../../../../../shell/components/CustomBreadcrumbs"; import { ResourceHeaderTitle } from "../components/ResourceHeaderTitle"; +import { useGetInstanceSettingsQuery } from "../../../../../../../shell/services/instance"; const Crumbs = [ { @@ -37,6 +38,7 @@ export const ResourceDetails = () => { const history = useHistory(); const [params, setParams] = useParams(); const [initialized, setInitialized] = useState(false); + const { data: rawInstanceSettings } = useGetInstanceSettingsQuery(); const zuid = useMemo( () => location.pathname.split("/").pop(), @@ -168,7 +170,11 @@ export const ResourceDetails = () => { size="small" disabled={!actionsByZuid[0] || !actionsByZuid[0]?.meta} onClick={() => { - history.push(resolveUrlFromAudit(actionsByZuid[0])); + const category = rawInstanceSettings.find( + (setting) => setting.ZUID === actionsByZuid[0]?.affectedZUID + )?.category; + + history.push(resolveUrlFromAudit(actionsByZuid[0], category)); }} > Open diff --git a/src/shell/services/types.ts b/src/shell/services/types.ts index 171f28ba6a..fa711126b9 100644 --- a/src/shell/services/types.ts +++ b/src/shell/services/types.ts @@ -244,7 +244,7 @@ export interface AuditMeta { export interface Audit { ZUID: string; - resourceType: "content" | "schema" | "code"; + resourceType: "content" | "schema" | "code" | "settings"; affectedZUID: string; actionByUserZUID: string; entityZUID: string; diff --git a/src/utility/resolveResourceUrlFromAudit.ts b/src/utility/resolveResourceUrlFromAudit.ts index 66fb0017fc..38201095ad 100644 --- a/src/utility/resolveResourceUrlFromAudit.ts +++ b/src/utility/resolveResourceUrlFromAudit.ts @@ -1,10 +1,9 @@ import { Audit } from "../shell/services/types"; -export const resolveUrlFromAudit = ({ - resourceType, - meta, - affectedZUID, -}: Audit): string => { +export const resolveUrlFromAudit = ( + { resourceType, meta, affectedZUID }: Audit, + category?: string +): string => { switch (resourceType) { case "content": const primaryZUID = meta.uri.split("/")[4]; @@ -14,6 +13,8 @@ export const resolveUrlFromAudit = ({ case "code": const codeType = meta.uri.split("/")[3]; return `/code/file/${codeType}/${affectedZUID}`; + case "settings": + return category ? `/settings/instance/${category}` : "/settings"; default: return "/"; } From 86e327b16c533c15cc5a0c95ab95ac6008ee348f Mon Sep 17 00:00:00 2001 From: shrunyan Date: Mon, 25 Mar 2024 12:18:16 -0700 Subject: [PATCH 20/23] split out stage workflow --- .github/workflows/cd-beta.yaml | 21 +++- .github/workflows/cd-dev.yaml | 108 ++++++++++++++++++ .../{cd-dev-stage.yaml => cd-stage.yaml} | 54 +-------- 3 files changed, 133 insertions(+), 50 deletions(-) create mode 100644 .github/workflows/cd-dev.yaml rename .github/workflows/{cd-dev-stage.yaml => cd-stage.yaml} (66%) diff --git a/.github/workflows/cd-beta.yaml b/.github/workflows/cd-beta.yaml index 78957899f4..c7a80376b7 100644 --- a/.github/workflows/cd-beta.yaml +++ b/.github/workflows/cd-beta.yaml @@ -83,7 +83,24 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v2 - - name: Create Stable Release PR - run: gh pr create -B stable -H beta --title 'Stable Release' --body 'Created by Github action' + + - name: Check if PR exists + id: check + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + prs=$(gh pr list \ + --repo "$GITHUB_REPOSITORY" \ + --head 'beta' \ + --base 'stable' \ + --json title \ + --jq 'length') + if ((prs > 0)); then + echo "skip=true" >> "$GITHUB_OUTPUT" + fi + + - name: Create Stable Release + if: "!steps.check.outputs.skip" + run: gh pr create -B stable -H dev --title 'Stable Release' --body 'Created by Github action' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/cd-dev.yaml b/.github/workflows/cd-dev.yaml new file mode 100644 index 0000000000..799bd4f669 --- /dev/null +++ b/.github/workflows/cd-dev.yaml @@ -0,0 +1,108 @@ +name: cd-dev + +on: + # Uncomment to work on CD in development mode. + # pull_request: + # branches: [ master ] + push: + branches: + - dev +jobs: + deploy_dev: + runs-on: ubuntu-latest + env: + ENV: "dev" + + steps: + # This Clean step simply checks if there's already a workflow running from the last + # commit and cancels it if there is. This helps us save on cloud cost in the long run. + # See https://github.com/rokroskar/workflow-run-cleanup-action for more information. + - name: Clean + uses: rokroskar/workflow-run-cleanup-action@v0.2.2 + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + if: "github.ref != 'refs/heads/master'" + - name: Checkout Repo + uses: actions/checkout@v2 + - name: Auth with Gcloud + uses: google-github-actions/auth@v2 + with: + credentials_json: ${{ secrets.GCP_DEV_SA_KEY }} + - name: Set up Gcloud SDK + uses: google-github-actions/setup-gcloud@v2 + with: + project_id: zesty-dev + - name: Set up Node + uses: actions/setup-node@v2 + with: + node-version: "16.5.0" + cache: "npm" + cache-dependency-path: package-lock.json + - name: Install Dependencies + run: npm install + - name: Build + run: npm run build:dev + env: + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + - name: Deploy to Dev + run: gcloud app deploy app.yaml --quiet --project zesty-dev + + failed_deploy_notification_to_slack: + runs-on: ubuntu-latest + if: ${{ failure() }} + needs: [deploy_dev] + steps: + - name: Failed Deploy Notification To Slack + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_CHANNEL: code-deploy + SLACK_COLOR: "#FF2A08" + SLACK_ICON: https://brand.zesty.io/zesty-io-logo.svg + SLACK_MESSAGE: "PR merge by ${{ github.actor }} failed to deploy." + SLACK_TITLE: "FAILED: Dev Deployment for manager-ui" + SLACK_USERNAME: Deploy Bot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + + success_deploy_notification_to_slack: + runs-on: ubuntu-latest + if: ${{ success() }} + needs: [deploy_dev] + steps: + - name: Success Deploy Notification To Slack + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_CHANNEL: code-deploy + SLACK_COLOR: "#75BF43" + SLACK_ICON: https://brand.zesty.io/zesty-io-logo.svg + # SLACK_MESSAGE: "PR merge by ${{ github.actor }} has been deployed to stage." + SLACK_TITLE: "SUCCESS: Dev Deployment of manager-ui" + SLACK_USERNAME: Deploy Bot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + + create_stage_pr: + runs-on: ubuntu-latest + needs: [deploy_dev] + steps: + - name: Checkout Repo + uses: actions/checkout@v2 + + - name: Check if PR exists + id: check + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + prs=$(gh pr list \ + --repo "$GITHUB_REPOSITORY" \ + --head 'dev' \ + --base 'stage' \ + --json title \ + --jq 'length') + if ((prs > 0)); then + echo "skip=true" >> "$GITHUB_OUTPUT" + fi + + - name: Create Stage Release + if: "!steps.check.outputs.skip" + run: gh pr create -B stage -H dev --title 'Stage Release' --body 'Created by Github action' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/cd-dev-stage.yaml b/.github/workflows/cd-stage.yaml similarity index 66% rename from .github/workflows/cd-dev-stage.yaml rename to .github/workflows/cd-stage.yaml index 095d94cffb..c9242eaa29 100644 --- a/.github/workflows/cd-dev-stage.yaml +++ b/.github/workflows/cd-stage.yaml @@ -1,52 +1,10 @@ -name: cd-dev-stage +name: cd-stage on: - # Uncomment to work on CD in development mode. - # pull_request: - # branches: [ master ] push: branches: - - dev + - stage jobs: - deploy_dev: - runs-on: ubuntu-latest - env: - ENV: "dev" - - steps: - # This Clean step simply checks if there's already a workflow running from the last - # commit and cancels it if there is. This helps us save on cloud cost in the long run. - # See https://github.com/rokroskar/workflow-run-cleanup-action for more information. - - name: Clean - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - if: "github.ref != 'refs/heads/master'" - - name: Checkout Repo - uses: actions/checkout@v2 - - name: Auth with Gcloud - uses: google-github-actions/auth@v2 - with: - credentials_json: ${{ secrets.GCP_DEV_SA_KEY }} - - name: Set up Gcloud SDK - uses: google-github-actions/setup-gcloud@v2 - with: - project_id: zesty-dev - - name: Set up Node - uses: actions/setup-node@v2 - with: - node-version: "16.5.0" - cache: "npm" - cache-dependency-path: package-lock.json - - name: Install Dependencies - run: npm install - - name: Build - run: npm run build:dev - env: - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - - name: Deploy to Dev - run: gcloud app deploy app.yaml --quiet --project zesty-dev - deploy_stage: runs-on: ubuntu-latest env: @@ -89,7 +47,7 @@ jobs: failed_deploy_notification_to_slack: runs-on: ubuntu-latest if: ${{ failure() }} - needs: [deploy_dev, deploy_stage] + needs: [deploy_stage] steps: - name: Failed Deploy Notification To Slack uses: rtCamp/action-slack-notify@v2 @@ -98,7 +56,7 @@ jobs: SLACK_COLOR: "#FF2A08" SLACK_ICON: https://brand.zesty.io/zesty-io-logo.svg SLACK_MESSAGE: "PR merge by ${{ github.actor }} failed to deploy." - SLACK_TITLE: "FAILED: Dev/Stage Deployment for manager-ui" + SLACK_TITLE: "FAILED: Stage Deployment for manager-ui" SLACK_USERNAME: Deploy Bot SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} @@ -120,7 +78,7 @@ jobs: create_beta_pr: runs-on: ubuntu-latest - needs: [deploy_dev, deploy_stage] + needs: [deploy_stage] steps: - name: Checkout Repo uses: actions/checkout@v2 @@ -132,7 +90,7 @@ jobs: run: | prs=$(gh pr list \ --repo "$GITHUB_REPOSITORY" \ - --head 'dev' \ + --head 'stage' \ --base 'beta' \ --json title \ --jq 'length') From d87c313723edadf907c3dd4288b6e6caec4418de Mon Sep 17 00:00:00 2001 From: shrunyan Date: Mon, 25 Mar 2024 13:58:40 -0700 Subject: [PATCH 21/23] fix: beta release cration during stage cd --- .github/workflows/cd-stage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd-stage.yaml b/.github/workflows/cd-stage.yaml index c9242eaa29..524fc7ec3c 100644 --- a/.github/workflows/cd-stage.yaml +++ b/.github/workflows/cd-stage.yaml @@ -100,6 +100,6 @@ jobs: - name: Create Beta Release if: "!steps.check.outputs.skip" - run: gh pr create -B beta -H dev --title 'Beta Release' --body 'Created by Github action' + run: gh pr create -B beta -H stage --title 'Beta Release' --body 'Created by Github action' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 72b333c9d3bade2204d820f39e5953c4704c10a5 Mon Sep 17 00:00:00 2001 From: shrunyan Date: Tue, 26 Mar 2024 17:27:24 -0700 Subject: [PATCH 22/23] fix: switch to concurrency groups and release-please in CD --- .github/workflows/cd-dev.yaml | 75 ++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 32 deletions(-) diff --git a/.github/workflows/cd-dev.yaml b/.github/workflows/cd-dev.yaml index 799bd4f669..47f4c2b372 100644 --- a/.github/workflows/cd-dev.yaml +++ b/.github/workflows/cd-dev.yaml @@ -1,5 +1,9 @@ name: cd-dev +concurrency: + group: dev + cancel-in-progress: true + on: # Uncomment to work on CD in development mode. # pull_request: @@ -7,6 +11,7 @@ on: push: branches: - dev + jobs: deploy_dev: runs-on: ubuntu-latest @@ -14,16 +19,8 @@ jobs: ENV: "dev" steps: - # This Clean step simply checks if there's already a workflow running from the last - # commit and cancels it if there is. This helps us save on cloud cost in the long run. - # See https://github.com/rokroskar/workflow-run-cleanup-action for more information. - - name: Clean - uses: rokroskar/workflow-run-cleanup-action@v0.2.2 - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - if: "github.ref != 'refs/heads/master'" - name: Checkout Repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Auth with Gcloud uses: google-github-actions/auth@v2 with: @@ -79,30 +76,44 @@ jobs: SLACK_USERNAME: Deploy Bot SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - create_stage_pr: + release-please: runs-on: ubuntu-latest - needs: [deploy_dev] steps: - - name: Checkout Repo - uses: actions/checkout@v2 + - uses: google-github-actions/release-please-action@v4 + with: + # this assumes that you have created a personal access token + # (PAT) and configured it as a GitHub action secret named + # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important). + token: ${{ secrets.GITHUB_TOKEN }} + # this is a built-in strategy in release-please, see "Action Inputs" + # for more options + release-type: node + target-branch: stage - - name: Check if PR exists - id: check - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - prs=$(gh pr list \ - --repo "$GITHUB_REPOSITORY" \ - --head 'dev' \ - --base 'stage' \ - --json title \ - --jq 'length') - if ((prs > 0)); then - echo "skip=true" >> "$GITHUB_OUTPUT" - fi + # create_stage_pr: + # runs-on: ubuntu-latest + # needs: [deploy_dev] + # steps: + # - name: Checkout Repo + # uses: actions/checkout@v2 - - name: Create Stage Release - if: "!steps.check.outputs.skip" - run: gh pr create -B stage -H dev --title 'Stage Release' --body 'Created by Github action' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Check if PR exists + # id: check + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # run: | + # prs=$(gh pr list \ + # --repo "$GITHUB_REPOSITORY" \ + # --head 'dev' \ + # --base 'stage' \ + # --json title \ + # --jq 'length') + # if ((prs > 0)); then + # echo "skip=true" >> "$GITHUB_OUTPUT" + # fi + + # - name: Create Stage Release + # if: "!steps.check.outputs.skip" + # run: gh pr create -B stage -H dev --title 'Stage Release' --body 'Created by Github action' + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From f37b1fb8d3add57e4432299bc65116a95c639709 Mon Sep 17 00:00:00 2001 From: shrunyan Date: Tue, 26 Mar 2024 17:50:55 -0700 Subject: [PATCH 23/23] fix: check current branch before release-please --- .github/workflows/cd-dev.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cd-dev.yaml b/.github/workflows/cd-dev.yaml index 47f4c2b372..8ebc18aaee 100644 --- a/.github/workflows/cd-dev.yaml +++ b/.github/workflows/cd-dev.yaml @@ -79,6 +79,8 @@ jobs: release-please: runs-on: ubuntu-latest steps: + - name: Checkout Repo + uses: actions/checkout@v2 - uses: google-github-actions/release-please-action@v4 with: # this assumes that you have created a personal access token