Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ extension API.PackageController {

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 {
Copy link

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:

  1. Rename the method to something like swiftDataRaceSafetyReadiness to better reflect its purpose
  2. 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 like SwiftDataRaceSafetyReadiness.
  • Rename the static method swift6Readiness(builds:) in Sources/App/Controllers/API/API+PackageController+BuildInfo.swift (and update its call sites in API+PackageController+GetRoute.swift).
  • Rename the swift6Readiness property in both the BuildInfo response model and the GetRoute.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.

readiness.errorCounts[build.platform] = build.buildErrors?.numSwift6Errors
}
return readiness
Expand Down
Loading