Uh oh!
There was an error while loading. Please reload this page.
Clear two Linux build warnings (#433) - #442
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## v1.0.0-beta.4 #442 +/- ##
=================================================
+ Coverage 81.50% 81.64% +0.14%
=================================================
Files 191 192 +1 Lines 4719 4723 +4 =================================================
+ Hits 3846 3856 +10 + Misses 873 867 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
9483741 to
4cfa8d4CompareFixes the two warnings surfaced by the Swift 6.4 Linux lane: 1. `URLRequest+AssetUpload.swift` declared `public import FoundationNetworking` but its only declaration is an `internal init`. Downgraded to `internal import` per the package's import convention. 2. `CloudKitError.networkErrorDescription` read the deprecated `URLError.failureURLString`. Replaced with `failingURL?.absoluteString` plus a fallback that reads the distinct legacy userInfo key directly, so errors carrying only the string key still report their failed URL. The network-error description moves to a new `CloudKitError+NetworkErrorDescription.swift`, mirroring the existing `CloudKitError+ZoneErrorDescription.swift` split, to stay under the 225-line file-length limit. Adds four tests covering both userInfo keys, their precedence, and neither being present. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xs1c8vvxjCxqZiStcmuPS2
4cfa8d4 to
35a7504CompareUh oh!
There was an error while loading. Please reload this page.
Clears the two Linux build warnings from #433 (Parts 1 and 2). Part 3 (the
openapi.yamlwording) is owned by another lane, so this isPart of #433, not a close.1. Unused
public import FoundationNetworkingSources/MistKit/Models/AssetUploading/URLRequest+AssetUpload.swift:33→internal import(not bareimport— the package enablesInternalImportsByDefaultbut the convention is an explicit modifier on every import).I verified the other three
public import FoundationNetworkingsites are genuinely justified and left them alone:URLSession+AssetUpload.swiftpublic func upload(_:to:)URLSession+CourierPoll.swiftpublic var courierTransport,public func pollCourier(_:timeout:)WebCourierPoller.swiftpublic struct WebCourierPoller,public static var ephemeralConfiguration: URLSessionConfiguration2.
failureURLString→failingURL, and the userInfo-key subtletyfailureURLStringreadsNSErrorFailingURLStringKeyand returnsString?;failingURLreads the distinctNSErrorFailingURLKeyand returnsURL?. A straight rename silently drops the failed URL from the description for any error carrying only the string key.Decision: prefer the typed
URL, fall back to the string key.This is not a hypothetical gap — the "string key only" test fails without the fallback on both macOS and Linux, because neither Foundation's
failingURLnor corelibs' consults the string key.Why the key is spelled as a literal. My first attempt read the fallback via the named constant
NSURLErrorFailingURLStringErrorKey. The Linux build showed that constant is itself deprecated on swift-corelibs-foundation:so naming it merely relocated the warning rather than clearing it. The fallback therefore uses a documented private constant holding the key's raw value:
I verified that raw value is identical on Darwin Foundation and on corelibs-foundation (
swift:6.3-noble) by printing both constants on each platform. It is a frozenNSErroruserInfo key, so hard-coding it is safe; the alternative — dropping the fallback — would be a silent behavior regression.File split. Adding the helper pushed
CloudKitError+ErrorDescription.swiftto 228 lines, over SwiftLint's 225-linefile_lengthlimit.networkErrorDescriptionand its helper move to a newCloudKitError+NetworkErrorDescription.swift, mirroring the existingCloudKitError+ZoneErrorDescription.swift, which was split out of the same file for the same reason.Test coverage
There was previously no test for the
.networkErrordescription path. Four tests added toTests/MistKitTests/CloudKitService/CloudKitErrorTests.swift, matching its existing style (@Suite/@Test/#expect/try #require,internalACL,@testable import MistKit); the suite stays astructsince it remains a single file:absoluteStringreportedFailed URL:line at allNothing in the repo constructed
URLError(_:userInfo:)before, so this establishes that pattern. The tests use the same hard-coded key literal rather than the deprecated constant — which both avoids re-introducing the warning in the test target and keeps the test independent of the production constant it exercises.Verification
macOS —
swift buildclean,swift test622 tests in 195 suites passed.Linux (
swift:6.3-noblein Docker) — I was able to verify this, and it changed the implementation (see the relocated-warning finding above). Before/after on the same image, filtering to warnings in package sources:Before (base
v1.0.0-beta.4@ 61235b5):After: no output — zero warnings.
swift teston Linux also passes 622 tests in 195 suites.LINT_MODE=STRICT ./Scripts/lint.sh— exits 1 with 28 violations, but this is exactly the pre-existing state of the base commit: I ran it on a clean tree at the merge base and on this branch under the same pinned toolchain and diffed the violation lists — identical, zero new or moved violations. (Note: the run must happen aftermise trust; an untrustedmise.tomlmakeslint.sh'seval "$(mise env)"no-op and fall back to unpinned system tools, which produces ~54 spurious violations and rewrites unrelated files.)Part of #433.
🤖 Generated with Claude Code