Skip to content

Comments

Add/#84 Config 추가 및 BASEURL 설정#85

Merged
soseoyo12 merged 1 commit intodevelopfrom
add/#84-AddConfig
Jan 18, 2026
Merged

Add/#84 Config 추가 및 BASEURL 설정#85
soseoyo12 merged 1 commit intodevelopfrom
add/#84-AddConfig

Conversation

@soseoyo12
Copy link
Contributor

🔗 연결된 이슈

📄 작업 내용

  • Config 파일 추가
  • BaseURL 설정

📚 참고자료

아요 영사자 영서누나의 Config에 숨겨 숨겨

@soseoyo12 soseoyo12 requested a review from a team January 18, 2026 11:36
@soseoyo12 soseoyo12 self-assigned this Jan 18, 2026
@soseoyo12 soseoyo12 requested review from sum130, wotjs020708 and y-eonee and removed request for a team January 18, 2026 11:36
@soseoyo12 soseoyo12 added 성용👶 Add 이미지, 아이콘 에셋 등 추가 시 사용 labels Jan 18, 2026
@soseoyo12 soseoyo12 linked an issue Jan 18, 2026 that may be closed by this pull request
1 task
@coderabbitai
Copy link

coderabbitai bot commented Jan 18, 2026

📝 Walkthrough

Walkthrough

XCBuildConfiguration에서 Config.xcconfig 파일 참조를 추가하고, Info.plist에 BASE_URL 값을 정의한 후, 이를 Environment 유틸리티를 통해 런타임에 접근하도록 구현했습니다. EndPoint에서 하드코딩된 빈 Base URL을 Environment.baseURL로 교체했습니다.

Changes

Cohort / File(s) 변경 요약
XCBuild 설정
Cherrish-iOS/Cherrish-iOS.xcodeproj/project.pbxproj
Debug 및 Release XCBuildConfiguration에 baseConfigurationReferenceAnchor 및 baseConfigurationReferenceRelativePath 추가하여 중앙화된 Core/Config.xcconfig 파일로부터 설정 상속
환경 설정 유틸리티
Cherrish-iOS/Cherrish-iOS/Core/BaseURL.swift
Info.plist에서 BASE_URL을 읽어 Environment.baseURL을 통해 전역으로 접근 가능하도록 하는 새로운 Swift 파일 추가
Info.plist
Cherrish-iOS/Cherrish-iOS/Info.plist
BASE_URL 키 추가 (값: $(BASE_URL))
Network 엔드포인트
Cherrish-iOS/Cherrish-iOS/Data/Network/EndPoint/EndPoint.swift
EndPoint.requestURL의 하드코딩된 빈 Base URL을 Environment.baseURL로 교체

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • TEAM-Cherrish/Cherrish-iOS#4 — 기존 프로젝트 구조 및 Info.plist 초기 설정을 다루었으며, 이번 PR에서 BASE_URL 설정이 추가로 확장된 동일한 파일들을 수정합니다.

Suggested labels

Setting

Suggested reviewers

  • wotjs020708
  • sum130
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed PR 설명이 Config 파일 추가 및 BaseURL 설정 작업 내용과 연결된 이슈 #84를 언급하고 있습니다.
Linked Issues check ✅ Passed PR의 코드 변경사항이 이슈 #84의 목표인 Config 파일 추가 요구사항을 충족하고 있습니다. project.pbxproj에 baseConfiguration 추가, BaseURL.swift 및 Info.plist에 Config 관련 설정이 구현되었습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 Config 파일 추가 및 BaseURL 설정이라는 PR 목표와 이슈 #84의 요구사항 범위 내에 있습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed PR 제목이 변경 내용의 주요 목표와 잘 맞습니다. Config 추가 및 BASEURL 설정은 프로젝트 파일 변경, 새로운 BaseURL 유틸리티 추가, EndPoint 업데이트, Info.plist 구성을 포함한 전체 변경 사항을 정확하게 요약합니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add/#84-AddConfig

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

@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: 3

🤖 Fix all issues with AI agents
In `@Cherrish-iOS/Cherrish-iOS.xcodeproj/project.pbxproj`:
- Around line 152-153: The project currently points both Debug and Release build
configurations to the same Core/Config.xcconfig via
baseConfigurationReferenceRelativePath and baseConfigurationReferenceAnchor;
split this by creating Config-Debug.xcconfig and Config-Release.xcconfig (with
environment-specific BASE_URL values) and update the project.pbxproj entries
that use baseConfigurationReferenceRelativePath = Core/Config.xcconfig (and the
matching baseConfigurationReferenceAnchor occurrences) so that the Debug
configuration references Config-Debug.xcconfig and the Release configuration
references Config-Release.xcconfig; repeat the same change for the other
identical baseConfigurationReference entries in the file.

