Chore/#127 QA build variant 추가#128
Conversation
Walkthrough이번 변경사항은 Android 프로젝트와 코어 데이터 모듈의 Gradle 설정에 새로운 qa 빌드 타입을 추가하는 내용입니다. Changes
Assessment against linked issues
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
app/build.gradle.kts(1 hunks)core/data/build.gradle.kts(2 hunks)core/data/src/main/java/com/yapp/core/data/remote/di/NetworkModule.kt(1 hunks)
🔇 Additional comments (3)
core/data/build.gradle.kts (1)
4-4: import 문 추가됨Properties 파일을 불러오기 위해 java.util.Properties 를 추가했습니다. 이는 local.properties 설정을 읽어 다양한 빌드 타입에 맞는 BASE_URL을 구성하기 위함입니다.
app/build.gradle.kts (1)
36-40: 앱 모듈에 QA 빌드 타입 추가release 빌드 타입을 기반으로 QA 빌드 타입을 생성하고, release 서명 설정을 적용했습니다.
matchingFallbacks을 통해 의존성 해결에 필요한 빌드 타입 설정도 올바르게 구성되었습니다.구현이 적절하게 되어 있고 Android 빌드 구성 모범 사례를 따르고 있습니다.
core/data/src/main/java/com/yapp/core/data/remote/di/NetworkModule.kt (1)
29-29: BASE_URL 로직 간소화기존에 조건부 로직으로 처리되던 BASE_URL을 BuildConfig.BASE_URL로 직접 사용하도록 변경했습니다.
이는 빌드 타입별로 다른 BASE_URL을 gradle 설정에서 관리하기 위한 변경으로, 코드를 더 간결하고 유지보수하기 쉽게 만들었습니다.이 변경은 QA 빌드 타입 추가 목적에 부합하며, 코드 간소화 측면에서도 좋은 개선입니다.
| buildTypes { | ||
| val localProperties = Properties() | ||
| localProperties.load( | ||
| project.rootProject.file("local.properties").bufferedReader() | ||
| ) | ||
|
|
||
| getByName("debug") { | ||
| buildConfigField("String", "BASE_URL", "\"${localProperties["base.url.debug"]}\"") | ||
| } | ||
| getByName("release") { | ||
| buildConfigField("String", "BASE_URL", "\"${localProperties["base.url.release"]}\"") | ||
| } | ||
| create("qa") { | ||
| initWith(getByName("release")) | ||
| matchingFallbacks += listOf("release") | ||
| buildConfigField("String", "BASE_URL", "\"${localProperties["base.url.qa"]}\"") | ||
| } | ||
| } |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
새로운 QA 빌드 타입 추가
local.properties 파일에서 각 빌드 타입별 BASE_URL 값을 읽어와 빌드 타입별로 다른 서버 환경을 사용할 수 있도록 설정했습니다. 특히 QA 빌드 타입을 release 빌드 타입 기반으로 생성하고, matchingFallbacks을 통해 의존성 해결에 필요한 빌드 타입 설정을 올바르게 구성했습니다.
그러나 local.properties 파일의 값이 없는 경우에 대한 예외 처리가 없습니다. 다음과 같이 기본값 설정이나 예외 처리 로직을 추가하는 것이 좋겠습니다.
buildTypes {
val localProperties = Properties()
localProperties.load(
project.rootProject.file("local.properties").bufferedReader()
)
+ val defaultDebugUrl = "https://dev-yappuworld.yapp.co.kr/"
+ val defaultReleaseUrl = "https://api-yappuworld.yapp.co.kr/"
+ val defaultQaUrl = "https://dev-yappuworld.yapp.co.kr/"
+
getByName("debug") {
- buildConfigField("String", "BASE_URL", "\"${localProperties["base.url.debug"]}\"")
+ buildConfigField("String", "BASE_URL", "\"${localProperties.getProperty("base.url.debug", defaultDebugUrl)}\"")
}
getByName("release") {
- buildConfigField("String", "BASE_URL", "\"${localProperties["base.url.release"]}\"")
+ buildConfigField("String", "BASE_URL", "\"${localProperties.getProperty("base.url.release", defaultReleaseUrl)}\"")
}
create("qa") {
initWith(getByName("release"))
matchingFallbacks += listOf("release")
- buildConfigField("String", "BASE_URL", "\"${localProperties["base.url.qa"]}\"")
+ buildConfigField("String", "BASE_URL", "\"${localProperties.getProperty("base.url.qa", defaultQaUrl)}\"")
}
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| buildTypes { | |
| val localProperties = Properties() | |
| localProperties.load( | |
| project.rootProject.file("local.properties").bufferedReader() | |
| ) | |
| getByName("debug") { | |
| buildConfigField("String", "BASE_URL", "\"${localProperties["base.url.debug"]}\"") | |
| } | |
| getByName("release") { | |
| buildConfigField("String", "BASE_URL", "\"${localProperties["base.url.release"]}\"") | |
| } | |
| create("qa") { | |
| initWith(getByName("release")) | |
| matchingFallbacks += listOf("release") | |
| buildConfigField("String", "BASE_URL", "\"${localProperties["base.url.qa"]}\"") | |
| } | |
| } | |
| buildTypes { | |
| val localProperties = Properties() | |
| localProperties.load( | |
| project.rootProject.file("local.properties").bufferedReader() | |
| ) | |
| val defaultDebugUrl = "https://dev-yappuworld.yapp.co.kr/" | |
| val defaultReleaseUrl = "https://api-yappuworld.yapp.co.kr/" | |
| val defaultQaUrl = "https://dev-yappuworld.yapp.co.kr/" | |
| getByName("debug") { | |
| buildConfigField("String", "BASE_URL", "\"${localProperties.getProperty("base.url.debug", defaultDebugUrl)}\"") | |
| } | |
| getByName("release") { | |
| buildConfigField("String", "BASE_URL", "\"${localProperties.getProperty("base.url.release", defaultReleaseUrl)}\"") | |
| } | |
| create("qa") { | |
| initWith(getByName("release")) | |
| matchingFallbacks += listOf("release") | |
| buildConfigField("String", "BASE_URL", "\"${localProperties.getProperty("base.url.qa", defaultQaUrl)}\"") | |
| } | |
| } |
| create("qa") { | ||
| initWith(getByName("release")) | ||
| matchingFallbacks += listOf("release") | ||
| buildConfigField("String", "BASE_URL", "\"${localProperties["base.url.qa"]}\"") | ||
| } |
There was a problem hiding this comment.
현재 QA 의 initWith 값이 릴리즈를 바라보는 이유를 알 수 있을까요 ?
현재는 Base URL 뿐이긴 한데 추가되면 릴리즈를 전부 바라보게 될거 같아서요
There was a problem hiding this comment.
릴리즈로 빌드되지만 BASE_URL은 개발 서버를 바라보도록 해야한다고 하셔서
release 환경과 동일하되, BASE_URL만 덮어쓰기하는 방식으로 했습니다!
💡 Issue
🌱 Key changes
✅ To Reviewers
실기기로 테스트를 거치긴 했는데 그래도 여유되시면 테스트 한번 해주시고 Approve 해주시면 감사하겠습니다.
baseUrl 정보는 local.properties에 추가하시면 됩니다.
📸 스크린샷
Summary by CodeRabbit
새로운 기능
리팩토링