Skip to content

Commit 67e56d1

Browse files
committed
encode run ID in build logs
1 parent 72e6c88 commit 67e56d1

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

Sources/UnidocClient/Unidoc.Client.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ extension Unidoc.Client<HTTP.Client2>
255255
}
256256

257257
// Attach build logs.
258-
try artifact.attach(log: output, as: .ssgc)
259-
try artifact.attach(log: diagnostics, as: .ssgcDiagnostics)
258+
try artifact.attach(log: output, as: .build)
259+
try artifact.attach(log: diagnostics, as: .documentation)
260260

261261
// If the repo URL contains a token, we should keep the logs secret.
262262
artifact.logsAreSecret = labels.repo.contains("@")

Sources/UnidocDB/Building/Unidoc.BuildLogPath.swift

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,21 @@ extension Unidoc.BuildLogPath
3131
logs/\
3232
\(self.id.run.timestamp?.date.description ?? "0000-00-00")/\
3333
\(self.id.edition.package)/\
34-
\(self.id.edition.version).\(self.type.name).log
34+
\(self.filename)
3535
"""
3636
}
37+
38+
@inlinable
39+
var filename:String
40+
{
41+
switch self.type
42+
{
43+
case .build: "\(self.id.edition.version)-\(self.id.run.index).build.log"
44+
case .documentation: "\(self.id.edition.version)-\(self.id.run.index).docs.log"
45+
case .ssgc: "\(self.id.edition.version).build.log"
46+
case .ssgcDiagnostics: "\(self.id.edition.version).documentation.log"
47+
}
48+
}
3749
}
3850
extension Unidoc.BuildLogPath:CustomStringConvertible
3951
{

Sources/UnidocRecords/Building/Unidoc.BuildLogType.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ extension Unidoc
55
@frozen public
66
enum BuildLogType:String, BSONDecodable, BSONEncodable, Equatable, Sendable
77
{
8+
/// Deprecated.
89
case ssgc = "C"
10+
/// Deprecated.
911
case ssgcDiagnostics = "D"
12+
13+
case build = "B"
14+
case documentation = "A"
1015
}
1116
}
1217
extension Unidoc.BuildLogType
@@ -18,6 +23,8 @@ extension Unidoc.BuildLogType
1823
{
1924
case .ssgc: "build"
2025
case .ssgcDiagnostics: "documentation"
26+
case .build: "build"
27+
case .documentation: "documentation"
2128
}
2229
}
2330
}

0 commit comments

Comments
 (0)