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

fix: allow kwctl to build using latest version of this crate #473

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

flavio
Copy link
Member

@flavio flavio commented Apr 8, 2024

Previously, the Serialize and Deserialize traits have been removed from the CallbackRequestType. That was done because the tokio::time::Instant trait doesn't derive them.

I initially though we didn't need these traits to be provided by this object. That proved true because I was working only on Policy Server, which doesn't require them.

However, kwctl requires them to save and restore context aware sessions.

This commit introduces custom serializer and deserializer functions for tokio::time::Instant, making possible to reintroduce the Serialize and Deserialize traits. This fixes the compilation of kwctl.

Previously, the `Serialize` and `Deserialize` traits have been removed
from the `CallbackRequestType`. That was done because the
`tokio::time::Instant` trait doesn't derive them.

I initially though we didn't need these traits to be provided by this
object. That proved true because I was working only on Policy Server,
which doesn't require them.

However, kwctl requires them to save and restore context aware sessions.

This commit introduces custom serializer and deserializer functions for
`tokio::time::Instant`, making possible to reintroduce the `Serialize`
and `Deserialize` traits. This fixes the compilation of kwctl.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
@flavio flavio requested a review from a team as a code owner April 8, 2024 06:45
Copy link

codecov bot commented Apr 8, 2024

Codecov Report

Attention: Patch coverage is 0% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 45.08%. Comparing base (2f24d81) to head (985f911).
Report is 4 commits behind head on main.

Files Patch % Lines
src/callback_requests.rs 0.00% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #473      +/-   ##
==========================================
- Coverage   45.24%   45.08%   -0.16%     
==========================================
  Files          53       53              
  Lines        2871     2881      +10     
==========================================
  Hits         1299     1299              
- Misses       1572     1582      +10     
Flag Coverage Δ
integration-tests 35.40% <0.00%> (-0.13%) ⬇️
unit-tests 15.82% <0.00%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@flavio flavio self-assigned this Apr 8, 2024
@flavio flavio merged commit f7c6dd7 into kubewarden:main Apr 8, 2024
6 of 8 checks passed
@flavio flavio deleted the fix-kwctl-build branch April 8, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants