Commit cc4be53
committed
RuntimeConfiguration: explicit Codable for path; restore Data(contentsOf:).
Address review feedback on the URL → FilePath conversion of
RuntimeConfiguration.path:
1. FilePath's default Codable encoding exposes its internal _storage
as a keyed container, while URL's default encoding produced a plain
absoluteString. Without this fix, runtime-configuration.json files
written by daemons before the migration would fail to decode after
upgrade. Add explicit CodingKeys + encode(to:) / init(from:) that
serialize path as a plain string and accept either form (file:// or
bare path) on decode for backward compatibility. Add a regression
test for the legacy URL format.
2. Restore Data(contentsOf: URL(fileURLWithPath:)) for reading the
config file, matching the codebase precedent (Bundle.swift,
ConfigurationLoader.swift, EntityStore.swift). FileManager.contents
would have lost typed CocoaError diagnostics on I/O failure.1 parent 0106155 commit cc4be53
2 files changed
Lines changed: 69 additions & 6 deletions
File tree
- Sources/Services/Runtime/RuntimeClient
- Tests/ContainerAPIServiceTests
Lines changed: 45 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
54 | 98 | | |
55 | 99 | | |
56 | 100 | | |
| |||
72 | 116 | | |
73 | 117 | | |
74 | 118 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 119 | + | |
81 | 120 | | |
82 | 121 | | |
83 | 122 | | |
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
139 | 163 | | |
0 commit comments