Skip to content
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 release module #28

Merged
merged 1 commit into from
Sep 23, 2024
Merged

Add release module #28

merged 1 commit into from
Sep 23, 2024

Conversation

theory
Copy link
Member

@theory theory commented Sep 17, 2024

The new Release struct encapsulates Distribution and adds a release field that contains JWS-signed release metadata. It currently only supports v2 metadata, but offers the same traits, constructors, and accessors as Distribution, plus the release() accessor and associated objects.

Add tests for all of these bits, using both the v2 corpus with a release patch applied and custom JSON objects to test each individual struct and its accessors.

Writing the tests for the TryFrom<PathBuf> when what was on hand was a Path led to a bit of research and the conclusion that one does not convert a file path into a struct, but loads it into a struct. So create the load function, instead, and have it accept a AsRef<Path> argument, which covers Paths, PathBufs, and strings. Back-patch this change to Distribution, as well, and take advantage of .try_into() where possible.

@theory theory requested a review from vrmiguel September 17, 2024 21:38
@theory theory self-assigned this Sep 17, 2024
Copy link

codecov bot commented Sep 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (426128a) to head (2923488).

Additional details and impacted files
@@                  Coverage Diff                  @@
##           release-validation       #28    +/-   ##
=====================================================
  Coverage              100.00%   100.00%            
=====================================================
  Files                       6         8     +2     
  Lines                     887      1040   +153     
=====================================================
+ Hits                      887      1040   +153     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@theory theory linked an issue Sep 17, 2024 that may be closed by this pull request
src/release/mod.rs Outdated Show resolved Hide resolved
The new `Release` struct encapsulates `Distribution` and adds a
`release` field that contains JWS-signed release metadata. It currently
only supports v2 metadata, but offers the same traits, constructors, and
accessors as `Distribution`, plus the `release()` accessor and
associated objects.

Add tests for all of these bits, using both the v2 corpus with a release
patch applied and custom JSON objects to test each individual struct and
its accessors.

Writing the tests for the `TryFrom<PathBuf>` when what was on hand was a
`Path` led to a bit of research and the conclusion that one does not
convert a file path into a struct, but loads it into a struct. So create
the `load` function, instead, and have it accept a `AsRef<Path>`
argument, which covers `Path`s, `PathBuf`s, and strings. Back-patch this
change to `Distribution`, as well, and take advantage of `.try_into()`
where possible.
Base automatically changed from release-validation to main September 23, 2024 21:57
@theory theory merged commit 88b2183 into main Sep 23, 2024
136 checks passed
@theory theory deleted the release-struct branch September 23, 2024 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Release metadata in pgxn_spec
2 participants