-
-
Notifications
You must be signed in to change notification settings - Fork 50
Base data race safety reporting on latest Swift version #3797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe static function Changes
Assessment against linked issues
Poem
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. ✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
Sources/App/Controllers/API/API+PackageController+BuildInfo.swift
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
Sources/App/Controllers/API/API+PackageController+BuildInfo.swift (1)
Tests/AppTests/PackageController+routesTests.swift (1)
builds
(300-317)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Test
- GitHub Check: Query Performance Test
- GitHub Check: Release build
static func swift6Readiness(builds: [PackageController.BuildsRoute.BuildInfo]) -> Swift6Readiness { | ||
var readiness = Swift6Readiness() | ||
for build in builds where build.swiftVersion == .v6_0 { | ||
for build in builds where build.swiftVersion == .latest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Consider updating method name to reflect implementation change
You've changed the filtering condition from using Swift 6.0 specifically to using the latest Swift version, which aligns with the PR title about basing data race safety reporting on the latest Swift version. However, the method name swift6Readiness
still suggests a specific tie to Swift 6.
Consider one of the following approaches:
- Rename the method to something like
swiftDataRaceSafetyReadiness
to better reflect its purpose - Add a comment explaining why the latest Swift version is used for Swift 6 readiness evaluation
🏁 Script executed:
#!/bin/bash
# Check if the Swift6Readiness type is used elsewhere to understand any compatibility concerns
echo "Searching for Swift6Readiness usage"
rg "Swift6Readiness" --type swift -A 2 -B 2
echo "Searching for swift6Readiness method calls"
rg "swift6Readiness" --type swift -A 2 -B 2
echo "Checking if there are tests covering this functionality"
rg "func.*[tT]est.*[sS]wift6" --type swift
Length of output: 17534
Align naming of Swift6Readiness with its “latest Swift” implementation
The helper and its type are still named for “Swift 6,” even though the code now filters by .latest
. To avoid confusion (and future drift once Swift 7+ becomes “latest”), please:
- Rename the
Swift6Readiness
type (and its alias in API+PackageController+BuildInfo.swift) to something likeSwiftDataRaceSafetyReadiness
. - Rename the static method
swift6Readiness(builds:)
inSources/App/Controllers/API/API+PackageController+BuildInfo.swift
(and update its call sites inAPI+PackageController+GetRoute.swift
). - Rename the
swift6Readiness
property in both theBuildInfo
response model and theGetRoute.Model
. - Update any tests or views that reference
Swift6Readiness
/swift6Readiness
.
If you’d rather keep the existing names for backwards compatibility, add a clear doc comment on Swift6Readiness
(and the swift6Readiness(...)
method) explaining that it actually computes data-race-safety readiness for the latest Swift version.
Fixes #3794
GRDB now correctly reports 9 errors:
Summary by CodeRabbit