Skip to content

[Feat] #233 - 모노맨션 브랜드 QR 파싱 전략 추가#234

Open
Remaked-Swain wants to merge 2 commits intodevelopfrom
feat/#233-monomansion-parsing-strategy
Open

[Feat] #233 - 모노맨션 브랜드 QR 파싱 전략 추가#234
Remaked-Swain wants to merge 2 commits intodevelopfrom
feat/#233-monomansion-parsing-strategy

Conversation

@Remaked-Swain
Copy link
Copy Markdown
Member

@Remaked-Swain Remaked-Swain commented May 5, 2026

🌴 작업한 브랜치

✅ 작업한 내용

  • QRCodeBrand에 모노맨션 브랜드를 추가했습니다.
  • 모노맨션 QR URL 호스트(qr.mono-mansion.com)를 인식하도록 host keyword를 등록했습니다.
  • MonomansionStrategy.htmlCrawling 전략으로 구현했습니다.
  • 모노맨션 QR 페이지 HTML에서 ncloudstorage.com 원본 이미지 URL을 추출하도록 구현했습니다.
  • 추출한 이미지 URL을 통해 원본 이미지 데이터를 다운로드하도록 구현했습니다.
  • DefaultQRCodeScanRepositoryMonomansionStrategy를 등록했습니다.