In `@Cherrish-iOS/Cherrish-iOS/Core/BaseURL.swift`:
- Around line 10-12: The Environment.baseURL currently force-casts
Bundle.main.infoDictionary?["BASE_URL"] as! String which can crash if the key is
missing or not a String; update Environment.baseURL to safely unwrap and
validate Bundle.main.infoDictionary?["BASE_URL"] (e.g., use guard let base = ...
as? String else { fatalError("Missing or invalid BASE_URL in Info.plist") } or
return a sensible default) so the lookup for "BASE_URL" fails with a clear error
message instead of a runtime cast exception.

In `@Cherrish-iOS/Cherrish-iOS/Info.plist`:
- Around line 5-6: Info.plist references the build variable $(BASE_URL) which
must be defined in Cherrish-iOS/Core/Config.xcconfig; create that file locally
(or add a checked-in template Config.xcconfig.example) and define BASE_URL (e.g.
BASE_URL = https://api.example.com), ensure the Xcode project’s
baseConfigurationReferenceRelativePath continues to point to
Core/Config.xcconfig, and update README with instructions to copy
Config.xcconfig from the example and set the local value so the project can
build for all developers.

Comment on lines +152 to +153
baseConfigurationReferenceAnchor = 51B5D31A2F0514390090B8B4 /* Cherrish-iOS */;
baseConfigurationReferenceRelativePath = Core/Config.xcconfig;
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Debug와 Release에 동일한 Config 파일 사용 검토

현재 Debug와 Release 모두 동일한 Core/Config.xcconfig를 참조합니다. 개발 환경과 프로덕션 환경에서 다른 BASE_URL이 필요한 경우, 환경별로 분리된 설정 파일 사용을 권장합니다.

예시:

  • Config-Debug.xcconfig → 개발 서버 URL
  • Config-Release.xcconfig → 프로덕션 서버 URL

Also applies to: 217-218

🤖 Prompt for AI Agents
In `@Cherrish-iOS/Cherrish-iOS.xcodeproj/project.pbxproj` around lines 152 - 153,
The project currently points both Debug and Release build configurations to the
same Core/Config.xcconfig via baseConfigurationReferenceRelativePath and
baseConfigurationReferenceAnchor; split this by creating Config-Debug.xcconfig
and Config-Release.xcconfig (with environment-specific BASE_URL values) and
update the project.pbxproj entries that use
baseConfigurationReferenceRelativePath = Core/Config.xcconfig (and the matching
baseConfigurationReferenceAnchor occurrences) so that the Debug configuration
references Config-Debug.xcconfig and the Release configuration references
Config-Release.xcconfig; repeat the same change for the other identical
baseConfigurationReference entries in the file.

Comment on lines +10 to +12
enum Environment {
static let baseURL: String = Bundle.main.infoDictionary?["BASE_URL"] as! String
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Force cast 사용으로 인한 런타임 크래시 위험

as! String 강제 캐스팅은 BASE_URL이 누락되거나 타입이 맞지 않을 경우 앱 크래시를 유발합니다. 안전한 옵셔널 바인딩 또는 명시적 에러 처리를 권장합니다.

🔧 안전한 구현 제안
 enum Environment {
-    static let baseURL: String = Bundle.main.infoDictionary?["BASE_URL"] as! String
+    static let baseURL: String = {
+        guard let url = Bundle.main.infoDictionary?["BASE_URL"] as? String else {
+            fatalError("BASE_URL이 Info.plist에 정의되지 않았습니다. Config.xcconfig 설정을 확인하세요.")
+        }
+        return url
+    }()
 }

이 방식은 크래시 시 명확한 에러 메시지를 제공하여 디버깅을 용이하게 합니다.

🧰 Tools
🪛 SwiftLint (0.57.0)

[Error] 11-11: Force casts should be avoided

(force_cast)

🤖 Prompt for AI Agents
In `@Cherrish-iOS/Cherrish-iOS/Core/BaseURL.swift` around lines 10 - 12, The
Environment.baseURL currently force-casts
Bundle.main.infoDictionary?["BASE_URL"] as! String which can crash if the key is
missing or not a String; update Environment.baseURL to safely unwrap and
validate Bundle.main.infoDictionary?["BASE_URL"] (e.g., use guard let base = ...
as? String else { fatalError("Missing or invalid BASE_URL in Info.plist") } or
return a sensible default) so the lookup for "BASE_URL" fails with a clear error
message instead of a runtime cast exception.

Comment on lines +5 to +6
<key>BASE_URL</key>
<string>$(BASE_URL)</string>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for Config.xcconfig file in the repository
echo "=== Searching for Config.xcconfig ===" 
fd -t f "Config\.xcconfig" --exec sh -c 'echo "Found: {}" && cat "{}"' \;

# Also search for any .xcconfig files to get a broader view
echo ""
echo "=== All .xcconfig files in repository ===" 
fd -t f "\.xcconfig$"

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 150


🏁 Script executed:

#!/bin/bash
# Check if .xcconfig files are gitignored
echo "=== Checking .gitignore for .xcconfig patterns ===" 
if [ -f ".gitignore" ]; then
  cat .gitignore | grep -i "xcconfig" || echo "No .xcconfig patterns found in .gitignore"
else
  echo ".gitignore not found"
fi

echo ""
echo "=== Searching for BASE_URL definition in all files ===" 
rg "BASE_URL" --type-list | head -5
rg "BASE_URL" -t swift -t plist -t xml 2>/dev/null | head -20

echo ""
echo "=== Checking for README or setup documentation ===" 
fd -t f "(README|SETUP|CONFIG)" --exec sh -c 'echo "File: {}" && head -10 "{}"' \; 2>/dev/null | head -50

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 1142


🏁 Script executed:

#!/bin/bash
# Check for template or example .xcconfig files
echo "=== Searching for .xcconfig templates or examples ===" 
fd -i "xcconfig|config" -t f | grep -E "(example|template|sample)" || echo "No template files found"

echo ""
echo "=== Searching all files for BASE_URL reference ===" 
rg "BASE_URL" 2>/dev/null | head -20

echo ""
echo "=== Checking Info.plist files ===" 
fd "Info\.plist" -t f --exec sh -c 'echo "File: {}" && cat "{}"' \;

echo ""
echo "=== Checking Xcode project structure ===" 
fd "\.pbxproj" -t f | head -5

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 1125


🏁 Script executed:

#!/bin/bash
# Check pbxproj for BASE_URL or build configuration
echo "=== Checking pbxproj for BASE_URL or build settings ===" 
rg "BASE_URL|xcconfig" "Cherrish-iOS/Cherrish-iOS.xcodeproj/project.pbxproj" 2>/dev/null | head -20

echo ""
echo "=== Checking for build scripts or setup documentation ===" 
fd -t f "(Makefile|\.sh|\.yml|\.yaml)" --exec sh -c 'basename "{}" && head -5 "{}"' \; 2>/dev/null | head -50

echo ""
echo "=== Checking for any .swift files that reference xcconfig ===" 
rg "xcconfig|CONFIG" --type swift 2>/dev/null | head -10

echo ""
echo "=== Full README.md to check for setup instructions ===" 
cat README.md | head -100

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 3130


Config.xcconfig 파일 생성 필수

Info.plist에서 참조하는 $(BASE_URL) 변수는 Core/Config.xcconfig 파일에서 정의되어야 합니다. Xcode 프로젝트 설정(pbxproj)에 이 파일이 baseConfigurationReferenceRelativePath로 이미 지정되어 있으나, 파일이 .gitignore에 등록되어 있어 저장소에는 포함되지 않습니다.

각 개발자가 로컬에서 직접 Cherrish-iOS/Core/Config.xcconfig 파일을 생성하고 BASE_URL 값을 정의해야 프로젝트가 정상적으로 빌드됩니다. README에 이에 대한 설정 가이드를 추가하거나, Config.xcconfig.example 템플릿 파일을 제공하는 것을 권장합니다.

🤖 Prompt for AI Agents
In `@Cherrish-iOS/Cherrish-iOS/Info.plist` around lines 5 - 6, Info.plist
references the build variable $(BASE_URL) which must be defined in
Cherrish-iOS/Core/Config.xcconfig; create that file locally (or add a checked-in
template Config.xcconfig.example) and define BASE_URL (e.g. BASE_URL =
https://api.example.com), ensure the Xcode project’s
baseConfigurationReferenceRelativePath continues to point to
Core/Config.xcconfig, and update README with instructions to copy
Config.xcconfig from the example and set the local value so the project can
build for all developers.

@y-eonee y-eonee changed the title Feat/#84 Config 추가 및 BASEURL 설정 Add/#84 Config 추가 및 BASEURL 설정 Jan 18, 2026
Copy link
Contributor

@y-eonee y-eonee left a comment

Choose a reason for hiding this comment

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

ptsd는 극복하는거야~ㅋㅋ

Copy link
Contributor

@sum130 sum130 left a comment

Choose a reason for hiding this comment

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

ptsd 극복 추카추~~ thanksTo 영서~~~

Copy link
Contributor

@wotjs020708 wotjs020708 left a comment

Choose a reason for hiding this comment

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

어푸푸푸

@soseoyo12 soseoyo12 merged commit 5734e2d into develop Jan 18, 2026
1 check passed
@soseoyo12 soseoyo12 deleted the add/#84-AddConfig branch January 18, 2026 12:55
Kimgyuilli pushed a commit that referenced this pull request Jan 21, 2026
Add/#84 Config 추가 및  BASEURL 설정
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Add 이미지, 아이콘 에셋 등 추가 시 사용 성용👶

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Add] config파일 추가

4 participants