Skip to content

[CHORE] 수동 배포가 가능하도록 CD 스크립트 수정#261

Merged
DongChyeon merged 1 commit intodevelopfrom
chore/#260-cd-manual-deploy
Sep 22, 2025
Merged

[CHORE] 수동 배포가 가능하도록 CD 스크립트 수정#261
DongChyeon merged 1 commit intodevelopfrom
chore/#260-cd-manual-deploy

Conversation

@DongChyeon
Copy link
Copy Markdown
Member

@DongChyeon DongChyeon commented Sep 22, 2025

Related issue 🛠

closed #260

어떤 변경사항이 있었나요?

  • 🐞 BugFix Something isn't working
  • 🎨 Design Markup & styling
  • 📃 Docs Documentation writing and editing (README.md, etc.)
  • ✨ Feature Feature
  • 🔨 Refactor Code refactoring
  • ⚙️ Setting Development environment setup
  • ✅ Test Test related (Junit, etc.)

CheckPoint ✅

PR이 다음 요구 사항을 충족하는지 확인하세요.

  • PR 컨벤션에 맞게 작성했습니다. (필수)
  • merge할 브랜치의 위치를 확인해 주세요(main❌/develop⭕) (필수)
  • Approve된 PR은 assigner가 머지하고, 수정 요청이 온 경우 수정 후 다시 push를 합니다. (필수)
  • BugFix의 경우, 버그의 원인을 파악하였습니다. (선택)

Work Description ✏️

  • 수동 배포가 가능하도록 CD 스크립트 수정

Uncompleted Tasks 😅

N/A

To Reviewers 📢

Summary by CodeRabbit

  • Chores
    • Android 배포 워크플로에 수동 실행 옵션을 추가했습니다. 이제 기존 자동 트리거와 별개로 필요 시 직접 실행할 수 있어, 긴급 패치·검증을 더 신속하게 진행할 수 있습니다. 사용자 기능 변화는 없으며, 빌드/배포 단계와 흐름은 기존과 동일합니다. 전반적으로 배포 운영의 유연성과 가시성이 향상되고, 릴리스 일정 관리가 보다 탄력적으로 이루어집니다.

@DongChyeon DongChyeon self-assigned this Sep 22, 2025
@DongChyeon DongChyeon added ❤️‍🩹 CHORE 작은 수정(타입변수, 패키지구조 변경 등) 💪 동현동현동현동현동현 labels Sep 22, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Sep 22, 2025

Walkthrough

GitHub Actions 워크플로우 .github/workflows/android_cd.yml에 workflow_dispatch 트리거가 추가되어, 기존 push 및 pull_request 외에 수동 실행이 가능해졌습니다. 워크플로우의 나머지 단계와 동작은 변경되지 않았습니다.

Changes

Cohort / File(s) Change Summary
GitHub Actions 워크플로우 트리거
.github/workflows/android_cd.yml
workflow_dispatch 트리거 추가로 수동 실행 지원. 기존 단계 및 제어 흐름은 유지.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Dev as Developer
    participant GH as GitHub Actions
    participant Job as Android CD Jobs

    rect rgba(200,230,255,0.3)
    note over Dev,GH: 수동 실행 경로 (신규)
    Dev->>GH: Run workflow (workflow_dispatch)
    GH->>Job: Trigger Android CD workflow
    Job-->>GH: Execute steps (unchanged)
    GH-->>Dev: Report status/results
    end

    par 기존 트리거
        note over GH: push / pull_request
    end
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed 해당 PR 제목은 CD 스크립트의 핵심 변경 사항인 수동 배포 기능 추가를 명확하게 표현하고 있어 변경 내용과 완벽히 일치합니다.
Linked Issues Check ✅ Passed PR에서 workflow_dispatch 트리거를 추가해 CD 스크립트를 수동 배포 가능하도록 변경하여 링크된 이슈 #260의 요구사항을 완전히 충족했습니다.
Out of Scope Changes Check ✅ Passed 해당 PR은 오직 workflow_dispatch 트리거 추가만을 포함하고 있어 링크된 이슈의 범위를 벗어나는 변경이 없습니다.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/#260-cd-manual-deploy

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
.github/workflows/android_cd.yml (2)

3-11: 수동 실행 시 브랜치 가드 부재 → release/ 외 브랜치에서 배포 가능**

