-
Notifications
You must be signed in to change notification settings - Fork 3
[Feat] Firebase , CI/CD 추가 #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAndroid용 CI 워크플로우와 Firebase App Distribution 업로드 워크플로우가 추가되었고, Gradle 설정에 Firebase Analytics/Crashlytics 및 BOM이 통합되었습니다. Debug 서명 설정과 관련 비밀값 주입 단계가 도입되었으며, .gitignore에 debug output 메타데이터가 추가로 무시됩니다. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Dev as Developer
participant GH as GitHub Actions
participant Gradle as Gradle Build
participant FB as Firebase App Distribution
Dev->>GH: Push to main
GH->>Gradle: assembleDebug
GH->>GH: Decode keystores, write secrets (local.properties, google-services.json)
Gradle-->>GH: app-debug.apk
GH->>FB: Upload APK (appId, service credentials, group=testers)
FB-->>GH: Upload result
sequenceDiagram
autonumber
participant Dev as Developer
participant GH as GitHub Actions (CI)
participant Gradle as Gradle Build
Dev->>GH: Push/PR to develop
GH->>GH: Setup JDK 17, cache Gradle
GH->>GH: Write local.properties, google-services.json
GH->>Gradle: buildDebug --stacktrace
Gradle-->>GH: Build artifacts
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
Poem
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Firebase dependencies and CI/CD pipeline configuration to the Android project. The changes enable Firebase Analytics and Crashlytics integration along with automated build and distribution workflows.
- Added Firebase BOM, Analytics, and Crashlytics dependencies
- Configured CI/CD workflows for automated building and Firebase App Distribution
- Added debug keystore configuration for signing
Reviewed Changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| gradle/libs.versions.toml | Added Firebase BOM and Crashlytics plugin versions and dependencies |
| app/build.gradle.kts | Integrated Firebase Crashlytics plugin, dependencies, and debug signing configuration |
| .github/workflows/firebase-app-distribution-debug.yml | Added workflow for building and distributing debug APKs via Firebase App Distribution |
| .github/workflows/android-ci.yml | Added CI workflow for automated builds on develop branch |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
| cache: gradle |
Copilot
AI
Aug 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'cache: gradle' option in setup-java is redundant since you're already using a separate Gradle cache action below. Remove this line to avoid potential caching conflicts.
| cache: gradle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 8
🔭 Outside diff range comments (3)
gradle/libs.versions.toml (1)
68-74: Google Services 플러그인 alias도 추가 고려Analytics/Crashlytics 사용 시 com.google.gms.google-services 플러그인을 함께 적용하는 것이 일반적입니다(google-services.json 처리). 버전 카탈로그에 plugin alias를 추가하고, 루트 build.gradle.kts/app 모듈에 적용하는 걸 추천합니다.
원하시면 호환 가능한 버전 제안과 함께 플러그인/의존성 wiring 패치를 만들어 드릴게요.
app/build.gradle.kts (2)
13-15: local.properties 의존성 완화 및 안전한 기본값 처리CI나 신규 개발자 환경엔
local.properties가 없을 수 있어 빌드가 깨집니다. 파일 존재 시에만 로드하고, 없으면 환경변수 등으로 대체하세요. 또한 현재는 누락 시"null"문자열이 들어갈 수 있어 런타임 문제를 유발합니다.아래처럼 방어적으로 처리하는 것을 권장합니다.
-val properties = Properties().apply { - load(project.rootProject.file("local.properties").inputStream()) -} +val properties = Properties().apply { + val f = project.rootProject.file("local.properties") + if (f.exists()) { + f.inputStream().use { load(it) } + } +}- buildConfigField("String", "BASE_URL", "\"${properties["BASE_URL"]}\"") + buildConfigField( + "String", + "BASE_URL", + "\"${properties.getProperty("BASE_URL", System.getenv("BASE_URL") ?: "")}\"" + ) - manifestPlaceholders["KAKAO_APP_KEY"] = properties["KAKAO_APP_KEY"].toString() - buildConfigField("String", "KAKAO_APP_KEY", properties["KAKAO_APP_KEY"].toString()) + val kakaoKey = properties.getProperty("KAKAO_APP_KEY", System.getenv("KAKAO_APP_KEY") ?: "") + manifestPlaceholders["KAKAO_APP_KEY"] = kakaoKey + buildConfigField("String", "KAKAO_APP_KEY", "\"$kakaoKey\"")Also applies to: 29-33
81-85: Espresso 의존성이 main 구현에 포함됨
implementation(libs.androidx.espresso.core)는 릴리스 APK에 테스트 라이브러리를 포함시킵니다. 테스트 전용 스코프로 제한하세요.아래처럼 수정해 주세요.
-implementation(libs.androidx.espresso.core) androidTestImplementation(libs.androidx.junit) androidTestImplementation(libs.androidx.espresso.core)
🧹 Nitpick comments (11)
.github/workflows/firebase-app-distribution-debug.yml (4)
45-52: 비밀값 파일 생성은 heredoc으로 안전하게긴 JSON/Properties를 echo로 쓰면 이스케이프/개행 이슈가 자주 납니다. heredoc으로 더 안전하게 기록해요.
- name: Generate local.properties run: | - echo '${{ secrets.LOCAL_PROPERTIES }}' >> ./local.properties + cat > ./local.properties <<'EOF' + ${{ secrets.LOCAL_PROPERTIES }} + EOF @@ - name: Generate google-services.json run: | - echo '${{ secrets.GOOGLE_SERVICES }}' >> ./app/google-services.json + cat > ./app/google-services.json <<'EOF' + ${{ secrets.GOOGLE_SERVICES }} + EOF
8-11: 권한 최소화와 런 병렬 제어 추가 제안
- GITHUB_TOKEN 최소 권한을 명시하고
- 동일 브랜치에서 중복 업로드 방지(concurrency) 설정을 권장합니다.
jobs: cd-build: runs-on: ubuntu-latest + permissions: + contents: read또한 상단에 병렬 제어를 추가하세요:
on: push: branches: - main + +concurrency: + group: firebase-distribution-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true
13-16: Gradle Wrapper 검증으로 서드파티 코드 주입 리스크 감소Wrapper 검증 액션을 추가해 공급망 리스크를 줄입시다.
- uses: actions/checkout@v4 + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v2
63-63: 파일 끝 개행 누락ymlint 지적사항: EOF 개행이 없습니다. 한 줄 추가해 주세요.
.github/workflows/android-ci.yml (5)
16-22: Gradle 캐시 중복 설정setup-java의 cache: gradle 사용 중인데, 별도 actions/cache도 추가되어 중복입니다. 하나만 유지하세요. 아래 코멘트의 제거안과 함께 적용 추천.
23-32: 중복 캐시 스텝 제거 제안위 setup-java의 Gradle 캐시를 유지하고, 본 스텝은 제거하는 것을 권장합니다.
- - name: Cache Gradle packages - uses: actions/cache@v4 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }} - restore-keys: | - ${{ runner.os }}-gradle-
13-15: Gradle Wrapper 검증 추가 추천CI에도 wrapper 검증을 추가해 공급망 리스크를 낮춥시다.
- uses: actions/checkout@v4 + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v2
9-12: 권한 최소화 명시워크플로우에 최소 권한을 명시해 주세요.
jobs: # CI에서 수행할 작업을 정의한다. ci-build: runs-on: ubuntu-latest + permissions: + contents: read
33-39: 비밀값 파일 생성은 heredoc으로 안전하게멀티라인 비밀값은 heredoc이 훨씬 안전합니다.
- name: Generate local.properties run: | - echo '${{ secrets.LOCAL_PROPERTIES }}' >> ./local.properties + cat > ./local.properties <<'EOF' + ${{ secrets.LOCAL_PROPERTIES }} + EOF @@ - name: Generate google-services.json run: | - echo '${{ secrets.GOOGLE_SERVICES }}' >> ./app/google-services.json + cat > ./app/google-services.json <<'EOF' + ${{ secrets.GOOGLE_SERVICES }} + EOFbuild.gradle.kts (1)
2-8: Google Services 플러그인도 루트에서 alias로 노출 권장Firebase 구성 파일 처리를 위해 com.google.gms.google-services도 alias apply false로 노출해 두면 app 모듈에서 쉽게 적용 가능합니다. 버전 카탈로그에 해당 플러그인을 추가한 뒤 아래처럼 확장하세요.
예시:
plugins { // ... alias(libs.plugins.google.services) apply false }app/build.gradle.kts (1)
46-53: 릴리즈 최적화 제안: 난독화/리소스 축소 활성화Crashlytics를 사용하는 릴리즈라면 보통 난독화/최적화를 활성화하고 매핑 파일 업로드를 통해 가독성 있는 스택트레이스를 확보합니다.
예시:
release { - isMinifyEnabled = false + isMinifyEnabled = true + shrinkResources = true proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) }Crashlytics 매핑 업로드는 Gradle 플러그인이 자동 처리합니다.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
.github/workflows/android-ci.yml(1 hunks).github/workflows/firebase-app-distribution-debug.yml(1 hunks).gitignore(1 hunks)app/build.gradle.kts(3 hunks)build.gradle.kts(1 hunks)gradle/libs.versions.toml(4 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/firebase-app-distribution-debug.yml
[error] 63-63: no new line character at the end of file
(new-line-at-end-of-file)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: ci-build
🔇 Additional comments (3)
gradle/libs.versions.toml (1)
1-8: Firebase BoM 및 Crashlytics 플러그인 버전 최신 상태 확인 완료
확인 결과 현재 설정된
- firebaseBom = "34.1.0"
- Crashlytics Gradle 플러그인 = "3.0.6"
는 Android Gradle Plugin 8.7.x 환경에서 권장되는 최신 안정 버전이므로 추가 업데이트가 필요 없습니다.
build.gradle.kts (1)
7-7: Crashlytics 플러그인 alias 추가는 적절합니다서브프로젝트에서 필요 시 적용할 수 있게 잘 구성됐습니다.
app/build.gradle.kts (1)
118-121: Firebase BoM 사용은 좋습니다BoM으로 버전 정합성을 맞춘 점 좋습니다. 위 제안처럼 의존성 슬림업만 하면 바로 실전 투입 가능해 보여요.
| alias(libs.plugins.kotlin.android) | ||
| alias(libs.plugins.kotlin.compose) | ||
| alias(libs.plugins.kotlin.serialization) | ||
| alias(libs.plugins.firebase.crashlytics) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
CI/CD와 Firebase 구성 검증 스크립트 제안
워크플로우와 설정이 잘 맞물리는지 자동 점검해 보시죠. 아래 스크립트는 플러그인/파일/NDK 사용 여부 등을 빠르게 확인합니다.
Also applies to: 119-121, 36-43
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Check google-services plugin usage =="
rg -n $'plugins\\s*\\{[\\s\\S]*?\\}' -A 50 -g "*build.gradle*" -g "*build.gradle.kts*" | rg -n "com.google.gms.google-services" || echo "google-services plugin not found in any module."
echo "== Check google-services.json existence under app =="
fd -H "google-services.json" -a || echo "google-services.json not found in repo (might be injected in CI)."
echo "== Check Crashlytics NDK vs native code presence =="
fd -t d "cpp|jni|jniLibs" -HI || true
rg -n "externalNativeBuild|ndk\\s*\\{" -g "*build.gradle*" -g "*build.gradle.kts*" || echo "No obvious NDK build config found."
echo "== Check accidental Espresso implementation in app module =="
rg -n "implementation\\(.*espresso" app/build.gradle.kts || echo "No Espresso implementation found in app/build.gradle.kts (good)."Length of output: 1031
CI/CD 및 Firebase 설정 검증 필요
스크립트 실행 결과 다음 문제가 확인되었습니다:
- com.google.gms.google-services 플러그인(app/build.gradle.kts 등)에 적용되어 있지 않음
- app/google-services.json 파일이 레포지토리에 존재하지 않음 (CI 주입 방식이라면
.gitignore·설정 검토 필요) - Crashlytics의 NDK 빌드 설정(
externalNativeBuild혹은ndk { … })이 없음 81행(app/build.gradle.kts)에 Espresso(core) 의존성이implementation으로 잘못 지정(테스트 전용은androidTestImplementation으로 변경)
해결 방안:
- 각 모듈의
build.gradle.kts에plugins { id("com.google.gms.google-services") }추가 app/google-services.json위치 및 주입 방식 검토/보완- NDK 기반 Crashlytics 설정 추가 여부 검토
- Espresso 의존성을 테스트 스코프로 이동(
androidTestImplementation)
🤖 Prompt for AI Agents
In app/build.gradle.kts around line 8 (and related module build files), the
Google Services plugin is not applied and Crashlytics/CI setup is incomplete;
add plugins { id("com.google.gms.google-services") } to the app module (and
other modules that need Firebase) and verify app/google-services.json is
provided or injected by CI (check .gitignore and CI secret/file injection
steps); ensure Crashlytics NDK settings are configured if your project uses
native code (add externalNativeBuild/ndk { … } Crashlytics-related config or
confirm NDK not used); and at line 81 move the Espresso dependency from
implementation to androidTestImplementation so it’s scoped to instrumentation
tests.
💡 Verification agent
🧩 Analysis chain
Firebase Analytics/Crashlytics 연동에 google-services 플러그인 누락
Crashlytics 플러그인은 추가되었지만, google-services.json 리소스 처리와 기본 초기화를 위해 com.google.gms.google-services 플러그인이 필요합니다. 현재 상태에선 Firebase Analytics/Crashlytics 설정값이 빌드에 반영되지 않을 수 있어요.
아래처럼 플러그인을 함께 적용해 주세요.
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.firebase.crashlytics)
+ id("com.google.gms.google-services")
id("com.google.dagger.hilt.android") // Hilt 플러그인 추가
kotlin("kapt") // Hilt를 위한 kapt 추가
}또한 app/google-services.json 존재 여부와 CI에서의 주입 로직을 확인해 주세요. 필요 시 libs.versions.toml에 google-services 플러그인 버전도 정의해 두면 좋아요.
google-services 플러그인 적용 여부와 google-services.json 파일 존재 여부를 확인하기 위해 아래 스크립트를 실행합니다.
🏁 Script executed:
#!/usr/bin/env bash
set -e
echo "1. Build 스크립트에서 com.google.gms.google-services 플러그인 검색:"
rg -n "com\\.google\\.gms\\.google-services" --glob "*.{gradle,gradle.kts}" || true
echo "2. 버전 카탈로그(libs.versions.toml)에서 google-services alias 검색:"
rg -n "google-services" --glob "libs.versions.toml" || true
echo "3. 프로젝트에서 google-services.json 파일 존재 확인:"
fd google-services.json || trueLength of output: 512
com.google.gms.google-services 플러그인 & google-services.json 누락 확인
Firebase Analytics/Crashlytics 연동을 제대로 하려면 아래 항목을 반영해주세요:
• app/build.gradle.kts → plugins 블록에 플러그인 추가
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.firebase.crashlytics)
+ id("com.google.gms.google-services")
id("com.google.dagger.hilt.android")
kotlin("kapt")
}• app/google-services.json 파일이 프로젝트에 존재하는지 확인
• CI/CD 환경에서 google-services.json 주입 로직 점검
• (선택) libs.versions.toml에 google-services 플러그인 버전 alias 등록
위 수정 사항들을 적용하면 Firebase 설정이 빌드에 정상 반영됩니다! 🤙
🤖 Prompt for AI Agents
In app/build.gradle.kts around line 8, the Firebase Google Services Gradle
plugin is not applied; update the plugins block to add the
com.google.gms.google-services plugin, ensure the app/google-services.json file
is present in the repo or injected at CI time (and adjust CI secrets/job to copy
it into the app module before build), and optionally add an alias for the
google-services plugin in libs.versions.toml and reference that alias from the
plugins block so versions are managed centrally.
| implementation(platform(libs.firebase.bom)) | ||
| implementation(libs.firebase.crashlytics.ndk) | ||
| implementation(libs.firebase.analytics) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Crashlytics NDK 의존성 재검토 + 디버그 수집 비활성화 권장
- NDK를 사용하지 않는다면
firebase-crashlytics-ndk는 불필요한 의존성입니다. 일반crashlytics-ktx로 교체해 용량/빌드시간을 줄이세요. - 디버그 빌드에서 Crashlytics 수집은 보통 비활성화합니다. 실서버에 디버그 크래시가 올라가는 걸 방지하세요.
아래처럼 교체/추가하는 것을 권장합니다.
의존성 교체:
implementation(platform(libs.firebase.bom))
-implementation(libs.firebase.crashlytics.ndk)
+implementation("com.google.firebase:firebase-crashlytics-ktx")
implementation(libs.firebase.analytics)빌드타입별 수집 설정(예시):
android {
buildTypes {
debug {
manifestPlaceholders["firebaseCrashlyticsCollectionEnabled"] = "false"
}
release {
manifestPlaceholders["firebaseCrashlyticsCollectionEnabled"] = "true"
}
}
}NDK를 실제로 사용 중이라면, 네이티브 심볼 업로드 설정도 함께 고려해 주세요.
firebaseCrashlytics {
nativeSymbolUploadEnabled = true
}🤖 Prompt for AI Agents
In app/build.gradle.kts around lines 119 to 121, replace the
firebase-crashlytics-ndk dependency with the standard crashlytics ktx dependency
if you do not use native NDK code (to reduce APK size and build time), and add
buildType-specific manifestPlaceholders to disable Crashlytics collection for
debug and enable for release (set firebaseCrashlyticsCollectionEnabled to
"false" for debug and "true" for release). If you do use NDK, keep the ndk
dependency but enable native symbol uploads by setting
firebaseCrashlytics.nativeSymbolUploadEnabled = true in the gradle config;
otherwise remove the ndk artifact and add
implementation(libs.firebase.crashlytics.ktx) instead.
🚀 이슈번호
✏️ 변경사항
✍️ 사용법
Confluence 에 ignore 파일들 적어놨습니다.
Summary by CodeRabbit