From 4df8fd88c56f68c1882bf0002a075cd87d86d9f8 Mon Sep 17 00:00:00 2001 From: Chori <105255517+choridev@users.noreply.github.com> Date: Thu, 11 Sep 2025 01:22:58 +0900 Subject: [PATCH 1/3] Bugfix/#107 rollback (#119) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🐛 Fix wrong format * 💚 Detect ECS Rollback through image tag --- .github/workflows/deploy-to-prod.yml | 10 ++++++---- .github/workflows/deploy-to-stg.yml | 10 ++++++---- .github/workflows/notify-on-comment.yml | 4 ++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy-to-prod.yml b/.github/workflows/deploy-to-prod.yml index 850cca79..78de4bb8 100644 --- a/.github/workflows/deploy-to-prod.yml +++ b/.github/workflows/deploy-to-prod.yml @@ -131,14 +131,16 @@ jobs: - name: Check for Rollback id: check-rollback run: | - FINAL_TASK_DEF_ARN="${{ steps.deploy.outputs.task-definition-arn }}" EXPECTED_IMAGE_TAG="${{ needs.build.outputs.image_tag }}" - echo "Final stable Task Definition ARN: $FINAL_TASK_DEF_ARN" + # Directly query the service to get the ARN of the task definition that is ACTUALLY running. + ACTUAL_TASK_DEF_ARN=$(aws ecs describe-services --cluster ${{ env.ECS_CLUSTER }} --services ${{ env.ECS_SERVICE }} \ + --query "services[0].taskDefinition" --output text) + + echo "Task Definition ARN currently active in service: $ACTUAL_TASK_DEF_ARN" echo "Expected image tag: $EXPECTED_IMAGE_TAG" - # Describe the final task definition and get the actual image tag for the specified container - ACTUAL_IMAGE_TAG=$(aws ecs describe-task-definition --task-definition "$FINAL_TASK_DEF_ARN" \ + ACTUAL_IMAGE_TAG=$(aws ecs describe-task-definition --task-definition "$ACTUAL_TASK_DEF_ARN" \ --query "taskDefinition.containerDefinitions[?name=='${{ env.CONTAINER_NAME }}'].image" \ --output text) diff --git a/.github/workflows/deploy-to-stg.yml b/.github/workflows/deploy-to-stg.yml index 45ccc4e9..4ba19643 100644 --- a/.github/workflows/deploy-to-stg.yml +++ b/.github/workflows/deploy-to-stg.yml @@ -131,14 +131,16 @@ jobs: - name: Check for Rollback id: check-rollback run: | - FINAL_TASK_DEF_ARN="${{ steps.deploy.outputs.task-definition-arn }}" EXPECTED_IMAGE_TAG="${{ needs.build.outputs.image_tag }}" - echo "Final stable Task Definition ARN: $FINAL_TASK_DEF_ARN" + # Directly query the service to get the ARN of the task definition that is ACTUALLY running. + ACTUAL_TASK_DEF_ARN=$(aws ecs describe-services --cluster ${{ env.ECS_CLUSTER }} --services ${{ env.ECS_SERVICE }} \ + --query "services[0].taskDefinition" --output text) + + echo "Task Definition ARN currently active in service: $ACTUAL_TASK_DEF_ARN" echo "Expected image tag: $EXPECTED_IMAGE_TAG" - # Describe the final task definition and get the actual image tag for the specified container - ACTUAL_IMAGE_TAG=$(aws ecs describe-task-definition --task-definition "$FINAL_TASK_DEF_ARN" \ + ACTUAL_IMAGE_TAG=$(aws ecs describe-task-definition --task-definition "$ACTUAL_TASK_DEF_ARN" \ --query "taskDefinition.containerDefinitions[?name=='${{ env.CONTAINER_NAME }}'].image" \ --output text) diff --git a/.github/workflows/notify-on-comment.yml b/.github/workflows/notify-on-comment.yml index 484cbc1e..fd5e0335 100644 --- a/.github/workflows/notify-on-comment.yml +++ b/.github/workflows/notify-on-comment.yml @@ -29,7 +29,7 @@ jobs: }, "title": "Comment on PR #${{ github.event.issue.number }}: ${{ github.event.issue.title }}", "color": 10478271, - "description": "${{ github.event.comment.body }}\n\n[View Comment](${{ github.event.comment.html_url }})", + "description": ${{ toJSON(format('{0}\n\n[View Comment]({1})', github.event.comment.body, github.event.comment.html_url)) }}, "fields": [ { "name": "Pull Request", @@ -55,7 +55,7 @@ jobs: }, "title": "Comment on Issue #${{ github.event.issue.number }}: ${{ github.event.issue.title }}", "color": 10478271, - "description": "${{ github.event.comment.body }}\n\n[View Comment](${{ github.event.comment.html_url }})", + "description": ${{ toJSON(format('{0}\n\n[View Comment]({1})', github.event.comment.body, github.event.comment.html_url)) }}, "fields": [ { "name": "Issue", From eb1df09f20a964e20154d0ad44f68cec024c4934 Mon Sep 17 00:00:00 2001 From: Chori <105255517+choridev@users.noreply.github.com> Date: Thu, 11 Sep 2025 02:17:55 +0900 Subject: [PATCH 2/3] Remove obsolete comments (#121) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 💡 Remove obsolete comments * 🔥 Delete View Comment link --- .github/workflows/notify-on-comment.yml | 2 +- .github/workflows/validate-pr.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/notify-on-comment.yml b/.github/workflows/notify-on-comment.yml index fd5e0335..a28db54c 100644 --- a/.github/workflows/notify-on-comment.yml +++ b/.github/workflows/notify-on-comment.yml @@ -29,7 +29,7 @@ jobs: }, "title": "Comment on PR #${{ github.event.issue.number }}: ${{ github.event.issue.title }}", "color": 10478271, - "description": ${{ toJSON(format('{0}\n\n[View Comment]({1})', github.event.comment.body, github.event.comment.html_url)) }}, + "description": ${{ toJSON(format('{0}', github.event.comment.body)) }}, "fields": [ { "name": "Pull Request", diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml index 2916aaa9..28227cc9 100644 --- a/.github/workflows/validate-pr.yml +++ b/.github/workflows/validate-pr.yml @@ -30,13 +30,13 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + fetch-depth: 0 - name: Set up JDK 17 uses: actions/setup-java@v4 with: java-version: 17 - distribution: 'zulu' # Alternative distribution options are available + distribution: 'zulu' - name: Cache SonarQube packages uses: actions/cache@v4 From 12b8ffc3dfd357585487950f23d28d660b89d23a Mon Sep 17 00:00:00 2001 From: Chori <105255517+choridev@users.noreply.github.com> Date: Thu, 11 Sep 2025 03:00:23 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=92=9A=20Increase=20wait=20time=20for?= =?UTF-8?q?=20deployment=20to=2015=20minutes=20(#123)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-to-prod.yml | 2 +- .github/workflows/deploy-to-stg.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-to-prod.yml b/.github/workflows/deploy-to-prod.yml index 78de4bb8..a77e06eb 100644 --- a/.github/workflows/deploy-to-prod.yml +++ b/.github/workflows/deploy-to-prod.yml @@ -126,7 +126,7 @@ jobs: service: ${{ env.ECS_SERVICE }} cluster: ${{ env.ECS_CLUSTER }} wait-for-service-stability: true - wait-for-minutes: 12 + wait-for-minutes: 15 - name: Check for Rollback id: check-rollback diff --git a/.github/workflows/deploy-to-stg.yml b/.github/workflows/deploy-to-stg.yml index 4ba19643..da5e1f72 100644 --- a/.github/workflows/deploy-to-stg.yml +++ b/.github/workflows/deploy-to-stg.yml @@ -126,7 +126,7 @@ jobs: service: ${{ env.ECS_SERVICE }} cluster: ${{ env.ECS_CLUSTER }} wait-for-service-stability: true - wait-for-minutes: 12 + wait-for-minutes: 15 - name: Check for Rollback id: check-rollback