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

ratelimitpolicy v1beta3 #875

Merged
merged 10 commits into from
Oct 7, 2024
Merged

ratelimitpolicy v1beta3 #875

merged 10 commits into from
Oct 7, 2024

Conversation

eguzki
Copy link
Contributor

@eguzki eguzki commented Sep 25, 2024

No description provided.

@eguzki eguzki linked an issue Sep 25, 2024 that may be closed by this pull request
2 tasks
@eguzki eguzki added kind/enhancement New feature or request size/medium area/api Changes user facing APIs labels Sep 25, 2024
@eguzki eguzki self-assigned this Sep 25, 2024
Copy link

codecov bot commented Sep 25, 2024

Codecov Report

Attention: Patch coverage is 92.50000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 81.30%. Comparing base (ece13e8) to head (bb71440).
Report is 223 commits behind head on main.

Files with missing lines Patch % Lines
api/v1beta3/topology.go 61.53% 5 Missing ⚠️
controllers/httprouteparentrefs_eventmapper.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #875      +/-   ##
==========================================
+ Coverage   80.20%   81.30%   +1.09%     
==========================================
  Files          64      102      +38     
  Lines        4492     7089    +2597     
==========================================
+ Hits         3603     5764    +2161     
- Misses        600      897     +297     
- Partials      289      428     +139     
Flag Coverage Δ
bare-k8s-integration 8.28% <3.75%> (?)
controllers-integration 73.40% <88.75%> (?)
envoygateway-integration 49.89% <82.50%> (?)
gatewayapi-integration 13.60% <10.00%> (?)
integration ?
istio-integration 52.92% <87.50%> (?)
unit 28.70% <26.58%> (-1.33%) ⬇️

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

Components Coverage Δ
api/v1beta1 (u) 90.90% <100.00%> (+19.48%) ⬆️
api/v1beta2 (u) 86.61% <81.94%> (-4.82%) ⬇️
pkg/common (u) 88.13% <ø> (-0.70%) ⬇️
pkg/istio (u) 71.51% <ø> (-2.40%) ⬇️
pkg/log (u) 94.73% <ø> (ø)
pkg/reconcilers (u) ∅ <ø> (∅)
pkg/rlptools (u) 85.00% <ø> (+5.54%) ⬆️
controllers (i) 82.75% <82.84%> (+5.95%) ⬆️
Files with missing lines Coverage Δ
api/v1beta2/topology.go 61.53% <ø> (ø)
api/v1beta3/ratelimitpolicy_types.go 73.68% <ø> (ø)
controllers/envoygateway_wasm_controller.go 82.30% <100.00%> (ø)
...ollers/limitador_cluster_envoyfilter_controller.go 73.03% <100.00%> (-8.79%) ⬇️
...s/limitador_status_to_rlp_gateway_event_handler.go 81.81% <100.00%> (ø)
...llers/rate_limiting_istio_wasmplugin_controller.go 70.87% <100.00%> (ø)
controllers/ratelimitpolicy_controller.go 81.55% <100.00%> (+7.55%) ⬆️
...lers/ratelimitpolicy_enforced_status_controller.go 83.42% <100.00%> (ø)
controllers/ratelimitpolicy_limits.go 81.35% <100.00%> (-0.91%) ⬇️
controllers/ratelimitpolicy_status.go 95.83% <100.00%> (+14.35%) ⬆️
... and 9 more

... and 48 files with indirect coverage changes

@eguzki eguzki force-pushed the 810-ratelimitpolicy-v1beta3 branch from 0fe564a to 125a5ff Compare October 2, 2024 08:36
@@ -141,7 +141,7 @@ type RateLimitPolicySpec struct {
// TargetRef identifies an API object to apply policy to.
// +kubebuilder:validation:XValidation:rule="self.group == 'gateway.networking.k8s.io'",message="Invalid targetRef.group. The only supported value is 'gateway.networking.k8s.io'"
// +kubebuilder:validation:XValidation:rule="self.kind == 'HTTPRoute' || self.kind == 'Gateway'",message="Invalid targetRef.kind. The only supported values are 'HTTPRoute' and 'Gateway'"
TargetRef gatewayapiv1alpha2.LocalPolicyTargetReference `json:"targetRef"`
TargetRef gatewayapiv1alpha2.LocalPolicyTargetReferenceWithSectionName `json:"targetRef"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mind keeping this one commit out if this PR please? It's done in #893 where it makes more sense IMO, because the functionality for it is also implemented there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I need that to implement the removal of routeSelectors. It's part of my assignment on #810

Copy link
Contributor

Choose a reason for hiding this comment

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

Please. Don't do that either. It's also removed in #893, along with the meaning of that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am confused. I thought we agreed on doing the version bumping first together with the route selector removal. That's a change big enough to deserve it's own PR. Then in another PR, the refactor on the state of the world controller.

I think it is reasonable and we should stick to the plan.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can remove the routeSelectors in its own PR if you prefer (although not here), but either way adding the sectionName has no meaning without the task the computes the effect RLPs.

Please refer to #893 to see what's in there. Hopefully it will make more sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

adding the sectionName has no meaning without the task the computes the effect RLPs.

Completely disagree. Adding the sectionName and removing the routeSelectors is itself the point of this PR. And it can be done without computing the effective policies and without refactor to to the state of the world controller

Copy link
Contributor

Choose a reason for hiding this comment

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

@eguzki, I see your point, but we are doing the same work twice. The work in #893 is done already, and that branch targets this one in case you want to merge it in one go.

Redoing the same thing in this PR is a waste of your time IMO, first because it's done in there and it will all be part of the same change anyway, but more importantly to me because here it would be a change to the API without the counterpart function that uses this field.

That said, if you really want to work on some part of this particular change still in this PR, the only thing I ask is please do not add sectionName just yet. You can remove routeSelectors and all the logic related to it. I'm fine with rebasing mine. Np.

@eguzki
Copy link
Contributor Author

eguzki commented Oct 2, 2024

With all due respect, @guicassolato, do not change the scope of the issues that we had agree upon in the planning stage on your own. That's not nice. You could be doing some work that someone else had already done because it was enclosed on another issue. That's wasting someones time.

I will remove all the changes that you already did and open PR with only the version bump.

@guicassolato
Copy link
Contributor

guicassolato commented Oct 2, 2024

@eguzki,

I see where you are coming from. Indeed "Add sectionName field to targetRef" is listed in #810.

In the end, many of these tasks are convoluted I'm afraid. There's very little left to merging policies together without the sectionName and there is no reason to introduce sectionName other than for changing how we let policies target sections of the resources and consequently how we merge policy specs that add definitions only for those sections. IOW, sectionName and effective policies with D&O and merge strategies in context are all mixed together into one.

Unfortunately, the issues in GitHub do not do a great job at setting clearly the boundaries of what's one thing and what's another, especially in this case where lines are in fact blurred. We need more human communication to sync on this kind of stuff IMO.

Apologies if you have perceived as a change of plans. It was never my intention. I'm only trying to be proactive here. Last week we agreed on working on this part of the workflow together. You were kind enough to share a draft. I wanted to add the next bit.

@eguzki eguzki force-pushed the 810-ratelimitpolicy-v1beta3 branch 2 times, most recently from 125a5ff to 4cef480 Compare October 2, 2024 13:29
@eguzki eguzki marked this pull request as ready for review October 2, 2024 15:22
@eguzki
Copy link
Contributor Author

eguzki commented Oct 3, 2024

ready for rewiew @guicassolato

@eguzki eguzki force-pushed the 810-ratelimitpolicy-v1beta3 branch 2 times, most recently from 0152aa5 to 57d555b Compare October 4, 2024 11:23
Copy link
Contributor

@guicassolato guicassolato left a comment

Choose a reason for hiding this comment

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

Just need to sort out those couple unit tests failing due to now seeing the hostnames in the conditions to call the RL service, but the general change LGTM. In fact, very thorough job on removing the routeSelectors. Thank you, @eguzki!

@eguzki eguzki force-pushed the 810-ratelimitpolicy-v1beta3 branch from 57d555b to baf6e08 Compare October 4, 2024 12:41
Signed-off-by: Eguzki Astiz Lezaun <eastizle@redhat.com>
Signed-off-by: Eguzki Astiz Lezaun <eastizle@redhat.com>
Signed-off-by: Eguzki Astiz Lezaun <eastizle@redhat.com>
Signed-off-by: Eguzki Astiz Lezaun <eastizle@redhat.com>
Signed-off-by: Eguzki Astiz Lezaun <eastizle@redhat.com>
Signed-off-by: Eguzki Astiz Lezaun <eastizle@redhat.com>
Signed-off-by: Eguzki Astiz Lezaun <eastizle@redhat.com>
Signed-off-by: Eguzki Astiz Lezaun <eastizle@redhat.com>
Signed-off-by: Eguzki Astiz Lezaun <eastizle@redhat.com>
Signed-off-by: Eguzki Astiz Lezaun <eastizle@redhat.com>
@eguzki eguzki force-pushed the 810-ratelimitpolicy-v1beta3 branch from 45f6211 to bb71440 Compare October 7, 2024 07:53
@eguzki
Copy link
Contributor Author

eguzki commented Oct 7, 2024

rebase to resolve conflicts required and fixed integration tests.

please review @guicassolato Thanks 🙇‍♀️

Copy link
Contributor

@guicassolato guicassolato left a comment

Choose a reason for hiding this comment

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

Neat.

@eguzki eguzki merged commit c194aa4 into main Oct 7, 2024
32 checks passed
@eguzki eguzki deleted the 810-ratelimitpolicy-v1beta3 branch October 7, 2024 10:24
@eguzki
Copy link
Contributor Author

eguzki commented Oct 7, 2024

heads up @trepel @azgabur

This is breaking backward compat. More changes coming in!

@guicassolato guicassolato mentioned this pull request Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Changes user facing APIs kind/enhancement New feature or request size/medium
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

RateLimitPolicy v1beta3
2 participants