workflow_dispatch는 브랜치 필터가 없어, UI에서 실수로 다른 브랜치를 선택해도 배포가 진행됩니다. 배포 오염 방지를 위해 release/** 가드 및 입력 파라미터를 추가하세요.

적용 제안(diff):

 on:
   push:
     branches:
       - 'release/**'
   pull_request:
     branches:
       - 'release/**'
-  workflow_dispatch:
+  workflow_dispatch:
+    inputs:
+      target_branch:
+        description: '배포할 release 브랜치 (release/...)'
+        required: true
+        type: string
+      release_notes:
+        description: '릴리즈 노트'
+        required: false
+        type: string
+      tester_groups:
+        description: '배포 그룹(쉼표 구분)'
+        required: false
+        default: 'orbit-tester-group'
+        type: string
+
+permissions:
+  contents: read
+
+concurrency:
+  group: cd-${{ github.ref_name }}
+  cancel-in-progress: false

84-85: curl | bash 원격 스크립트 실행은 공급망 리스크 큼 → 버전 고정 설치로 전환

원격 스크립트 파이프 실행은 취약합니다. Node를 설정하고 firebase-tools를 버전 고정으로 설치하세요.

+# 10. Install Node.js (for Firebase CLI)
+- name: Set up Node.js 20
+  uses: actions/setup-node@v4
+  with:
+    node-version: '20'
-
-# 10. Install Firebase CLI
-- name: Install Firebase CLI
-  run: curl -sL https://firebase.tools | bash
+# 10. Install Firebase CLI (pinned)
+- name: Install Firebase CLI
+  run: npm i -g firebase-tools@13

필요 시 버전은 팀이 관리하는 변수/inputs로 고정하세요.

🧹 Nitpick comments (7)
.github/workflows/android_cd.yml (7)

12-16: 배포 잡에 가드/타임아웃/환경 보호 추가 권장

실수 방지, 무한 대기 방지, 환경 승인 흐름을 위해 아래를 권장합니다.

 jobs:
   cd:
     name: Continuous Deployment
     runs-on: ubuntu-latest
+    if: startsWith(github.ref_name, 'release/')
+    timeout-minutes: 30
+    environment:
+      name: production

(organization 환경 보호 규칙에 ‘Required reviewers’를 걸어두면 수동 실행도 승인 게이트가 적용됩니다.)


19-21: 수동 실행 시 체크아웃 ref 고정

UI 입력으로 선택한 target_branch를 강제 사용해 빌드 일관성을 높이세요.

 - name: Checkout code
   uses: actions/checkout@v4
+  with:
+    ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target_branch || github.ref }}

22-31: Gradle 캐시 이중화 제거

setup-java의 cache: gradle와 actions/cache가 중복됩니다. 한쪽만 유지하세요(권장: setup-java).

-# 2. Cache Gradle
-- name: Cache Gradle dependencies
-  uses: actions/cache@v4
-  with:
-    path: |
-      ~/.gradle/caches
-      ~/.gradle/wrapper
-    key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
-    restore-keys: |
-      ${{ runner.os }}-gradle-

Also applies to: 34-39


45-50: 비밀 값 출력 안정성: echo → printf로 교체

echo는 개행/특수문자 이슈가 있어 디코드 실패 가능성이 있습니다.

 - run: echo $FIREBASE_SECRET | base64 --decode > app/google-services.json
+ - run: |
+     printf '%s' "$FIREBASE_SECRET" | base64 --decode > app/google-services.json

88-101: 릴리즈 노트/그룹을 입력값과 연동

수동 배포 입력값을 실제 배포 매개변수에 연결하세요.

   firebase appdistribution:distribute app/build/outputs/apk/release/app-release.apk \
     --app "$FIREBASE_APP_ID" \
-    --release-notes "🚀 release 브랜치에서 새 빌드가 업로드되었습니다!" \
-    --groups "orbit-tester-group"
+    --release-notes "${{ github.event.inputs.release_notes || '🚀 release 브랜치에서 새 빌드가 업로드되었습니다!' }}" \
+    --groups "${{ github.event.inputs.tester_groups || 'orbit-tester-group' }}"

68-74: 아티팩트 보관기간/식별자 강화

용량 관리와 트레이싱을 위해 보관기간과 이름에 브랜치/커밋 포함 권장.

   uses: actions/upload-artifact@v4
   with:
-    name: release-apk
+    name: release-apk-${{ github.ref_name }}-${{ github.sha }}
     path: app/build/outputs/apk/release/app-release.apk
+    retention-days: 7

103-111: 배포 성공/실패 모두 알림 + 실행 링크 포함

알림에 상태/실행 링크를 포함하고 항상 전송하도록 설정하세요.

 - name: Notify Discord
+  if: always()
   env:
     DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
+    JOB_STATUS: ${{ job.status }}
+    RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
   run: |
     curl -H "Content-Type: application/json" \
       -X POST \
-      -d '{"content": "🚀 Firebase App Distribution에 새 APK가 업로드되었습니다!\n🔗 다운로드 링크: https://appdistribution.firebase.google.com"}' \
+      -d "{\"content\": \"🚀 Firebase App Distribution에 새 APK가 업로드되었습니다!\n• 상태: ${JOB_STATUS}\n• 실행 링크: ${RUN_URL}\"}" \
       $DISCORD_WEBHOOK_URL
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ad099a7 and 4c530db.

📒 Files selected for processing (1)
  • .github/workflows/android_cd.yml (1 hunks)
🔇 Additional comments (1)
.github/workflows/android_cd.yml (1)

10-10: 수동 실행 트리거 추가 LGTM

PR 목적(수동 배포 지원)에 정확히 부합합니다. 별도 단계 변경 없이 안전하게 확장됐습니다.

수동 실행 권한(Repository → Actions → General → Workflow permissions / Who can run this workflow)이 팀 정책에 맞게 제한되어 있는지 한 번만 확인 부탁드립니다.

@DongChyeon DongChyeon merged commit f759d29 into develop Sep 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

❤️‍🩹 CHORE 작은 수정(타입변수, 패키지구조 변경 등) 💪 동현동현동현동현동현

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CHORE] 수동 배포가 가능하도록 CD 스크립트 수정

1 participant