❗️PR Point

  • 실제 확보한 QR URL(https://qr.mono-mansion.com/nO7qKdnR)을 QR 이미지로 생성해 스캐너로 검증했습니다.
  • 전략이 정상적으로 실행되고, HTML 내 원본 이미지 URL을 통해 실제 원본 이미지 확보가 가능함을 확인했습니다.
  • 기존 파싱 전략들과 크게 다른 부분이 없어서 PR 포인트도 많이 없을 것 같습니다.

📸 스크린샷

생략합니다.

📟 관련 이슈

Summary by CodeRabbit

  • 새로운 기능
    • 모노맨션 QR 코드 지원 추가: 앱에서 모노맨션 브랜드의 QR 코드를 인식하고 해당 QR에서 이미지를 자동으로 추출합니다. 네트워크나 파싱 문제 발생 시 웹뷰로 안전하게 이어지는 동작을 포함합니다.

@Remaked-Swain Remaked-Swain added this to the 4차 스프린트 milestone May 5, 2026
@Remaked-Swain Remaked-Swain requested a review from OneTen19 May 5, 2026 16:42
@Remaked-Swain Remaked-Swain self-assigned this May 5, 2026
@Remaked-Swain Remaked-Swain added Feat 💻 기능 구현 금용 🐲 금용 작업 labels May 5, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

Walkthrough

모노맨션 브랜드용 QR 파싱 전략을 추가하고, 브랜드 열거형에 케이스를 추가했으며 리포지토리의 전략 목록에 새 전략을 등록했습니다. 새 전략은 HTML에서 ncloudstorage 이미지 URL을 추출해 이미지를 다운로드합니다.

Changes

모노맨션 브랜드 파싱 전략

Layer / File(s) Summary
데이터 모델
Neki-iOS/Features/QRCodeScanner/Sources/Domain/Sources/Entities/QRCodeBrand.swift
QRCodeBrand.monoMansion 케이스 추가; hostKeywords["qr.mono-mansion.com"], description"모노맨션" 매핑.
핵심 파싱 로직
Neki-iOS/Features/QRCodeScanner/Sources/Data/Sources/Strategies/Implementations/MonomansionStrategy.swift
MonomansionStrategy: QRCodeParsingStrategy 구현. 호스트 감지, URLSession을 통한 HTML 페칭, 정규식으로 ncloudstorage 이미지 URL 추출(대소문자 비감응), &amp; 디코딩, 이미지 다운로드 및 HTTP 상태 코드 검사(200..<300). 성공 시 ParsedQRResult(brand: .monoMansion, originalImage: data) 반환; 실패는 적절한 QRParseError로 매핑.
전략 등록 / 통합
Neki-iOS/Features/QRCodeScanner/Sources/Data/Sources/Repositories/DefaultQRCodeScanRepository.swift
strategies 배열에 MonomansionStrategy() 추가로 새 전략 활성화.
메타/매니페스트
Package.swift
매니페스트 변경 표시(일부 파일 변경 내역에 포함).

개요

이 PR은 모노맨션 브랜드를 위한 새로운 QR 코드 파싱 전략을 구현하며, HTML 응답에서 이미지 URL을 추출하고 ncloudstorage에서 이미지를 다운로드합니다.

변경사항

모노맨션 브랜드 지원

Layer / File(s) Summary
데이터 모델
Neki-iOS/Features/QRCodeScanner/Sources/Domain/Sources/Entities/QRCodeBrand.swift
.monoMansion 브랜드 케이스를 추가하고, hostKeywords["qr.mono-mansion.com"], description"모노맨션"을 매핑합니다.
핵심 파싱 로직
Neki-iOS/Features/QRCodeScanner/Sources/Data/Sources/Strategies/Implementations/MonomansionStrategy.swift
QRCodeParsingStrategy를 구현하여 호스트 감지, HTML 페칭, 정규식을 통한 ncloudstorage 이미지 URL 추출, 이미지 다운로드 및 HTTP 상태 코드 검증(200..<300)을 수행하고, ParsedQRResult(brand: .monoMansion, originalImage: data)를 반환하거나 여러 실패 케이스를 QRParseError로 매핑합니다.
전략 등록
Neki-iOS/Features/QRCodeScanner/Sources/Data/Sources/Repositories/DefaultQRCodeScanRepository.swift
리포지토리의 strategies 배열에 MonomansionStrategy() 인스턴스를 추가하여 새 전략을 활성화합니다.

예상 코드 리뷰 노력

🎯 3 (중간) | ⏱️ ~25분

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 변경 사항의 핵심(모노맨션 브랜드 QR 파싱 전략 추가)을 명확하고 간결하게 요약하고 있습니다.
Description check ✅ Passed PR 설명이 템플릿의 주요 섹션(작업한 브랜치, 작업한 내용, PR Point, 관련 이슈)을 모두 포함하고 있으며 완전하고 자세합니다.
Linked Issues check ✅ Passed 모든 구현 요구사항(파싱 로직 구현 및 실제 QR URL 검증)이 충족되었으며, 변경 사항들이 #233의 목표와 완벽하게 일치합니다.
Out of Scope Changes check ✅ Passed 모든 변경 사항(브랜드 추가, 호스트 키워드 등록, 전략 구현, 저장소 등록)이 #233의 모노맨션 파싱 전략 구현 범위 내에 있습니다.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#233-monomansion-parsing-strategy

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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
Copy Markdown

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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@Neki-iOS/Features/QRCodeScanner/Sources/Data/Sources/Strategies/Implementations/MonomansionStrategy.swift`:
- Around line 38-49: The regex pattern stored in pattern currently requires the
captured URL to end with ".jpg" and therefore fails when the Naver Cloud Storage
URL includes query params (e.g. ?type=w1200); update the pattern string (the
pattern variable used to build NSRegularExpression) to allow characters after
".jpg" before the closing quote (for example by appending [^"']* after \.jpg) so
the captured group includes URLs with query parameters, then keep the rest of
the extraction logic (regex, match, Range(match.range(at: 1), in: htmlString))
and still throw .fallbackToWebView(url) on failure.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 38145207-bca2-40d3-a7e6-82ba8d38687b

📥 Commits

Reviewing files that changed from the base of the PR and between 6475fd5 and af2d7f3.

📒 Files selected for processing (3)
  • Neki-iOS/Features/QRCodeScanner/Sources/Data/Sources/Repositories/DefaultQRCodeScanRepository.swift
  • Neki-iOS/Features/QRCodeScanner/Sources/Data/Sources/Strategies/Implementations/MonomansionStrategy.swift
  • Neki-iOS/Features/QRCodeScanner/Sources/Domain/Sources/Entities/QRCodeBrand.swift

Copy link
Copy Markdown

@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.

🧹 Nitpick comments (1)
Neki-iOS/Features/QRCodeScanner/Sources/Data/Sources/Strategies/Implementations/MonomansionStrategy.swift (1)

23-23: ⚖️ Poor tradeoff

networkProvider 파라미터가 사용되지 않고 URLSession.shared를 직접 호출합니다.

HTML 페치(Line 23)와 이미지 다운로드(Line 60) 모두 프로토콜 계약에 명시된 networkProvider를 무시하고 URLSession.shared를 직접 사용합니다. 이로 인해 타임아웃 설정, 공통 헤더, 인증 처리 등 NetworkProvider가 제공할 수 있는 구성을 우회하며, URLProtocol 스텁 없이는 단위 테스트가 불가능합니다.

컨텍스트 스니펫에 따르면 이는 모든 전략 구현에 걸친 시스템적인 패턴이지만, 신규 전략 추가 시점이 개선하기에 적절한 기회입니다.

♻️ 개선 방향 예시
-        (htmlData, _) = try await URLSession.shared.data(for: request)
+        (htmlData, _) = try await networkProvider.data(for: request)
-        let (data, response) = try await URLSession.shared.data(from: imageURL)
+        let (data, response) = try await networkProvider.data(from: imageURL)

단, NetworkProvider가 해당 메서드를 노출하도록 인터페이스 확장이 선행되어야 합니다.

Also applies to: 60-60

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@Neki-iOS/Features/QRCodeScanner/Sources/Data/Sources/Strategies/Implementations/MonomansionStrategy.swift`
at line 23, The MonomansionStrategy implementation ignores the injected
networkProvider by calling URLSession.shared directly for both HTML fetch (the
line with (htmlData, _) = try await URLSession.shared.data(for: request)) and
image download, which bypasses timeouts, headers, auth and breaks testability;
update MonomansionStrategy to use the injected networkProvider API instead of
URLSession.shared (extend the NetworkProvider protocol first if needed to expose
an async data(for: URLRequest) -> (Data, URLResponse) method or an equivalent
download API), then replace calls in the HTML-fetching code path and the image
download path to invoke networkProvider.data(for: request) so all requests go
through the configurable provider.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@Neki-iOS/Features/QRCodeScanner/Sources/Data/Sources/Strategies/Implementations/MonomansionStrategy.swift`:
- Line 23: The MonomansionStrategy implementation ignores the injected
networkProvider by calling URLSession.shared directly for both HTML fetch (the
line with (htmlData, _) = try await URLSession.shared.data(for: request)) and
image download, which bypasses timeouts, headers, auth and breaks testability;
update MonomansionStrategy to use the injected networkProvider API instead of
URLSession.shared (extend the NetworkProvider protocol first if needed to expose
an async data(for: URLRequest) -> (Data, URLResponse) method or an equivalent
download API), then replace calls in the HTML-fetching code path and the image
download path to invoke networkProvider.data(for: request) so all requests go
through the configurable provider.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0015c6f6-02c8-4cce-addc-09f1473d9b47

📥 Commits

Reviewing files that changed from the base of the PR and between af2d7f3 and 7950096.

📒 Files selected for processing (1)
  • Neki-iOS/Features/QRCodeScanner/Sources/Data/Sources/Strategies/Implementations/MonomansionStrategy.swift

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feat 💻 기능 구현 금용 🐲 금용 작업

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 모노맨션 브랜드 파싱 전략 구현

1 participant