Skip to content

Conversation

@kaswhy
Copy link
Member

@kaswhy kaswhy commented Aug 23, 2025

📌 연관된 이슈

✨ 작업 내용

백슬래시 뒤에 공백이 있어서 actions 실패...
코드래빗 말을 잘 듣자

💬 리뷰 요구사항(선택)

Summary by CodeRabbit

  • Chores
    • 개발 배포 워크플로우 구성의 줄바꿈 공백을 정리해 명령 행 연속 표기에서 불필요한 공백을 제거했습니다. 이에 따라 CI 파이프라인에서 스크립트 해석의 일관성과 가독성이 소폭 향상되었습니다. 내부 자동화 구성의 형식 일관성을 개선하여 향후 설정 변경 시 예기치 않은 파싱 오류 가능성을 낮췄습니다. 사용자 경험, 성능, 보안에는 영향이 없으며 기존 동작은 동일합니다.

@kaswhy kaswhy self-assigned this Aug 23, 2025
@kaswhy kaswhy added the bug Something isn't working label Aug 23, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 23, 2025

Walkthrough

배포 워크플로우 파일(.github/workflows/deploy-dev.yml)에서 CodeDeploy 단계의 줄 계속 기호(백슬래시) 뒤 공백을 제거해, 백슬래시가 줄의 마지막 문자가 되도록 정리했습니다. 명령과 인자는 변경되지 않았습니다.

Changes

Cohort / File(s) Change Summary
CI/CD 워크플로
.github/workflows/deploy-dev.yml
CodeDeploy 단계의 --application-name 인자 줄에서 줄 계속용 백슬래시 뒤의 후행 공백 제거. 기능적 변경 없음.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

토끼는 살짝 줄을 다듬었지—
백슬래시 끝, 바람처럼 딱!
배포 노래는 그대로 흘러가고,
공백 한 줌은 밤하늘로 퐁—✨
“Hop hop,” 깔끔한 길로 배포 출발! 🐇🚀

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/issue-70

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link

CI status
✅ Assemble 성공
✅ Test 성공

Copy link

@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 (1)
.github/workflows/deploy-dev.yml (1)

35-56: 심각: 민감정보(.env) 아티팩트 포함 및 S3 업로드는 보안 위험

현재 .env에 아래와 같은 고감도 비밀이 기록되고, 이후 deploy.zip에 포함되어 S3로 업로드됩니다.

  • DB 자격증명, OAuth 클라이언트 시크릿, Gmail 비밀번호
  • 특히 AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY (클라우드 계정 전체 접근 위험)

이 경로는 아티팩트/버킷/배포 대상 인스턴스에서 유출 표면이 크게 늘어납니다. 최소한 다음을 권고합니다(선호 순):

  1. 최선: .env에 비밀을 넣지 말고, 배포 대상(EC2/ECS)에서 인스턴스/태스크 역할(IAM Role)로 SSM Parameter Store 또는 Secrets Manager에서 런타임 조회.
  2. 임시 완화: .env에서 AWS 키를 제거하고, S3 업로드에 KMS 암호화를 강제. 버킷 정책으로 원천 접근도 엄격 제한.

즉시 반영 가능한 “임시 완화” 예시는 아래와 같습니다.

       - name: Create Deployment Package
         run: |
           echo "DOCKER_HUB_USERNAME=${{ secrets.DOCKER_HUB_USERNAME }}" > .env
           echo "DB_HOST=${{ secrets.DB_HOST }}" >> .env 
           echo "DB_PORT=${{ secrets.DB_PORT }}" >> .env
           echo "DB_NAME_DEV=${{ secrets.DB_NAME_DEV }}" >> .env
           echo "DB_USERNAME=${{ secrets.DB_USERNAME }}" >> .env
           echo "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" >> .env
           echo "GOOGLE_CLIENT_ID=${{ secrets.GOOGLE_CLIENT_ID }}" >> .env
           echo "GOOGLE_CLIENT_SECRET=${{ secrets.GOOGLE_CLIENT_SECRET }}" >> .env
           echo "GOOGLE_REDIRECT_URI=${{ secrets.GOOGLE_REDIRECT_URI }}" >> .env
           echo "GOOGLE_ISSUER=${{secrets.GOOGLE_ISSUER}}" >> .env
           echo "SELF_ISSUER=${{secrets.SELF_ISSUER}}" >> .env
           echo "SECRET_KEY=${{secrets.SECRET_KEY}}" >> .env
