Skip to content

Migrate workflow to SyntaxKit structure (#9)#10

Merged
leogdion merged 1 commit intomainfrom
v1.0.0-alpha.2
Apr 10, 2026
Merged

Migrate workflow to SyntaxKit structure (#9)#10
leogdion merged 1 commit intomainfrom
v1.0.0-alpha.2

Conversation

@leogdion
Copy link
Copy Markdown
Member

@leogdion leogdion commented Apr 10, 2026

Summary by CodeRabbit

  • Chores

    • Updated Swift toolchain support from 6.2 to 6.3 in development containers.
    • Updated development dependencies and GitHub Actions workflow for improved platform support.
    • Updated SundialKit dependency to version 2.0.0-alpha.2.
    • Updated copyright year across the codebase.
  • Refactor

    • Restructured async stream handling and network observation implementation for improved stability and maintainability.
    • Added conditional compilation support for platform-specific features.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 164e1433-8fc0-4ffd-b5e9-6ab5f27dad11

📥 Commits

Reviewing files that changed from the base of the PR and between 1837720 and c8ce22f.

📒 Files selected for processing (41)
  • .devcontainer/devcontainer.json
  • .devcontainer/swift-6.1/devcontainer.json
  • .devcontainer/swift-6.2-nightly/devcontainer.json
  • .devcontainer/swift-6.2/devcontainer.json
  • .devcontainer/swift-6.3/devcontainer.json
  • .github/workflows/SundialKitStream.yml
  • .swift-format
  • .swiftlint.yml
  • Package.resolved
  • Package.swift
  • Sources/SundialKitStream/AsyncStream+Continuation.swift
  • Sources/SundialKitStream/ConnectivityObserver+Lifecycle.swift
  • Sources/SundialKitStream/ConnectivityObserver+Messaging.swift
  • Sources/SundialKitStream/ConnectivityObserver+Streams.swift
  • Sources/SundialKitStream/ConnectivityObserver.swift
  • Sources/SundialKitStream/ConnectivityState.swift
  • Sources/SundialKitStream/ConnectivityStateManager+Updates.swift
  • Sources/SundialKitStream/ConnectivityStateManager.swift
  • Sources/SundialKitStream/MessageDispatcher.swift
  • Sources/SundialKitStream/MessageDistributor.swift
  • Sources/SundialKitStream/MessageHandling.swift
  • Sources/SundialKitStream/MessageRouter.swift
  • Sources/SundialKitStream/NetworkObserver+Handlers.swift
  • Sources/SundialKitStream/NetworkObserver+Init.swift
  • Sources/SundialKitStream/NetworkObserver.swift
  • Sources/SundialKitStream/StateHandling+MessageHandling.swift
  • Sources/SundialKitStream/StateHandling.swift
  • Sources/SundialKitStream/StreamContinuationManager+Messages.swift
  • Sources/SundialKitStream/StreamContinuationManager+State.swift
  • Sources/SundialKitStream/StreamContinuationManager.swift
  • Sources/SundialKitStream/StreamContinuationRegistry.swift
  • Sources/SundialKitStream/SundialLogger+Fallback.swift
  • Sources/SundialKitStream/SundialLogger.swift
  • Tests/SundialKitStreamTests/MockNetworkPing.swift
  • Tests/SundialKitStreamTests/MockPath.swift
  • Tests/SundialKitStreamTests/MockPathMonitor.swift
  • Tests/SundialKitStreamTests/NetworkObserverTests+EdgeCases.swift
  • Tests/SundialKitStreamTests/NetworkObserverTests+Initialization.swift
  • Tests/SundialKitStreamTests/NetworkObserverTests+Stream.swift
  • Tests/SundialKitStreamTests/NetworkObserverTests.swift
  • Tests/SundialKitStreamTests/SupportedModule.swift

📝 Walkthrough

Walkthrough

The PR updates Swift development infrastructure, refactors NetworkObserver to use conditional compilation and direct continuation management for AsyncStream types, adds fallback logging for non-Apple platforms, upgrades dependencies and workflow CI/CD, and synchronizes copyright years to 2026 across source files.

Changes

Cohort / File(s) Summary
Development Container Configuration
.devcontainer/devcontainer.json, .devcontainer/swift-6.1/devcontainer.json, .devcontainer/swift-6.2/devcontainer.json, .devcontainer/swift-6.3/devcontainer.json, .devcontainer/swift-6.2-nightly/devcontainer.json
Updated Swift toolchain versions (6.2→6.3, removed nightly variant) and replaced VS Code extension from sswg.swift-lang to swift-server.swift; removed entire nightly 6.2 configuration.
GitHub Actions Workflow
.github/workflows/SundialKitStream.yml
Introduced dynamic build matrix via new configure job with full/partial variants, added concurrency control, gated macOS/Windows/Android jobs on matrix conditions, updated action versions (checkout→v6, swift-build→v1, coverage→v5, Codecov→v6), and improved coverage/Codecov step gating.
Linting & Formatting Configuration
.swift-format, .swiftlint.yml
Disabled file-scoped declaration privacy in SwiftFormat; enabled one_declaration_per_file rule and removed Sources/MistKit/Generated exclusion in SwiftLint.
Package Management
Package.swift, Package.resolved
Upgraded SundialKit dependency from 2.0.0-alpha.1 to 2.0.0-alpha.2 with updated revision hash.
Copyright Year Updates
Sources/SundialKitStream/*.swift (17 files)
Updated all source file headers from copyright year 2025 to 2026; no functional changes.
NetworkObserver Core Refactoring
Sources/SundialKitStream/NetworkObserver.swift, Sources/SundialKitStream/NetworkObserver+Init.swift
Wrapped public API in #if canImport(Network) conditional; refactored stream properties to directly manage AsyncStream continuations instead of using Task-based iteration; changed internal properties from private to internal; expanded cancel() to finish all continuation types; reworked start(queue:) to conditionally compile under #if canImport(Dispatch).
NetworkObserver Handler Extension
Sources/SundialKitStream/NetworkObserver+Handlers.swift
Added new internal extension with handlePathUpdate and handlePingStatusUpdate methods that update cached state and yield to all active continuations for paths, path status, expense/constraint flags, and ping status.
SundialLogger Refactoring
Sources/SundialKitStream/SundialLogger.swift, Sources/SundialKitStream/SundialLogger+Fallback.swift
Removed inline fallback implementation from main file; created dedicated fallback file with FallbackLogger struct for platforms lacking os.log, including predefined instances (core, network, connectivity, stream, combine, binary, messagable, test) and factory function.
Test Mock Utilities
Tests/SundialKitStreamTests/MockPath.swift, Tests/SundialKitStreamTests/MockNetworkPing.swift, Tests/SundialKitStreamTests/MockPathMonitor.swift
Wrapped all mock definitions in conditional compilation (#if canImport(Network) and/or #if canImport(Dispatch)), making mocks available only on platforms supporting these modules.
Test Suite Conditional Compilation
Tests/SundialKitStreamTests/NetworkObserverTests.swift, Tests/SundialKitStreamTests/NetworkObserverTests+*.swift (3 files)
Wrapped test imports and test suite definitions in #if canImport(Network) conditionals; updated main test suite to use .enabled(if: SupportedModule([.dispatch, .network]).isSupported) gating.
Test Infrastructure
Tests/SundialKitStreamTests/SupportedModule.swift
Added new SupportedModule OptionSet struct for runtime module availability detection, enabling conditional test suite execution based on platform capabilities (dispatch/network module support).

Sequence Diagram

sequenceDiagram
    actor App
    participant NO as NetworkObserver
    participant HM as Handler Methods
    participant CM as Continuation Maps
    participant CS as Async Streams
    
    App->>NO: Call pathUpdates()
    activate NO
    NO->>CS: Create AsyncStream with unbounded buffering
    NO->>CM: Register continuation
    deactivate NO
    
    App->>NO: Call cancel()
    activate NO
    NO->>HM: Detect path/ping updates
    HM->>CM: Remove from all continuation maps
    HM->>CS: Call finish() on all continuations
    CS-->>App: Stream terminates
    deactivate NO
    
    NO->>HM: handlePathUpdate(path)
    activate HM
    HM->>NO: Update currentPath
    HM->>CM: Iterate pathContinuations
    HM->>CS: yield(path)
    HM->>CM: Iterate pathStatusContinuations
    HM->>CS: yield(pathStatus)
    HM->>CM: Iterate isExpensive/isConstrainedContinuations
    HM->>CS: yield(Bool)
    deactivate HM
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related issues

Possibly related PRs

  • V1.0.0-alpha.1 #3: Shares code-level changes across NetworkObserver, StreamContinuationManager, SundialLogger, and related test infrastructure that were initially introduced in that PR and are now being refined with conditional compilation and continuation management improvements.

Poem

🐰 Hops of joy through platform gates,
Streams now yield where the network waits,
Two-oh-six marks the copyright year,
Continuations managed crystal clear,
From Swift six-dot-three, our futures bloom,
Conditionally compiled—no test room gloom! 🌱

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch v1.0.0-alpha.2

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 and usage tips.

@leogdion leogdion merged commit ccd571c into main Apr 10, 2026
1 of 34 checks passed
@leogdion leogdion deleted the v1.0.0-alpha.2 branch April 10, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant