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!: renames "url" field into "module". #1016

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

jvanz
Copy link
Member

@jvanz jvanz commented Jan 3, 2025

Description

Renames the "url" field into "module". This makes the field name the same of the name used in the CRDs.

Fix #906

Copy link

codecov bot commented Jan 3, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 63.58%. Comparing base (10938df) to head (6847459).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
src/evaluation/evaluation_environment.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1016   +/-   ##
=======================================
  Coverage   63.58%   63.58%           
=======================================
  Files          17       17           
  Lines        1071     1071           
=======================================
  Hits          681      681           
  Misses        390      390           
Flag Coverage Δ
integration-tests 56.26% <75.00%> (ø)
unit-tests 37.29% <50.00%> (ø)

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 jvanz force-pushed the rename-url-field branch from cfe621d to 05b1cb0 Compare January 3, 2025 13:45
@jvanz jvanz marked this pull request as ready for review January 3, 2025 13:45
@jvanz jvanz requested a review from a team as a code owner January 3, 2025 13:45
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.

Looks good! Yet we should change also policies.yml.example.

Renames the "url" field into "module". This makes the field name the same
of the name used in the CRDs.

Signed-off-by: José Guilherme Vanz <jguilhermevanz@suse.com>
@jvanz jvanz force-pushed the rename-url-field branch from 05b1cb0 to 6847459 Compare January 3, 2025 17:45
@jvanz jvanz requested a review from viccuad January 3, 2025 17:45
@@ -341,7 +341,7 @@ pub enum PolicyOrPolicyGroup {
#[serde(rename_all = "camelCase")]
Policy {
/// The URL where the policy is located
url: String,
module: String,
Copy link
Contributor

@fabriziosestito fabriziosestito Jan 7, 2025

Choose a reason for hiding this comment

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

what about using #[serde(alias = "url")] so we do not break the current behavior?

Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking it over, this only affects raw policy users, so I'm fine with the breaking changes.

Copy link
Member

Choose a reason for hiding this comment

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

Opened kubewarden/docs#484 for updating the user-facing docs.

@jvanz jvanz merged commit 378ca5b into kubewarden:main Jan 7, 2025
11 checks passed
@jvanz jvanz deleted the rename-url-field branch January 7, 2025 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

policies.yaml should match CRDs: rename url field to module.
3 participants