Skip to content

fix(build): compile with Swift 6.2 (CI/release toolchain) - #38

Merged
hanrw merged 1 commit into
mainfrom
fix/swift-6.2-build
Oct 11, 2026
Merged

hanrw merged 1 commit into
mainfrom
fix/swift-6.2-build

Conversation

@hanrw

@hanrw hanrw commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

Why

main has failed Build & Test on CI since #32, so every open PR (#33–#37) fails too. CI and the release workflow build with Swift 6.2.4. Swift 6.2 can't infer .init(rawValue:) inside value.flatMap { .init(…) }.map { [$0] }; Swift 6.4, used locally, can. A release cut from main would fail the same way.

What changed

The eight filter parameters in the asset-library image, video and placement adapters now go through a generic sdkFilter(_:). Its SDK type comes from the parameter being filled. Behaviour is unchanged.

How it was verified

  • Red: the main CI run on Swift 6.2.4 failed with member 'init(rawValue:)' … produces result of type …, but context expects …?.
  • Green: this PR's CI, on the same Swift 6.2.4.
  • Locally on Swift 6.4, swift test passes, including the tests that pin each filter's exact query string.

Checklist

  • A failing test came first; swift test passes (the failing build on CI's toolchain)
  • A command that returns data is also served by asc web-server (n/a)
  • User-visible change: one line under ## [Unreleased] in CHANGELOG.md (n/a: fixes an unreleased build break)
  • make docs && make check-docs passes
  • No API key, .p8, issuer ID or Apple ID session in the diff, output or screenshots

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved filtering for asset library images, videos, and placements. Optional filters are applied consistently, while unavailable or unspecified values are left out of requests.

CI and release builds use Swift 6.2.4, which can't infer `.init(rawValue:)`
inside `value.flatMap { .init(…) }.map { [$0] }` (Swift 6.4 can), so main
has failed to build on CI since #32. Route the eight filter parameters
through a generic `sdkFilter(_:)` whose SDK type comes from the parameter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2d9e8dbc-4469-44cc-97ee-46f634ab5618

📥 Commits

Reviewing files that changed from the base of the PR and between 6fb5ffb and 8948d70.


📒 Files selected for processing (4)
  • Sources/Infrastructure/Apps/AssetLibrary/Images/SDKLibraryImageRepository.swift
  • Sources/Infrastructure/Apps/AssetLibrary/Placements/SDKAssetPlacementRepository.swift
  • Sources/Infrastructure/Apps/AssetLibrary/Videos/SDKLibraryVideoRepository.swift
  • Sources/Infrastructure/Shared/SDKFilter.swift

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.



📝 Walkthrough

Walkthrough

A shared sdkFilter helper converts optional string-backed values into SDK filter arrays. Image, video, and placement repositories use it to build filters.

Changes

SDK filter mapping

Layer / File(s) Summary
Add SDK filter conversion
Sources/Infrastructure/Shared/SDKFilter.swift
The new sdkFilter helper returns a one-element array for a matching SDK value. It returns nil when the input is absent or conversion fails.
Apply helper to asset library requests
Sources/Infrastructure/Apps/AssetLibrary/Images/SDKLibraryImageRepository.swift, Sources/Infrastructure/Apps/AssetLibrary/Videos/SDKLibraryVideoRepository.swift, Sources/Infrastructure/Apps/AssetLibrary/Placements/SDKAssetPlacementRepository.swift
Image and video requests use the helper for category and state filters. Four placement request surfaces use it for placement-type filters.

Priority: ⬆️ High

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix


Merge Risk: ⚪ Minimal · up to 8948d

The filter requests retain their prior behavior, and no user-facing regression is established. The change presents minimal merge risk.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: restoring compatibility with the Swift 6.2 CI and release toolchain.
Description check Passed The description includes all required sections, explains the Swift 6.2.4 build failure, summarizes the fix, documents verification, and completes the checklist.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR


🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@codecov

codecov Bot commented Oct 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.36%. Comparing base (79d213a) to head (8948d70).
⚠️ Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
...brary/Placements/SDKAssetPlacementRepository.swift 50.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #38      +/-   ##
==========================================
+ Coverage   82.04%   82.36%   +0.31%     
==========================================
  Files         492      518      +26     
  Lines       14362    15649    +1287     
==========================================
+ Hits        11784    12889    +1105     
- Misses       2578     2760     +182     
Files with missing lines Coverage Δ
...ssetLibrary/Images/SDKLibraryImageRepository.swift 97.50% <100.00%> (ø)
...ssetLibrary/Videos/SDKLibraryVideoRepository.swift 98.66% <100.00%> (ø)
Sources/Infrastructure/Shared/SDKFilter.swift 100.00% <100.00%> (ø)
...brary/Placements/SDKAssetPlacementRepository.swift 91.53% <50.00%> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hanrw
hanrw merged commit e645469 into main Oct 11, 2026
5 checks passed
@hanrw
hanrw deleted the fix/swift-6.2-build branch October 11, 2026 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant