summaryrefslogtreecommitdiff
path: root/Hutch/Models/Builds.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-08-07 17:33:46 -0500
committerChristian Cleberg <[email protected]>2026-08-07 17:33:46 -0500
commit283fbf00fdffd64c924b6cb22c84e803b718f078 (patch)
treef6603518ba62134faa699d864003b90464930ab9 /Hutch/Models/Builds.swift
parentb2a1265cadccc34cbdab71b9ed638b908cac9f62 (diff)
downloadhutch-283fbf00fdffd64c924b6cb22c84e803b718f078.tar.gz
hutch-283fbf00fdffd64c924b6cb22c84e803b718f078.tar.bz2
hutch-283fbf00fdffd64c924b6cb22c84e803b718f078.zip
Adopt Swift 6 language mode
Flip SWIFT_VERSION to 6.0 (keeping SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor) and resolve every resulting diagnostic. Mechanical, no behaviour change: - Models: pure value types in Models/ and utility extensions (Date, DateFormatter, SRHTWebURL) marked nonisolated so the nonisolated networking layer can use them. - App Intents: stored 'static var' (title/description/openAppWhenRun/ typeDisplayRepresentation/defaultQuery/caseDisplayRepresentations) -> 'static let'; drop the invalid @retroactive on the in-module LookupType: AppEnum. - Sendable dicts: 'nil as String? as Any' -> 'nil as String? as any Sendable'. - UserDefaults: retroactive @unchecked Sendable (documented thread-safe). - WidgetKit completion handlers rebound nonisolated(unsafe) to cross into Task {}; TipStoreViewModel task handle is @ObservationIgnored nonisolated(unsafe) for its nonisolated deinit. - Tests run on @MainActor; a few constant fixtures marked nonisolated for use in @Sendable stub closures. Builds and the full suite are clean in Swift 6 mode. Roadmap updated.
Diffstat (limited to 'Hutch/Models/Builds.swift')
-rw-r--r--Hutch/Models/Builds.swift18
1 files changed, 9 insertions, 9 deletions
diff --git a/Hutch/Models/Builds.swift b/Hutch/Models/Builds.swift
index 3926888..48a9c91 100644
--- a/Hutch/Models/Builds.swift
+++ b/Hutch/Models/Builds.swift
@@ -3,7 +3,7 @@ import Foundation
// MARK: - Enums
/// Status of a build job.
-enum JobStatus: String, Codable, Sendable {
+nonisolated enum JobStatus: String, Codable, Sendable {
case pending = "PENDING"
case queued = "QUEUED"
case running = "RUNNING"
@@ -30,7 +30,7 @@ enum JobStatus: String, Codable, Sendable {
}
/// Status of a single build task within a job.
-enum TaskStatus: String, Codable, Sendable {
+nonisolated enum TaskStatus: String, Codable, Sendable {
case pending = "PENDING"
case running = "RUNNING"
case success = "SUCCESS"
@@ -41,7 +41,7 @@ enum TaskStatus: String, Codable, Sendable {
// MARK: - Build Task
/// A single task within a build job.
-struct BuildTask: Codable, Sendable, Identifiable, Equatable {
+nonisolated struct BuildTask: Codable, Sendable, Identifiable, Equatable {
private(set) var ordinal: Int?
let name: String
let status: TaskStatus
@@ -74,7 +74,7 @@ struct BuildTask: Codable, Sendable, Identifiable, Equatable {
// MARK: - Job Summary (for list view)
/// Lightweight job model matching the fields returned by the jobs list query.
-struct JobSummary: Codable, Sendable, Identifiable, Hashable {
+nonisolated struct JobSummary: Codable, Sendable, Identifiable, Hashable {
let id: Int
let created: Date
let updated: Date
@@ -103,7 +103,7 @@ struct JobSummary: Codable, Sendable, Identifiable, Hashable {
}
/// Minimal task info for the list query.
-struct JobTaskSummary: Codable, Sendable, Hashable {
+nonisolated struct JobTaskSummary: Codable, Sendable, Hashable {
let name: String
let status: TaskStatus
}
@@ -111,7 +111,7 @@ struct JobTaskSummary: Codable, Sendable, Hashable {
// MARK: - Job Detail (for detail view)
/// Full job model with all fields for the detail view.
-struct JobDetail: Codable, Sendable, Equatable {
+nonisolated struct JobDetail: Codable, Sendable, Equatable {
let id: Int
let created: Date
let updated: Date
@@ -128,7 +128,7 @@ struct JobDetail: Codable, Sendable, Equatable {
}
/// A downloadable artifact emitted by a build job.
-struct BuildArtifact: Codable, Sendable, Identifiable, Equatable {
+nonisolated struct BuildArtifact: Codable, Sendable, Identifiable, Equatable {
let id: Int
let created: Date
let path: String
@@ -145,14 +145,14 @@ struct BuildArtifact: Codable, Sendable, Identifiable, Equatable {
}
/// The log associated with a build job.
-struct BuildLog: Codable, Sendable, Equatable {
+nonisolated struct BuildLog: Codable, Sendable, Equatable {
let fullURL: String
}
// MARK: - Job Group
/// A group of related build jobs.
-struct JobGroup: Codable, Sendable, Identifiable {
+nonisolated struct JobGroup: Codable, Sendable, Identifiable {
let id: Int
let created: Date
let note: String?