RustToMetal opened a new pull request, #4190:
URL: https://github.com/apache/iggy/pull/4190
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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]