From 3f6170bac84ff73b6c49e6628f78381c8ed4a0ec Mon Sep 17 00:00:00 2001 From: rodentskie Date: Thu, 11 Sep 2025 09:16:43 +0800 Subject: [PATCH 01/34] fix: tag ci workflow --- .github/workflows/create-tag.yml | 233 ++++++++++--------------------- 1 file changed, 73 insertions(+), 160 deletions(-) diff --git a/.github/workflows/create-tag.yml b/.github/workflows/create-tag.yml index 36c0a29ad..d886404c3 100644 --- a/.github/workflows/create-tag.yml +++ b/.github/workflows/create-tag.yml @@ -1,197 +1,110 @@ -## REFER DOCS: -# https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines -# https://semver.org/ -# https://github.com/semantic-release/semantic-release -# https://github.com/mathieudutour/github-tag-action#bumping - - +--- ################################################ # GITHUB ACTION WORKFLOW NAME ################################################ -name: Practera Release Tag/Branch Creation - +name: "Create tag for normal release or hotfix" ################################################ # GITHUB ACTION EVENT TRIGGER ################################################ -on: +on: workflow_dispatch: inputs: - RELEASE_BRANCH: - description: '# Branch name that has code to release!' + IS_HOTFIX: + type: choice + description: "Is a hotfix or not." required: true - default: '' + default: "false" + options: + - "false" + - "true" HOTFIX_TAG: - description: '# Optional, if Hotfix Release, then mandatory to input recent tag version (include prefix - v as well) deployed to live otherwise ignore this input' - default: 'false' + description: "Tag to calculate creation of hotfix." + default: "" + IS_MAJOR: + type: choice + description: "Is a major release?" + required: true + default: "false" + options: + - "false" + - "true" + IS_MINOR: + type: choice + description: "Is a minor release?" + required: true + default: "false" + options: + - "false" + - "true" + IS_PATCH: + type: choice + description: "Is a patch release?" + required: true + default: "false" + options: + - "false" + - "true" ################################################ -# GITHUB ACTION JOBS -################################################ +# GITHUB ACTION JOB +################################################ jobs: - create-release-tag: - name: create-release-tag - runs-on: ubuntu-latest + create-tag: + permissions: write-all timeout-minutes: 15 - + runs-on: ubuntu-latest ################################################ # GITHUB ACTIONS GLOBAL ENV VARIABLES ################################################ env: - ENV : live # Valid values are dev,test,live only - STACK_NAME: live # Valid values are au,us,uk,p2,lf,nu,p1-sandbox,p1-stage,p2-sandbox,shared,p2-usa only - ROOTSTACK: app-v2 - CFNS3BucketName: devops-cfn-templates - PRIVATES3BucketName: devops-shared-private + ENV: live STATUSREPORTS3Bucket: deployment-status.practera.com - VERSION_FILE: package.json - RELEASE_BRANCH: ${{ github.event.inputs.RELEASE_BRANCH }} - HOTFIX_TAG: ${{ github.event.inputs.HOTFIX_TAG }} - - + REGION: ap-southeast-2 + AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} + steps: ################################################ # GITHUB REPO CHECKOUT ################################################ - steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - ref: ${{ github.event.inputs.RELEASE_BRANCH }} - + fetch-depth: 0 + ref: release/live # branch for release ################################################ -# AWS CLI CONFIGURATION - DEVOPS -################################################ - - name: Configure AWS credentials from $STACK_NAME account - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.DEVOPS_AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.DEVOPS_AWS_SECRET_ACCESS_KEY }} - aws-region: ap-southeast-2 - - +# AWS credentials setup ################################################ -# NEW TAG DEFINED FOR RELEASE PROCESS -################################################ - - name: New tag defined for release process - if: env.HOTFIX_TAG == 'false' + - name: Get AWS Organization Number + id: AWS_ORG run: | - aws s3 cp s3://$STATUSREPORTS3Bucket/scripts/create-tag-release.sh create-tag-release.sh - chmod +x ./create-tag-release.sh - ./create-tag-release.sh - + CENTRALIZED=$(echo $AWS_ACCOUNT_ID | jq -r .CENTRALIZED) + echo "::add-mask::$CENTRALIZED" + echo "CENTRALIZED=$CENTRALIZED" >> $GITHUB_OUTPUT + - name: Configure AWS Credentials from Centralized account + uses: ./.github/actions/aws-oidc + with: + role-to-assume: arn:aws:iam::${{ steps.AWS_ORG.outputs.CENTRALIZED }}:role/github-restricted-role-to-assume + region: ${{ env.REGION }} -########################################################## -# NEW TAG DEFINED FOR RELEASE PROCESS - For Hotfix Release -########################################################### - - name: New tag defined for release process - if: env.HOTFIX_TAG != 'false' +################################################ +# Download script from s3 bucket +################################################ + - name: Download script file run: | - aws s3 cp s3://$STATUSREPORTS3Bucket/scripts/create-hotfix-tag-release.sh create-hotfix-tag-release.sh - chmod +x ./create-hotfix-tag-release.sh - ./create-hotfix-tag-release.sh - + aws s3 cp s3://$STATUSREPORTS3Bucket/scripts/tag-releasev2.sh tag-releasev2.sh + chmod +x ./tag-releasev2.sh ################################################ -# BUMP VERSION AND PUSH TAGS -################################################ - - name: Bump version and push tag - id: tag_version - uses: mathieudutour/github-tag-action@v5.5 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - custom_tag: ${{ env.RELEASE_TAG_VERSION }} - tag_prefix: v - release_branches: ${{ github.event.inputs.RELEASE_BRANCH }} - create_annotated_tag: true - # custom_release_rules: hotfix:patch,pre-feat:preminor,bug:patch:Bug Fixes,chore:patch:Chores - dry_run: false - - +# Run script to create tag ################################################ -# CREATE GIT TAGS FOR RELEASE PROCESS -################################################ - - name: Create a GitHub release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ steps.tag_version.outputs.new_tag }} - release_name: Release ${{ steps.tag_version.outputs.new_tag }} - body: ${{ steps.tag_version.outputs.changelog }} - - - -# ########################################################## -# # SLACK NOTIFICATION FOR SUCCESS -# ########################################################## - - name: Slack Notification - if: ${{ success() }} # Pick up events even if the job fails or is canceled. - uses: 8398a7/action-slack@v3 - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - MATRIX_CONTEXT: ${{ toJson(matrix) }} # required - with: - status: ${{ job.status }} - author_name: Release ${{ steps.tag_version.outputs.new_tag }} created for ${{ env.ROOTSTACK }} for deployment to ${{ env.ENV }} environemnt in ${{ env.STACK_NAME }} AWS account. git previous tag id ${{ env.CURRENT_TAG_VERSION }} - mention: 'here' - if_mention: failure,cancelled - job_name: create-release-tag # Match the name above. - fields: repo,commit,eventName,ref,workflow,message,author,job,took - custom_payload: | - { - username: 'GitHub Action CI WorkFlow', - icon_emoji: ':github:', - attachments: [{ - color: '${{ job.status }}' === 'success' ? 'good' : ${{ job.status }}' === 'failure' ? 'danger' : 'warning', - text: - `${process.env.AS_REPO}\n - ${process.env.AS_COMMIT}\n - ${process.env.AS_EVENT_NAME}\n - @${process.env.AS_REF}\n - @${process.env.AS_WORKFLOW}\n - ${process.env.AS_MESSAGE}\n - ${process.env.AS_AUTHOR}\n - ${process.env.AS_JOB}\n - ${process.env.AS_TOOK}`, - }] - } - - - -# ########################################################## -# # SLACK NOTIFICATION FOR FAILURE -# ########################################################## - - name: Slack Notification - if: ${{ failure() }} # Pick up events even if the job fails or is canceled. - uses: 8398a7/action-slack@v3 + - name: Run script + run: | + ./tag-releasev2.sh env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - MATRIX_CONTEXT: ${{ toJson(matrix) }} # required - with: - status: ${{ job.status }} - author_name: create tag failed; package.json version id ${{env.NEW_TAG_VERSION}}; git latest tag id ${{env.CURRENT_TAG_VERSION}} mismatch - ${{ env.ERR_MSG }} - mention: 'here' - if_mention: failure,cancelled - job_name: create-release-tag # Match the name above. - fields: repo,commit,eventName,ref,workflow,message,author,job,took - custom_payload: | - { - username: 'GitHub Action CI WorkFlow', - icon_emoji: ':github:', - attachments: [{ - color: '${{ job.status }}' === 'success' ? 'good' : ${{ job.status }}' === 'failure' ? 'danger' : 'warning', - text: - `${process.env.AS_REPO}\n - ${process.env.AS_COMMIT}\n - ${process.env.AS_EVENT_NAME}\n - @${process.env.AS_REF}\n - @${process.env.AS_WORKFLOW}\n - ${process.env.AS_MESSAGE}\n - ${process.env.AS_AUTHOR}\n - ${process.env.AS_JOB}\n - ${process.env.AS_TOOK}`, - }] - } \ No newline at end of file + IS_HOTFIX: ${{ github.event.inputs.IS_HOTFIX }} + HOTFIX_TAG: ${{ github.event.inputs.HOTFIX_TAG }} + IS_MAJOR: ${{ github.event.inputs.IS_MAJOR }} + IS_MINOR: ${{ github.event.inputs.IS_MINOR }} + IS_PATCH: ${{ github.event.inputs.IS_PATCH }} From c012a0c285bcad8f084d204f430772b6946eaa0e Mon Sep 17 00:00:00 2001 From: trtshen Date: Tue, 21 Oct 2025 14:16:18 +0800 Subject: [PATCH 02/34] hide comment if canComment isn't true --- .../src/app/components/file-upload/file-upload.component.html | 2 +- .../multi-team-member-selector.component.html | 2 +- .../v3/src/app/components/multiple/multiple.component.html | 2 +- projects/v3/src/app/components/oneof/oneof.component.html | 2 +- projects/v3/src/app/components/slider/slider.component.html | 3 +-- .../team-member-selector/team-member-selector.component.html | 2 +- projects/v3/src/app/components/text/text.component.html | 2 +- 7 files changed, 7 insertions(+), 8 deletions(-) diff --git a/projects/v3/src/app/components/file-upload/file-upload.component.html b/projects/v3/src/app/components/file-upload/file-upload.component.html index 852e10cd9..d6ff397fe 100644 --- a/projects/v3/src/app/components/file-upload/file-upload.component.html +++ b/projects/v3/src/app/components/file-upload/file-upload.component.html @@ -34,7 +34,7 @@ > - +