Skip to content

feat(swift): scaffold the Swift SDK package and CI lanes - #4190

Open
RustToMetal wants to merge 2 commits into
apache:masterfrom
RustToMetal:swift/01-scaffold
Open

RustToMetal wants to merge 2 commits into
apache:masterfrom
RustToMetal:swift/01-scaffold

Conversation

@RustToMetal

Copy link
Copy Markdown

Starts the native Swift client for the VSR wire protocol with the smallest slice that exercises the toolchain end to end: the SwiftPM package, the error table generated from the server's codes, the little-endian byte codec every request is written with, and a 128-bit value type for message ids on platforms that predate UInt128.

The CI wiring lands here so the lint, test, and build lanes are proven before the protocol layer, the client, and the producer and consumer follow in later changes.

First of nine stacked PRs for the Swift SDK; the others build on this one.

Which issue does this PR address?

Relates to #4001

Rationale

Iggy has no first-class Swift client, and reviewing the whole SDK in one PR is not workable. This lays the foundation the rest of the chain builds on and proves the CI lanes with as little code as possible.

What changed?

Swift code had nowhere to live in the repository and no CI to run under. This adds foreign/swift as a SwiftPM package (Swift 6 language mode, macOS 13, iOS 16, tvOS 16, watchOS 9, visionOS 1, and Linux), the IggyError and IggyErrorCode types covering every server error code, the ByteWriter and ByteReader the wire format is encoded with, and UInt128Value for message ids.

The Swift lanes are wired into components.yml, _detect.yml, _test.yml, and pre-merge.yml through a swift/pre-merge composite action (format lint, build with warnings as errors, unit tests, release build) and a setup-swift utility action. licenserc.toml learns the .swift extension.

Local Execution

  • Passed: swift build -Xswiftc -warnings-as-errors, swift test (7 tests), swift format lint --strict, YAML parsed for every touched workflow, markdownlint on the README
  • Pre-commit hooks not ran (prek is not installed on this machine; the equivalent shellcheck, markdownlint, license-header, and whitespace checks were run by hand)

AI Usage

  1. Which tools? Claude Code (Claude).
  2. Scope of usage? The implementation and tests were drafted with it from the Rust SDK and core/binary_protocol as the reference, reviewed and directed by me.
  3. How did you verify the generated code works correctly? The error table and codec are checked against golden vectors generated from the Rust crates (the vectors land in the next PR of the chain, this one carries the codec tests). The full chain was run end to end against a real iggy-server, plain and over TLS, plus the examples runner and the BDD suite on macOS and Linux.
  4. Can you explain every line of the code if asked? Yes.

RustToMetal and others added 2 commits September 15, 2026 01:03
Starts the native Swift client for the VSR wire protocol with the smallest
slice that exercises the toolchain end to end: the SwiftPM package, the
error table generated from the server's codes, the little-endian byte
codec every request is written with, and a 128-bit value type for message
ids on platforms that predate UInt128.

The CI wiring lands here so the lint, test, and build lanes are proven
before the protocol layer, the client, and the producer and consumer
follow in later changes.

Relates to apache#4001
@github-actions

Copy link
Copy Markdown

Thanks for the PR. It is labeled S-waiting-on-review and queued for review.

Slash commands (own line, regular comment) move it around the queue:

  • /ready - back to S-waiting-on-review after addressing feedback
  • /author - flip to S-waiting-on-author while you finish changes
  • /request-review @user-or-team - request a reviewer
  • /pin - exempt the PR from the stale bot, /unpin to undo

See CONTRIBUTING.md for details.

@codecov

codecov Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.42%. Comparing base (9061596) to head (9ab3534).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4190      +/-   ##
============================================
- Coverage     87.42%   87.42%   -0.01%     
  Complexity     1575     1575              
============================================
  Files          1280     1280              
  Lines        222704   222704              
  Branches     186067   186067              
============================================
- Hits         194706   194691      -15     
+ Misses        23287    23268      -19     
- Partials       4711     4745      +34     
Components Coverage Δ
Rust Core 88.48% <ø> (-0.01%) ⬇️
Java SDK 68.68% <ø> (ø)
C# SDK 77.41% <ø> (-0.02%) ⬇️
Python SDK 90.97% <ø> (ø)
PHP SDK 85.67% <ø> (ø)
Node SDK 96.43% <ø> (ø)
Go SDK 70.08% <ø> (ø)
see 44 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.

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

Labels

S-waiting-on-review PR is waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant