summaryrefslogtreecommitdiff
path: root/Hutch/Models
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-03-23 15:17:48 -0500
committerChristian Cleberg <[email protected]>2026-03-23 15:17:48 -0500
commitcf87c44f674e020c32fea70903f02c317b57da3b (patch)
tree88c09a27ef1ba30581a63c50f0f8d345477145c5 /Hutch/Models
parentb81657586244299fc9fe78e4f27ca1c8bca07060 (diff)
downloadhutch-cf87c44f674e020c32fea70903f02c317b57da3b.tar.gz
hutch-cf87c44f674e020c32fea70903f02c317b57da3b.tar.bz2
hutch-cf87c44f674e020c32fea70903f02c317b57da3b.zip
Add scoped auto-refresh to build detail
Diffstat (limited to 'Hutch/Models')
-rw-r--r--Hutch/Models/Builds.swift14
1 files changed, 11 insertions, 3 deletions
diff --git a/Hutch/Models/Builds.swift b/Hutch/Models/Builds.swift
index b0c0e8d..8de4235 100644
--- a/Hutch/Models/Builds.swift
+++ b/Hutch/Models/Builds.swift
@@ -19,6 +19,14 @@ enum JobStatus: String, Codable, Sendable {
default: false
}
}
+
+ /// Whether the job has reached a terminal state and no longer changes.
+ var isTerminal: Bool {
+ switch self {
+ case .success, .failed, .cancelled, .timeout: true
+ case .pending, .queued, .running: false
+ }
+ }
}
/// Status of a single build task within a job.
@@ -33,7 +41,7 @@ enum TaskStatus: String, Codable, Sendable {
// MARK: - Build Task
/// A single task within a build job.
-struct BuildTask: Codable, Sendable, Identifiable {
+struct BuildTask: Codable, Sendable, Identifiable, Equatable {
private(set) var ordinal: Int?
let name: String
let status: TaskStatus
@@ -103,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 {
+struct JobDetail: Codable, Sendable, Equatable {
let id: Int
let created: Date
let updated: Date
@@ -119,7 +127,7 @@ struct JobDetail: Codable, Sendable {
}
/// The log associated with a build job.
-struct BuildLog: Codable, Sendable {
+struct BuildLog: Codable, Sendable, Equatable {
let fullURL: String
}