Modernize KituraCache for Swift 6#40
Merged
Merged
Conversation
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`.
Was out of fashion.
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.
There was a problem hiding this comment.
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 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR performs a minimalist modernization pass for KituraCache while keeping the package small and focused.
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--warnings-as-errorsand documentation coverageRemaining 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.