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: policies.yml parsing #843

Merged

Conversation

fabriziosestito
Copy link
Contributor

@fabriziosestito fabriziosestito commented Jul 24, 2024

Description

Due to the recent addition of policy groups, the parsing of policies.yml was broken.
This happened because of a pretty confusing serde behavior, as an attribute on an enum is renaming all the variants of the enum, not all the fields of those variants.

TODO:

  • update tests

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
Copy link

codecov bot commented Jul 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.48%. Comparing base (631413b) to head (8b269e1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #843      +/-   ##
==========================================
+ Coverage   61.38%   61.48%   +0.09%     
==========================================
  Files          17       17              
  Lines        1036     1036              
==========================================
+ Hits          636      637       +1     
+ Misses        400      399       -1     
Flag Coverage Δ
integration-tests 53.91% <ø> (+0.09%) ⬆️
unit-tests 33.16% <ø> (ø)

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.

@jvanz
Copy link
Member

jvanz commented Jul 24, 2024

I think this PR fixes the v1.15.0-rc1 issue we are discussing in other channels. I was testing the bug and when I applied the same change, the problem goes away. Serde was ignoring the policy mode field due the funky behavior that you linked here. To double check that, I've renamed the field to "policy_mode" in my testing policies.yml and that works as well. 🙂

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
@fabriziosestito fabriziosestito marked this pull request as ready for review July 25, 2024 08:11
@fabriziosestito fabriziosestito requested a review from a team as a code owner July 25, 2024 08:11
Copy link
Member

@viccuad viccuad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@viccuad viccuad merged commit bc7aeb1 into kubewarden:main Jul 25, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants