Skip to content

Commit 3072541

Browse files
author
Pete Schwamb
committed
LoopAppManager: restore submodule SHAs in diagnostic report
Marion's LoopKit#2399 (b6e8841) added submodule branch+SHA to the build-details section of the diagnostic report. The script and BuildDetails.submodules accessor survived the Tidepool merges, but the report-builder block itself was relocated from DeviceDataManager.swift to LoopAppManager in Tidepool's refactor, and the merge kept Tidepool's older shape — so the consumer of .submodules was effectively dropped. Port the original change into generateDiagnosticReport(): - drop the now-redundant Loop-submodule gitRevision/gitBranch lines - rename workspaceGit{Revision,Branch} to "Workspace SHA/branch" - append the submodule list (alphabetized, "name: branch, sha")
1 parent 4eea0b2 commit 3072541

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

Loop/Managers/LoopAppManager.swift

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,17 +1049,24 @@ extension LoopAppManager: DiagnosticReportGenerator {
10491049
/// - parameter completion: A closure called once the report has been generated. The closure takes a single argument of the report string.
10501050
func generateDiagnosticReport() async -> String {
10511051

1052+
let submodulesInfo = BuildDetails.default.submodules
1053+
.sorted(by: { $0.key < $1.key })
1054+
.map { key, value in
1055+
"* \(key): \(value.branch), \(value.commitSHA)"
1056+
}
1057+
.joined(separator: "\n")
1058+
10521059
let entries: [String] = [
10531060
"## Build Details",
10541061
"* appNameAndVersion: \(Bundle.main.localizedNameAndVersion)",
10551062
"* profileExpiration: \(BuildDetails.default.profileExpirationString)",
1056-
"* gitRevision: \(BuildDetails.default.gitRevision ?? "N/A")",
1057-
"* gitBranch: \(BuildDetails.default.gitBranch ?? "N/A")",
1058-
"* workspaceGitRevision: \(BuildDetails.default.workspaceGitRevision ?? "N/A")",
1059-
"* workspaceGitBranch: \(BuildDetails.default.workspaceGitBranch ?? "N/A")",
10601063
"* sourceRoot: \(BuildDetails.default.sourceRoot ?? "N/A")",
10611064
"* buildDateString: \(BuildDetails.default.buildDateString ?? "N/A")",
10621065
"* xcodeVersion: \(BuildDetails.default.xcodeVersion ?? "N/A")",
1066+
"* Workspace branch: \(BuildDetails.default.workspaceGitBranch ?? "N/A")",
1067+
"* Workspace SHA: \(BuildDetails.default.workspaceGitRevision ?? "N/A")",
1068+
"* Submodule name: branch, SHA",
1069+
"\(submodulesInfo)",
10631070
"",
10641071
"## FeatureFlags",
10651072
"\(FeatureFlags)",

0 commit comments

Comments
 (0)