Skip to content

♻️ [Refactor] UMCFoundation 정비: 하드닝·공용 유틸 이식·FlexibleDecoding 통일·xcconfig 시크릿 주입#938

Merged
JEONG-J merged 8 commits into
developfrom
feat/umc-foundation-flexdecode
Jul 5, 2026
Merged

♻️ [Refactor] UMCFoundation 정비: 하드닝·공용 유틸 이식·FlexibleDecoding 통일·xcconfig 시크릿 주입#938
JEONG-J merged 8 commits into
developfrom
feat/umc-foundation-flexdecode

Conversation

@JEONG-J

@JEONG-J JEONG-J commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

✨ PR 유형

UMCFoundation 정비 — 하드닝(버그/성능/견고성) + 공용 유틸 이식 + FlexibleDecoding 단일화 + xcconfig 기반 시크릿/환경 주입. (Refactor 중심 + Feature 일부)

📷 스크린샷 or 영상(UI 변경 시)

UI 변경 없음 (Core/Foundation·빌드 설정·DTO 디코딩 레이어).

🛠️ 작업내용

레거시(AppProduct) 대비 UMCFoundation에 빠져 있던 것 이식 + 기존 코드 개선을 5개 커밋으로 정리했습니다.

① 하드닝 (Refactor)

  • ko_KR_POSIXen_US_POSIX 로케일 버그 교정 (ServerDateTimeConverter, Date+Formatting)
  • ServerDateTimeConverter hot-path ISO8601/KST 포매터 static 캐싱 (매 호출 생성 제거)
  • ErrorHandlerFoundationModels#if canImport 가드 (복원력)
  • DateFormatter.swiftDate+Formatting.swift 리네임(내용은 Date 확장), MemberStatus stale 헤더 정리

② 공용 유틸 이식 (Feat) + 테스트

  • Date+KST(KST 경계: kstStartOfDay/EndOfDay, …UTCISO8601, isAllDayInKST)
  • Date+Calendar(startOfMonth/endOfMonth, datesInMonth(), isSameDay, weekDaySymbols)
  • Error+Cancellation(Error.isCancellation), String+App(isValidHTTPURL, forceCharWrapping)

③ xcconfig 기반 시크릿/환경 주입 (Feat)

  • 신규 Secrets/Shared.xcconfig(환경별 BASE_URL Debug/Release + #include? 로컬 오버라이드) + .template + README
  • Project.swift 앱 타겟에 settings.configurations + Info.plist $(BASE_URL)/$(KAKAO_KEY)/$(TMAP_SECRET_KEY)·Kakao URL Scheme 매핑
  • 기존 신규 앱엔 시크릿/환경 주입 메커니즘이 아예 없었음(런타임 fatalError 위험) → 신규 구축. Secrets.xcconfig(실키)는 gitignore로 제외

④ Notification 정의 통합 (Refactor)

  • 분산돼 있던 Notification+Error.swift + NotificationName+App.swiftNotification+Names.swift 단일 파일 (public 심볼 동일, 동작 변화 없음)

⑤ FlexibleDecoding 단일 소스 통일 (Refactor)

  • Activity 내부 ext + Notice 5개 private ext(3가지 상이한 규약) 삭제 → UMCFoundation 정규 헬퍼로 통일 (~90 호출부 마이그레이션)
  • 정규 동작 확정: 숫자→String 은 정수 절삭("1"), optional-string 은 bad-type swallow
  • CLAUDE.md 규칙 🎉 [Chore] 리소스 폴더 구조 개선 #3 canonical 네이밍(decodeIntFlexible*) 정합, decodeFlexibleStringOrNil/OrEmpty/Array·decodeFirstNonEmptyString·decodeBoolFlexibleIfPresent 추가
  • Date+HourMinutes 완전 중복 제거 → Foundation toHourMinutes() 사용

ℹ️ 브랜치에는 별도로 올라와 있던 📄 Docs: Tuist 파일별 이관 매핑 문서 추가(작성자 본인) 커밋도 함께 포함됩니다.

✅ 검증 (로컬 빌드/테스트 통과)

  • UMCFoundation 테스트: 75 tests / 15 suites
  • ActivityData 테스트: 136 tests / 17 suites
  • MyPageData 테스트: 31 tests / 10 suites
  • NoticeData 빌드 ✅ / 전체 앱 빌드 BUILD SUCCEEDED
  • xcconfig 검증: Debug→dev.api…, Release→api…

📋 추후 진행 상황

  • CI(Xcode Cloud 등)에서 Secrets.xcconfig 자동 생성 스크립트 추가 필요(README에 안내)
  • AppState + Environment 전환 시 NotificationCenter 기반 흐름 정리(기존 TODO)

📌 리뷰 포인트

  • UMCApp/Core/Foundation/Sources/Extensions/KeyedDecodingContainer+FlexibleNumber.swift — 정규 헬퍼 세트/절삭·swallow 시맨틱
  • UMCApp/Features/Notice/Data/Sources/DTOs/** — private ext 제거 후 정규 헬퍼로 치환된 디코딩 동작(엣지: Double→String 절삭)
  • UMCApp/Project.swift + UMCApp/Secrets/Shared.xcconfig — 환경별 BASE_URL 주입 배선
  • UMCApp/Core/Foundation/Sources/Extensions/ServerDateTimeConverter.swift — 포매터 캐싱/로케일

✅ Checklist

  • 커밋 메시지 컨벤션에 맞게 작성했습니다
  • 유지-보수를 위해 주석처리를 잘 작성하였는가?

JEONG-J added 8 commits June 29, 2026 20:53
- git-workflow.md: `이슈 생성 규칙` 섹션 추가 (템플릿·라벨·이슈 Type 매핑표)
- Type은 생성 직후 REST PATCH로 설정 (gh 2.83.1 `--type` 미지원)
- Priority/Projects는 project 스코프 필요 — iOS 보드 #3, 한글 `우선순위` 필드 안내
- CLAUDE.md: 레퍼런스 인덱스의 Git Workflow 항목에 이슈 규칙 반영
- 이슈 생성 = 제목/라벨/Type + 보드#3·우선순위 + 네이티브 Priority·Effort 기본 채움
- 보드 `우선순위`(한글) ↔ 네이티브 `Priority`(영어)를 같은 우선순위 레벨로 일치 규칙 추가
- 네이티브 이슈 Fields(베타) 설정 방식(setIssueFieldValue) 및 스킬 4-4·4-5 참조 반영
레거시 AppProduct 766개 Swift 파일을 UMCApp Tuist 모듈로
옮길 때의 파일별 목적지를 정리. 확정 필요 항목은 개발
에이전트 분석으로 목적지 확정 후 반영.
- Activity 내부 ext + Notice 5개 private ext 삭제 → UMCFoundation 정규 헬퍼로 통일
- 숫자→String 은 정수 절삭('1'), optional-string 은 bad-type swallow 로 정규화
- CLAUDE.md 규칙 #3 canonical 네이밍(decodeIntFlexible*) 정합
- Date+HourMinutes 중복 제거 → Foundation toHourMinutes() 사용
@JEONG-J JEONG-J added 🔨 Refactor 코드 리팩토링 ✨ Feature 새로운 기능을 추가합니다. labels Jul 5, 2026
@JEONG-J JEONG-J self-assigned this Jul 5, 2026
@JEONG-J JEONG-J merged commit b0ea489 into develop Jul 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 Refactor 코드 리팩토링 ✨ Feature 새로운 기능을 추가합니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant