Repository navigation
feat: Add a Swift harness - #5
Conversation
|
@themis-blindfold review |
⚖️ Themis review: 🟠 Fix before mergeTL;DR: The Swift harness can fail to build for a normally documented step because its generator mistakes
🟠 Majors
📝 Walkthrough
🧪 How to verify
Product take: This unlocks behavioural-spec coverage for the iOS SDK, a solid integration improvement. 🧭 Assumptions & unverified claimsThe Swift and Docker toolchains were unavailable locally, so the package build and end-to-end image run were not repeated; the spec checks remain queued. One small parser snag before Swift gets to do its swift thing · reviewed at 0df6726 |
2ce3603 to
2e3ef98
Compare
|
@themis-blindfold review |
⚖️ Themis review: 🟠 Fix before mergeThe completed Swift compatibility run passes the current SDK scenarios, but an open generator defect still makes a documented Swift step bind to a comment rather than its declaration. The harness is also missing from the language index.
🟠 Majors
🧹 Nits
📝 Walkthrough
🧪 How to verify
Product take: This is a solid onboarding improvement for the iOS SDK, but the parser defect can block SDK builds as soon as step functions are documented. 🧭 Assumptions & unverified claimsNo unverified assumptions or claims. Swift has joined the harness club; it just needs the guest list and comment parser checked. · reviewed at 2e3ef98 |
2e3ef98 to
76ec56d
Compare
2b4af93 to
d81bcc6
Compare
|
@themis-blindfold review |
Adds a Swift harness, so Swift SDKs can run the spec. First user: Flagsmith/flagsmith-ios-client#109.
harness/swift/: Swift cannot call a function by name at runtime, so, like the Go and Rust harnesses, the harness compiles the steps file in. A build tool plugin,GenerateSteps, runsStepsGeneratoron the SDK'ssdk-spec/steps.swiftand generates a table mapping each step marker (Create the SDK clientorWhen …) to the first function after it. The harness speaks the stdio protocol and decodes each JSON argument to the function's parameter type, inferred throughstepoverloads by arity, so step functions can take and return anyDecodable/Encodabletypes, and can beasyncandthrow.sdk-spec/Package.swift, which makes the steps file anSDKSpecStepslibrary depending on the SDK by path (as with the Rust harness'sCargo.toml). The README shows it and thesdk-spec/Dockerfile.dispatchMain(), because SDKs such as flagsmith-ios-client call back on the main queue.compatibility.yml: adds flagsmith-ios-client (ios, languageswift).Verified against flagsmith-ios-client
feat/sdk-spec: 2 passed natively on macOS, and with thelinux/amd64image built asrun-spec.ymldoes.