Commit a8539f8
committed
Prior to this change, `ResourceVersion` defined the `Semantic` and
`Arbitrary` variants, where the arbitrary variant was a fall-through
for any version defined as a non-semantic version.
This change:
- Replaces the `Arbitrary` variant with a `Date` variant that wraps a
`DateVersion` type. This allows us to maintain the distinction between
semantic versions and date versions in the type system, which is
preferable to having a catch-all arbitrary version type.
- Defines the `ResourceVersionError` type with the `Error` and
`Diagnostic` traits to represent errors that can occur when parsing
and converting resource versions. This allows us to provide more
detailed error messages and diagnostics when resource version parsing
fails.
To ensure these errors are properly surfaced during deserialization,
this change also tells serde explicitly to deserialize from and
serialize into strings, avoiding the untagged enum variant generic
error message.
- Replaces the `ResourceVersionToSemverConversion` variant for `DscError`
with the `ResourceVersion` variant that transparently wraps
`ResourceVersionError`.
1 parent 82f9abc commit a8539f8
6 files changed
Lines changed: 912 additions & 366 deletions
File tree
- lib/dsc-lib
- locales
- src
- types
- tests/integration/types
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
792 | 792 | | |
793 | 793 | | |
794 | 794 | | |
795 | | - | |
796 | 795 | | |
797 | 796 | | |
798 | 797 | | |
| |||
835 | 834 | | |
836 | 835 | | |
837 | 836 | | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
838 | 844 | | |
839 | 845 | | |
840 | 846 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
148 | 147 | | |
149 | 148 | | |
150 | | - | |
151 | | - | |
152 | | - | |
| 149 | + | |
| 150 | + | |
153 | 151 | | |
154 | 152 | | |
155 | 153 | | |
| |||
167 | 165 | | |
168 | 166 | | |
169 | 167 | | |
170 | | - | |
| 168 | + | |
171 | 169 | | |
172 | | - | |
| 170 | + | |
173 | 171 | | |
174 | 172 | | |
175 | | - | |
| 173 | + | |
176 | 174 | | |
177 | 175 | | |
178 | | - | |
| 176 | + | |
179 | 177 | | |
180 | 178 | | |
181 | 179 | | |
182 | 180 | | |
183 | | - | |
| 181 | + | |
184 | 182 | | |
185 | | - | |
186 | | - | |
187 | | - | |
| 183 | + | |
| 184 | + | |
188 | 185 | | |
189 | | - | |
| 186 | + | |
190 | 187 | | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
195 | 191 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
| 192 | + | |
200 | 193 | | |
201 | 194 | | |
202 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | | - | |
| 143 | + | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
0 commit comments