-          echo "AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}" >> .env
-          echo "AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> .env
-          echo "AWS_REGION=${{ secrets.AWS_REGION }}" >> .env
+          # AWS 자격증명은 절대 .env로 배포하지 마세요. (인스턴스/태스크 역할 + SSM/Secrets로 대체)

           echo "AWS_RESOURCE_BUCKET=${{secrets.AWS_RESOURCE_BUCKET}}" >> .env
           echo "AWS_TEST_RESOURCE_BUCKET=${{secrets.AWS_TEST_RESOURCE_BUCKET}}" >> .env
           echo "GMAIL=${{secrets.GMAIL}}" >> .env
           echo "GMAIL_PASSWORD=${{secrets.GMAIL_PASSWORD}}" >> .env
           echo "DOZZLE_USERNAME=${{ secrets.DOZZLE_USERNAME }}" >> .env
           echo "DOZZLE_PASSWORD=${{ secrets.DOZZLE_PASSWORD }}" >> .env
           
           zip -r deploy.zip .env docker-compose-dev.yml deploy.dev.sh appspec.yml

또한 S3 업로드 시 KMS 암호화를 강제하여(임시 방편) 전송/저장 시 보호를 강화하세요.

-          aws s3 cp deploy.zip s3://${{ secrets.AWS_S3_BUCKET }}/deploy-dev.zip
+          aws s3 cp deploy.zip s3://${{ secrets.AWS_S3_BUCKET }}/deploy-dev.zip \
+            --sse aws:kms --sse-kms-key-id ${{ secrets.KMS_KEY_ID }}

장기적으로는 .env 자체를 아티팩트에서 제거하고, deploy.dev.sh 내에서 SSM/Secrets 조회 로직으로 대체하는 구조를 권장합니다. 필요하시면 해당 리팩터링 가이드와 패치도 제공하겠습니다.

Also applies to: 57-57

🧹 Nitpick comments (3)
.github/workflows/deploy-dev.yml (3)

59-64: GitHub OIDC로 자격증명 구성 전환 권장

aws configure set ...로 정적 키를 주입하는 대신, aws-actions/configure-aws-credentials@v4 + GitHub OIDC + IAM Role을 사용하면 키 무배포(키리스)로 보안성이 크게 향상됩니다. 예시:

-      - name: Configure AWS credentials
-        run: |
-          aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
-          aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
-          aws configure set region ${{ secrets.AWS_REGION }}
+      - name: Configure AWS credentials (OIDC)
+        uses: aws-actions/configure-aws-credentials@v4
+        with:
+          role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_OIDC_ROLE }}
+          aws-region: ${{ secrets.AWS_REGION }}

사전 준비: AWS 계정에 GitHub OIDC 프로바이더 및 신뢰 정책이 설정되어 있어야 합니다.


71-74: 인자 값은 따옴표로 감싸 안전한 파싱 보장

애플리케이션/그룹/버킷/키 값에 공백·특수문자가 섞일 가능성에 대비해 값을 인용(quoting)하는 편이 안전합니다.

           aws deploy create-deployment \
-            --application-name ${{ secrets.AWS_CODEDEPLOY_APP }} \
-            --deployment-group-name ${{ secrets.AWS_CODEDEPLOY_GROUP_DEV }} \
-            --s3-location bucket=${{ secrets.AWS_S3_BUCKET }},bundleType=zip,key=deploy-dev.zip
+            --application-name "${{ secrets.AWS_CODEDEPLOY_APP }}" \
+            --deployment-group-name "${{ secrets.AWS_CODEDEPLOY_GROUP_DEV }}" \
+            --s3-location "bucket=${{ secrets.AWS_S3_BUCKET }},bundleType=zip,key=deploy-dev.zip"

34-58: 셸 안전성 강화: ‘set -Eeuo pipefail’ 추가 제안

멀티라인 셸 스크립트 단계 상단에 다음을 추가하면 조기 실패 감지, 파이프 오류 전파, 미정의 변수 사용 방지를 통해 배포 안정성이 올라갑니다.

       - name: Create Deployment Package
         run: |
+          set -Eeuo pipefail
           echo "DOCKER_HUB_USERNAME=${{ secrets.DOCKER_HUB_USERNAME }}" > .env
           ...

동일 패턴을 다른 run 블록에도 적용하는 것을 권장합니다.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e85bdc2 and 12f4ad1.

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

72-72: 백슬래시 뒤 공백 제거 — 셸 라인 계속 오류 해결, LGTM

백슬래시는 해당 줄의 마지막 문자여야 하므로(뒤에 공백이 있으면 무시됨) 이번 수정이 정확합니다. 이 변경만으로 CodeDeploy 커맨드 파싱 이슈는 사라질 것으로 보입니다.

@kaswhy kaswhy merged commit 4637d62 into develop Aug 23, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants