Skip to content

chore(ci): swift-format lint gate, pinned Linux Swift, visionOS platform - #1340

Open
grdsdev wants to merge 4 commits into
mainfrom
guilhermesouza/sdk-1802-toolchain-and-ci-hygiene-swift-format-lint-gate-pinned-linux
Open

grdsdev wants to merge 4 commits into
mainfrom
guilhermesouza/sdk-1802-toolchain-and-ci-hygiene-swift-format-lint-gate-pinned-linux

Conversation

@grdsdev

@grdsdev grdsdev commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace the PR-only "reformat changed files and diff" format-check job with swift format lint --strict --recursive over Sources, Tests, Package.swift, and Examples (runs on every push/PR now).
  • Pin .swift-format/Tests/.swift-format lineLength/indentation explicitly, and fix the ~30 pre-existing lint violations (renames, forEach→for-loop, one dead force-try init in Examples) that would've broken the new gate immediately.
  • Pin the Linux CI job to a swift:6.2-noble / swift:6.3-noble matrix (SSWG's "two latest Swift.org releases") plus swift:nightly allowed to fail, instead of unpinned ubuntu-latest; add --explicit-target-dependency-import-check error to that build.
  • Add a build-only xcodebuild CI job for watchOS/tvOS/visionOS simulators, mirroring Swift Package Index.
  • Declare .visionOS(.v1) in Package.swift, matching the visionOS 1+ claim already in README.md/AGENTS.md.

Out of scope (see discussion): turning on NeverForceUnwrap/AllPublicDeclarationsHaveDocumentation/UseEarlyExits (~437 more violations, a much bigger change), and the optional Package@swift-6.1.swift shim (only needed if the manifest moves to Swift 6.2).

Test plan

  • swift build — exit 0
  • swift test --skip IntegrationTests — 1294 tests, 132 suites, all passed (1 known issue, pre-existing)
  • swift test --traits OpenTelemetry --filter SupabaseTests — 29 tests passed
  • xcrun swift-format lint --strict --recursive Sources Tests Package.swift Examples — clean
  • ./scripts/spell-check.sh — 0 issues

Fixes SDK-1802

…I gate

swift format lint --strict flags real issues the formatter alone never
touches: forEach where a for-loop reads better, SCREAMING_SNAKE_CASE
constants, static properties that repeat their type name, and Storage's
Key/Id fields decoded straight from wire casing. Fixing these now keeps
the next commit (which turns the lint gate on) from failing on day one.

Also drops an unused, force-try'ing JSONValueView(rendering:) initializer
in the Examples app that nothing calls.
* Pin lineLength/indentation explicitly in .swift-format and
  Tests/.swift-format so a future swift-format default change can't
  silently shift what CI accepts.
* Replace the PR-only "reformat changed files and diff" format-check
  job with `swift format lint --strict --recursive` over Sources,
  Tests, Package.swift, and Examples, on every push and PR.
* Pin the Linux job to swift:6.2-noble and swift:6.3-noble containers
  (the two latest Swift.org releases, matching SSWG graduation
  criteria) plus swift:nightly as an allowed-to-fail leg, instead of
  whatever Swift ubuntu-latest happens to ship. Also adds
  --explicit-target-dependency-import-check error to that build.
* Add an xcodebuild (build-only) job for watchOS, tvOS and visionOS
  simulators, mirroring what Swift Package Index already builds.
* Declare .visionOS(.v1) in Package.swift's platforms, matching the
  visionOS 1+ claim already in README.md/AGENTS.md.

Skipped the optional Package@swift-6.1.swift shim from the ticket: it's
only needed if the main manifest moves to Swift 6.2 for
.defaultIsolation/strictMemorySafety, which isn't happening here.

Refs SDK-1802
@grdsdev
grdsdev requested a review from a team as a code owner September 14, 2026 20:45
@github-actions github-actions Bot added the ci/cd label Sep 14, 2026
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: cc0c39a5-b99b-45b6-a437-64b1192dc1d0

📥 Commits

Reviewing files that changed from the base of the PR and between fb09342 and 11e1a6f.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Summary

Summary by CodeRabbit

  • New Features

    • Added support for visionOS 1.
    • Expanded platform validation to include watchOS, tvOS, and visionOS.
    • Added testing across multiple Swift releases, including nightly builds.
  • Quality Improvements

    • Formatting checks now cover the complete source, test, package, and example codebase.
    • Standardized formatting rules with a 100-character line limit and two-space indentation.
    • Improved validation coverage for platform compatibility and continuous integration.

Walkthrough

The pull request expands CI to cover watchOS, tvOS, visionOS, and multiple Swift Linux containers. It applies shared Swift formatting rules and lints the full project tree. The package declares visionOS support. Source code receives naming, loop, documentation, and decoding updates. Tests update authentication fixtures, integration-test environment properties, and a Realtime polling helper. The removed JSONValueView initializer no longer accepts arbitrary Codable values.

Priority: ⬇️ Low

Change: Other

Merge Risk: ⚪ Minimal · up to 11e1a

The changes expand validation and preserve the inspected runtime and test contracts, with no evidenced merge-blocking risk.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Potential Breaking API Changes Detected

This PR appears to contain breaking API changes. Please review the changes below:

API Check Output

If this is intentional, please update your PR title or commit message to include:

  • ! after the type (e.g., feat!: remove deprecated method)
  • Or include BREAKING CHANGE: in the commit body

If this is a false positive, you can safely ignore this warning.

There's no swift:nightly tag on the stable swift image — Docker Hub's
official swift repo has zero "nightly*" tags. Nightly builds are only
published under swiftlang/swift (e.g. nightly-main-noble), confirmed
by the first CI run on this branch failing the docker pull.
@coveralls

coveralls commented Sep 14, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 34896363151

Warning

No base build found for commit db9ae1f on main.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 88.324%

Details

  • Patch coverage: 2 uncovered changes across 2 files (25 of 27 lines covered, 92.59%).

Uncovered Changes

File Changed Covered %
Sources/Auth/AuthClient.swift 1 0 0.0%
Sources/Auth/Internal/FixedWidthInteger+Random.swift 2 1 50.0%
Total (5 files) 27 25 92.59%

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 11759
Covered Lines: 10386
Line Coverage: 88.32%
Coverage Strength: 104.2 hits per line

💛 - Coveralls

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Capability matrix drift detected

The following capabilities are marked implemented in the matrix but could not be found in swift:

  • client.session_management.persist_session → expected symbol: AuthLocalStorage.defaultLocalStorage
  • functions.invocation.streaming_response → expected symbol: FunctionsClient._invokeWithStreamedResponse

The following capabilities are marked implemented in swift but have no registered symbols to verify:

  • auth.passkey.register_passkey (no symbols list — cannot confirm implementation exists)
  • auth.passkey.sign_in_with_passkey (no symbols list — cannot confirm implementation exists)
  • client.observability.trace_propagation (no symbols list — cannot confirm implementation exists)
  • database.using_modifiers.request_cancellation (no symbols list — cannot confirm implementation exists)
  • functions.invocation.request_cancellation (no symbols list — cannot confirm implementation exists)
  • storage.file_buckets.url_cache_nonce (no symbols list — cannot confirm implementation exists)
  • storage.file_buckets.request_cancellation (no symbols list — cannot confirm implementation exists)

These may have been renamed, removed, or never registered. Please update the capability matrix.
See: https://github.com/supabase/sdk/blob/main/packages/capability-matrix/docs/capability-matrix.md

The official swift Docker images run as root, so the .build/Package.swift
files the container writes into the bind-mounted workspace end up
root-owned. actions/cache's post-step re-evaluates hashFiles() from the
runner's own (non-root) context to save the cache, and that's exactly
where the two pinned Linux legs failed just now:

  The template is not valid. .github/workflows/ci.yml (Line: 189, Col: 16):
  hashFiles('**/Package.resolved') failed. Fail to hash files under
  directory '/home/runner/work/supabase-swift/supabase-swift'

Keying on the container name alone avoids the hashFiles() call entirely.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants