Skip to content

Modernize KituraCache for Swift 6#40

Merged
adam-rocska merged 13 commits into
masterfrom
improvement/swift-6-upgrade
May 20, 2026
Merged

Modernize KituraCache for Swift 6#40
adam-rocska merged 13 commits into
masterfrom
improvement/swift-6-upgrade

Conversation

@adam-rocska

@adam-rocska adam-rocska commented May 19, 2026

Copy link
Copy Markdown
Member

Summary

This PR performs a minimalist modernization pass for KituraCache while keeping the package small and focused.

  • Updates the package for Swift tools 6 and current declared platform baselines.
  • Removes obsolete Swift 4, Travis CI, Jazzy, and generated legacy documentation artifacts.
  • Migrates tests from XCTest/LinuxMain to Swift Testing.
  • Migrates API documentation from Jazzy to Swift-DocC.
  • Refreshes the README badges, requirements, SwiftPM usage snippet, community links, and license link so they match the modernized repository.
  • Gates Dispatch-specific cache internals so Dispatch-backed platforms keep the existing timer behavior while Dispatch-less Swift SDKs can still compile.
  • Updates GitHub Actions to validate Linux, the listed Apple platforms, DocC, Android, and Wasm without running an expensive emulator or simulator matrix.

CI Strategy

The workflow is intentionally budget-conscious for a community-maintained project. Linux tests run on Swift 6.0 and the current Swift 6.3.2 container. Apple platforms are validated with SwiftPM cross-builds against Xcode SDKs instead of simulator runtime downloads. Android and Wasm are compile checks using official Swift SDK bundles with pinned checksums.

Validation

Validated locally and on GitHub Actions:

  • swift test
  • Swift-DocC generation with --warnings-as-errors and documentation coverage
  • SwiftPM cross-builds for macOS, iOS, tvOS, watchOS, Mac Catalyst, and visionOS using installed Xcode SDKs
  • Workflow YAML parsing and whitespace checks
  • Stale-reference sweep for Travis, Jazzy, XCTest/LinuxMain, Swift 4/5 remnants, dead Swift@IBM/Bluemix Slack links, old license paths, old Swift conditionals, and old API documentation links
  • GitHub Actions run on the current head passes Linux, Apple platforms, DocC, Android, and Wasm

Remaining Work

No known modernization work remains for this PR. Follow-up quality work can focus on broader API design, faster tests, richer DocC articles/tutorials, and deeper platform-specific runtime behavior where appropriate.

May be a remnant of the past.
This does not relicense the repository.

The legacy long-form Apache header in
`Package.swift` was replaced with concise SPDX
metadata as part of a full SwiftPM manifest
rewrite. The repository remains licensed under
Apache-2.0 via `LICENSE.txt`.
The tests are infuriatingly slow, but they were
slow before so it's not the upgrade's fault.

I'll have the quality control in a better shape
later in a separate PR and stage, for now this is
good enough.
I tried my best not to drop the ball. We should
have a fairly 1:1 mapping of the old legacy.

Of-course with the final revamp,
API modernization, etc. we'll have better quality
control **and much better documentation**.

I plan to have a handful of DocC articles,
Tutorials and sample projects/code. It should not
only help with human understanding but give AIs a
much better chance at understanding the API and
how to use it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes KituraCache for Swift 6 by updating the Swift tools version and CI, migrating testing and documentation tooling, and removing legacy CI/docs artifacts to keep the package lightweight.

Changes:

  • Migrates the test suite from XCTest/LinuxMain to Swift Testing.
  • Migrates API documentation from Jazzy-generated site/docs to Swift-DocC (including a DocC catalog page).
  • Replaces Travis CI with a GitHub Actions workflow that validates Linux, Apple cross-builds, DocC, Android, and Wasm.

Reviewed changes

Copilot reviewed 36 out of 54 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Tests/LinuxMain.swift Removes obsolete LinuxMain XCTest entry point (Swift Testing migration).
Tests/KituraCacheTests/TestCache.swift Migrates tests to Swift Testing and updates timing logic for TTL coverage.
Sources/KituraCache/Statistics.swift Converts legacy block comments to modern DocC-friendly doc comments.
Sources/KituraCache/KituraCache.swift Updates public API DocC comments for Swift-DocC generation.
Sources/KituraCache/KituraCache.docc/KituraCache.md Adds a DocC landing page with usage and Topics links.
README.md Updates badges, Swift version requirement, and local DocC generation instructions.
Package@swift-4.swift Removes legacy Swift 4 manifest.
Package.swift Bumps tools version to Swift 6, declares modern Apple platform baselines, adds DocC plugin dependency.
Package.resolved Pins DocC plugin dependencies for reproducible builds.
LICENSE Adds Apache 2.0 license text file at repo root.
docs/undocumented.json Removes Jazzy documentation coverage artifact.
docs/Structs/Statistics.html Removes generated Jazzy HTML documentation.
docs/Structs.html Removes generated Jazzy HTML documentation.
docs/search.json Removes generated Jazzy search index.
docs/js/typeahead.jquery.js Removes generated Jazzy site JS dependency.
docs/js/lunr.min.js Removes generated Jazzy site JS dependency.
docs/js/jazzy.search.js Removes generated Jazzy site JS dependency.
docs/js/jazzy.js Removes generated Jazzy site JS dependency.
docs/index.html Removes generated Jazzy index page.
docs/docsets/KituraCache.docset/Contents/Resources/Documents/Structs/Statistics.html Removes generated Jazzy docset HTML page.
docs/docsets/KituraCache.docset/Contents/Resources/Documents/Structs.html Removes generated Jazzy docset HTML index.
docs/docsets/KituraCache.docset/Contents/Resources/Documents/search.json Removes generated Jazzy docset search index.
docs/docsets/KituraCache.docset/Contents/Resources/Documents/js/lunr.min.js Removes generated Jazzy docset JS dependency.
docs/docsets/KituraCache.docset/Contents/Resources/Documents/js/jazzy.search.js Removes generated Jazzy docset JS dependency.
docs/docsets/KituraCache.docset/Contents/Resources/Documents/js/jazzy.js Removes generated Jazzy docset JS dependency.
docs/docsets/KituraCache.docset/Contents/Resources/Documents/index.html Removes generated Jazzy docset index page.
docs/docsets/KituraCache.docset/Contents/Resources/Documents/css/jazzy.css Removes generated Jazzy docset CSS.
docs/docsets/KituraCache.docset/Contents/Resources/Documents/css/highlight.css Removes generated Jazzy docset CSS.
docs/docsets/KituraCache.docset/Contents/Resources/Documents/Classes/KituraCache.html Removes generated Jazzy docset class page.
docs/docsets/KituraCache.docset/Contents/Resources/Documents/Classes.html Removes generated Jazzy docset classes index.
docs/docsets/KituraCache.docset/Contents/Info.plist Removes generated Jazzy docset metadata.
docs/css/jazzy.css Removes generated Jazzy site CSS.
docs/css/highlight.css Removes generated Jazzy site CSS.
docs/Classes/KituraCache.html Removes generated Jazzy class HTML page.
docs/Classes.html Removes generated Jazzy classes index page.
docs/badge.svg Removes generated Jazzy documentation badge asset.
.travis.yml Removes Travis CI configuration.
.swift-version Removes legacy Swift version pin file.
.jazzy.yaml Removes Jazzy configuration (DocC replaces it).
.github/workflows/ci.yml Adds new GitHub Actions CI for Linux, Apple cross-builds, DocC, Android, and Wasm.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Sources/KituraCache/KituraCache.swift Outdated
Comment on lines +78 to +92
cache.setObject(value1, forKey: "key1", withTTL: 100)
cache.setObject(value2, forKey: "key2", withTTL: 2)
cache.setObject(value3, forKey: "key3")

await wait(seconds: 7)
keys = cache.keys()
#expect(keys.count == 2)

await wait(seconds: 7)
keys = cache.keys()
#expect(keys.count == 1)

await wait(seconds: 7)
keys = cache.keys()
#expect(keys.count == 1)
Comment thread Tests/KituraCacheTests/TestCache.swift
@adam-rocska adam-rocska merged commit a377c53 into master May 20, 2026
10 checks passed
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.

2 participants