-
Notifications
You must be signed in to change notification settings - Fork 4
[CHORE] buildkonfig 플러그인 추가, base url 설정 #15
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
Walkthrough루트와 모듈 Gradle, 버전 카탈로그에 BuildKonfig 항목을 추가했습니다. composeApp은 gradleLocalProperties로 Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as 개발자
participant CI as CI 워크플로
participant Gradle as Gradle
participant BK as BuildKonfig
participant App as HttpClientFactory
participant Ktor as Ktor Client
participant API as 원격 API
note right of CI #f0f4ff: local.properties 생성
CI->>CI: 이벤트 검사\n(PR: base.url=https://example.com\nelse: base.url=secrets.BASE_URL (필수))
CI->>Gradle: 빌드 트리거
Gradle->>BK: BuildKonfig 생성 (BASE_URL 포함)
App->>BK: BuildKonfig.BASE_URL 읽기
App->>Ktor: defaultRequest -> url = BASE_URL\nlogging level = BODY
Ktor->>API: HTTP 요청
API-->>Ktor: 응답
Ktor-->>App: 응답 반환
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests
Comment |
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: 1
🧹 Nitpick comments (1)
composeApp/src/commonMain/kotlin/org/whosin/client/data/remote/DummyDataSource.kt (1)
8-8: 불필요한 import 제거하기BuildKonfig를 import했지만 실제로는 사용하지 않고 있습니다. 코드 정리를 위해 이 import를 제거하는 것이 좋겠습니다.
-import org.whosin.client.BuildKonfig
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
build.gradle.kts(1 hunks)composeApp/build.gradle.kts(2 hunks)composeApp/src/commonMain/kotlin/org/whosin/client/core/network/HttpClientFactory.kt(2 hunks)composeApp/src/commonMain/kotlin/org/whosin/client/data/remote/DummyDataSource.kt(2 hunks)gradle/libs.versions.toml(2 hunks)
⏰ 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: android-build
🔇 Additional comments (9)
gradle/libs.versions.toml (2)
21-21: 올바른 최신 버전 사용 확인됨BuildKonfig 0.17.1 버전이 2025년 4월에 릴리스된 최신 버전으로 확인되었습니다. 적절한 버전 선택이네요!
62-62: 플러그인 정의가 일관성 있게 추가됨라이브러리와 플러그인 정의가 모두 추가되어 있고 버전 참조도 올바르게 연결되어 있습니다.
build.gradle.kts (1)
10-10: 루트 프로젝트에 플러그인 선언 잘 추가됨
apply false로 설정하여 하위 프로젝트에서 필요시 사용할 수 있도록 올바르게 설정되어 있습니다.composeApp/src/commonMain/kotlin/org/whosin/client/data/remote/DummyDataSource.kt (1)
18-19: 유용한 주석 추가됨base URL 사용에 대한 두 가지 옵션을 명확하게 보여주는 주석이 추가되어 좋습니다. 향후 다른 개발자들이 이해하기 쉬울 것 같네요.
composeApp/src/commonMain/kotlin/org/whosin/client/core/network/HttpClientFactory.kt (3)
17-20: BuildKonfig 통합이 깔끔하게 구현됨BASE_URL을 BuildKonfig에서 가져와서 객체 레벨에서 상수로 정의한 접근 방식이 좋습니다. 코드의 재사용성과 가독성이 향상되었네요.
42-42: 로깅 레벨 변경 확인로그 레벨이
ALL에서BODY로 변경되었는데, 이는 네트워크 디버깅에 적절한 수준입니다. 너무 자세한 로그를 피하면서도 필요한 정보는 확인할 수 있을 것 같습니다.
46-46: 기본 URL 설정이 올바르게 적용됨
defaultRequest에서 BASE_URL을 사용하도록 설정되어 있어, 이제 클라이언트가 기본적으로 설정된 베이스 URL을 사용할 수 있습니다.composeApp/build.gradle.kts (2)
1-1: 필요한 import가 적절히 추가됨
gradleLocalProperties를 사용하기 위한 import가 올바르게 추가되어 있습니다.
13-13: buildkonfig 플러그인 적용 확인됨플러그인이 올바르게 적용되어 있습니다.
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: 1
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)
83-92: 동일한 이슈가 iOS 잡에도 있습니다 + 중복 로직 DRY 권장.위와 같은 빈 값 처리 문제가 그대로 반복됩니다. 동일 수정 적용을 권장하며, 두 잡에서 공유하는 step은 재사용 가능한 composite action 또는 리유저블 워크플로우로 빼면 관리가 수월합니다.
수정 예시는 안드로이드 잡과 동일합니다:
- - name: Create local.properties - run: | - if [ "${{ github.event_name }}" = "pull_request" ]; then - echo "base.url=https://example.com" > local.properties - else - echo "base.url=${{ secrets.BASE_URL }}" > local.properties - if [ ! -s local.properties ]; then - echo "base.url=https://example.com" > local.properties - fi - fi + - name: Create local.properties + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + echo "base.url=https://example.com/" > local.properties + else + if [ -z "${{ secrets.BASE_URL }}" ]; then + echo "❌ secrets.BASE_URL is missing. Failing the build."; exit 1 + fi + echo "base.url=${{ secrets.BASE_URL }}" > local.properties + fi추가 팁:
- 로그에 secret 값은 기본 마스킹되지만, 안전을 위해 필요 시
::add-mask::를 추가해도 됩니다.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/ci.yml(2 hunks)composeApp/build.gradle.kts(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- composeApp/build.gradle.kts
⏰ 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). (2)
- GitHub Check: ios-build
- GitHub Check: android-build
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: 0
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)
37-47: 중복 스텝 DRY 권장두 잡의
Create local.properties가 완전히 동일합니다. 재사용 워크플로우(.github/workflows/setup-local-properties.yml)나 컴포지트 액션으로 공통화하면 유지보수 용이합니다.Also applies to: 84-94
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/ci.yml(2 hunks)
⏰ 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: ios-build
🔇 Additional comments (3)
.github/workflows/ci.yml (3)
37-47: 빈값 체크·fail-fast 반영 확인 — 좋습니다
-z로 비어있는 시크릿을 선제 차단하고 실패 처리한 점이 안전합니다. 두 잡(android/ios) 모두 동일하게 적용되어 일관성도 OK.Also applies to: 84-94
39-41: PR 이벤트 기본 URL에 트레일링 슬래시 누락 — 문서/코드와 불일치PR 설명은
https://example.com/(슬래시 포함)인데, 워크플로우는 슬래시 없이 씁니다. URL 결합 정책을 단일화하세요.다음처럼 수정 권장:
- echo "base.url=https://example.com" > local.properties + echo "base.url=https://example.com/" > local.properties동일 변경을 iOS 잡에도 반영해 주세요.
Also applies to: 86-88
37-47: BASE_URL 포맷·레거시 오타 점검 — 스크립트 수정 및 재검증 요청원본 스크립트 실행 중 rg의 PCRE2 컴파일 오류와 "unrecognized file type: kt"가 발생해 자동 확인이 불완전했습니다. 아래 수정 스크립트를 실행한 출력 결과를 첨부해 제출하세요.
대상: .github/workflows/ci.yml (37–47, 84–94)
#!/bin/bash set -euo pipefail file=.github/workflows/ci.yml echo "1) 워크플로우에서 슬래시 없는 기본 URL 탐지:" matches=$(rg -n --no-messages 'base\.url=https://example\.com' "$file" || true) if [ -z "$matches" ]; then echo "OK: 예시 URL 없음" else while IFS=: read -r path lineno line; do suffix=${line#*example.com} firstchar=${suffix:0:1} if [ -z "$suffix" ] || [ "$firstchar" != "/" ]; then echo "WARN: ${path}:${lineno} - base.url에 '/' 누락 가능 -> ${line}" else echo "OK: ${path}:${lineno} - 슬래시 포함" fi done <<< "$matches" fi echo -e "\n2) 레거시 오타(httpsL//) 탐지:" rg -n --no-messages 'httpsL//' || echo "OK: 오타 없음" echo -e "\n3) BASE_URL 사용 패턴 스캔(참고용):" rg -n -C2 --no-messages '\b(BuildKonfig\.BASE_URL|defaultRequest|takeFrom\(|appendPathSegment|appendPath|\.url\()' \ --glob '!**/build/**' --glob '**/*.kt' --glob '**/*.kts' || echo "패턴 없음" echo -e "\n=> 검토 포인트: BASE_URL이 항상 '/'로 끝나거나, 기본 요청 구성에서 슬래시를 보정하는지 확인하세요."
🚀 이슈번호
✏️ 변경사항
📷 스크린샷
✍️ 사용법
🎸 기타
Summary by CodeRabbit