Skip to content

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

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

RustToMetal wants to merge 3 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.

@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.49%. Comparing base (13a0d91) to head (427bdba).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4190      +/-   ##
============================================
- Coverage     87.49%   87.49%   -0.01%     
- Complexity     1575     1576       +1     
============================================
  Files          1280     1280              
  Lines        223241   223241              
  Branches     186606   186605       -1     
============================================
- Hits         195335   195315      -20     
+ Misses        23196    23184      -12     
- Partials       4710     4742      +32     
Components Coverage Δ
Rust Core 88.57% <ø> (-0.01%) ⬇️
Java SDK 68.70% <ø> (+0.01%) ⬆️
C# SDK 77.42% <ø> (-0.04%) ⬇️
Python SDK 90.97% <ø> (ø)
PHP SDK 85.67% <ø> (ø)
Node SDK 96.36% <ø> (-0.07%) ⬇️
Go SDK 70.11% <ø> (-0.06%) ⬇️
see 53 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.

@justinmclean

Copy link
Copy Markdown
Member

Thanks for splitting this into smaller pieces. Before review, CI needs to go green. foreign/swift/Package.swift is missing the licence header, and examples/swift/.build/ looks like build output that shouldn't be committed. The PR Title failure isn't yours: swift isn't an allowed scope yet, and I've raised a separate PR to add it.

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
@RustToMetal

Copy link
Copy Markdown
Author

Thanks @justinmclean for the update. I've fixed the issues.

@numinnex

Copy link
Copy Markdown
Contributor

PR Title is the only red check here. The Swift lanes themselves are green (lint, test, build all pass).

The scope gate rejects swift:

Unknown scope "swift" found in pull request title "feat(swift): scaffold the Swift SDK package and CI lanes". Scope must match one of: bdd, bench, ci, cli, ...

Adding swift to scopes: in .github/workflows/pr-title.yml clears it, and matches what every other SDK already has there (cpp, csharp, go, java, node, php, python). gateways was added to that list by the commit that introduced it.

Worth folding into this PR, since the rest of the stack hits the same gate.

@hubcio

hubcio commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

@numinnex it was added by @justinmclean in #4207, this PR just needs rebase.

@hubcio

hubcio commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

lets wait with merge till we release 0.9.0 (tomorrow evening CET) - i'm not sure how it would impact our CI machinery.

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.

4 participants