-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add v1-v2 release conversion #29
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #29 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 8 10 +2
Lines 1034 1083 +49
=========================================
+ Hits 1034 1083 +49 ☔ View full report in Codecov by Sentry. |
c1f24b7
to
ee4a514
Compare
for (name, patches, expect) in [ | ||
( | ||
"license", | ||
vec![json!({"license": "MIT"})], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vec![json!({"license": "MIT"})], | |
&[json!({"license": "MIT"})], |
Doing this I believe you could skip the .as_slice()
below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly that doesn't work because the third item in the list has two items in the vector, not one, so it complains with
mismatched types
expected reference `&[serde_json::Value; 1]`
found reference `&[serde_json::Value; 2]`
2923488
to
88b2183
Compare
Dupe the pattern from the `meta` package by adding `v1` and `v2` sub-packages that know how to parse into the canonical form. Make `meta::v1` public to the crate so that `release::v1` can use it to migrate everything but the release metadata, then add `v1_to_v2_release` to handle that bit. The v2 `release` object takes the form of a JWS-JS data structure, but since we're not signing anything yet, and this is just to get things to load properly, for now just generate random values for the JWS header and signature. Enable the v1 corpus tests and add a test for merging v1 release metadata. While at it, change the `uri` property to start with `dist` instead of `/dist`, because the latter implies relative to the root of a domain, and mirrors may not serve from a domain root.
ee4a514
to
b239fe4
Compare
Dupe the pattern from the
meta
package by addingv1
andv2
sub-packages that know how to parse into the canonical form. Makemeta::v1
public to the crate so thatrelease::v1
can use it to migrate everything but the release metadata, then addv1_to_v2_release
to handle that bit.The v2
release
object takes the form of a JWS-JS data structure, but since we're not signing anything yet, and this is just to get things to load properly, for now just generate random values for the JWS header and signature.While at it, change the
uri
property to start withdist
instead of/dist
, because the latter implies relative to the root of a domain, and mirrors may not serve from a domain root.