Skip to content

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

Open
Remaked-Swain wants to merge 3 commits into
developfrom
feat/#233-monomansion-parsing-strategy
Open

[Feat] #233 - 모노맨션 브랜드 QR 파싱 전략 추가#234
Remaked-Swain wants to merge 3 commits into
developfrom
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을 인식하고 이미지 추출을 시도합니다. 실패 시 안전하게 웹뷰로 이어집니다.
    • photosignature 뷰어용 URL 처리 추가: 특정 뷰어 링크에서 세션 ID를 추출해 CDN 이미지를 직접 가져옵니다.
  • 버그 수정
    • photosignature 관련 파싱 실패 시 더 안정적인 폴백 동작 적용.

Review Change Stack

@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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 08fcd19c-1526-4ee6-bf22-353cf714c571

📥 Commits

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

📒 Files selected for processing (2)
  • Neki-iOS/Features/QRCodeScanner/Sources/Data/Sources/Strategies/Implementations/PhotosignatureStrategy.swift
  • Neki-iOS/Features/QRCodeScanner/Sources/Domain/Sources/Entities/QRCodeBrand.swift
🚧 Files skipped from review as they are similar to previous changes (1)
  • Neki-iOS/Features/QRCodeScanner/Sources/Domain/Sources/Entities/QRCodeBrand.swift

Walkthrough

모노맨션 브랜드용 QR 파싱 전략을 구현하고 QRCodeBrand에 케이스를 추가했으며, 리포지토리 전략 목록에 MonomansionStrategy()를 등록했습니다. 새 전략은 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() 추가로 새 전략 활성화.
Photosignature 뷰어 URL 처리
Neki-iOS/Features/QRCodeScanner/Sources/Data/Sources/Strategies/Implementations/PhotosignatureStrategy.swift
photosignature-viewer.web.app 호스트 전용 파싱 경로 추가; fragment 또는 /view/<sessionID>에서 sessionID 추출, CDN .../sessions/<sessionID>/final.jpg 생성 및 이미지 다운로드/검증 로직 추가.
sequenceDiagram
  participant App
  participant MonomansionStrategy
  participant OriginWebsite
  participant NCloudStorage
  App->>MonomansionStrategy: parse(URL)
  MonomansionStrategy->>OriginWebsite: GET HTML
  OriginWebsite-->>MonomansionStrategy: HTML with href to ncloudstorage
  MonomansionStrategy->>NCloudStorage: GET image (decoded URL)
  NCloudStorage-->>MonomansionStrategy: 2xx + image bytes
  MonomansionStrategy-->>App: ParsedQRResult(brand: .monoMansion, originalImage)
Loading

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 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 Pull request title clearly describes the main change: adding a MonoMansion brand QR parsing strategy, which matches the primary objective of the changeset.
Description check ✅ Passed Pull request description follows the template structure with all required sections filled: branch, work details, PR points, and linked issues. Work details comprehensively cover the implementation of the MonoMansion brand parsing strategy.
Linked Issues check ✅ Passed The pull request fully implements the objectives from issue #233: the MonoMansion brand parsing strategy has been implemented [#233], with QR-URL based parsing logic completed and verified through actual QR scanning.
Out of Scope Changes check ✅ Passed All code changes are within scope of issue #233. The PhotoSignatureStrategy extension for handling viewer-specific URLs is a necessary supporting change for the overall QR parsing strategy consistency.

✏️ 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