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

Support HTTPQueryParamMatch as CEL routeRuleConditions #981

Merged
merged 4 commits into from
Nov 7, 2024

Conversation

alexsnaps
Copy link
Member

No description provided.

// from https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/advanced/attributes
// request.query -> string : The query portion of the URL in the format of “name1=value1&name2=value2”.
// query param, only consider the first in case of repetition, as per spec
queryParams := make(map[gatewayapiv1.HTTPHeaderName]bool)
Copy link
Member Author

Choose a reason for hiding this comment

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

Dunno if that's idiomatic Go...

Copy link
Collaborator

Choose a reason for hiding this comment

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

its fine, I think you would find most use queryParams := map[gatewaypiv1.HTTPHeaderName]bool{} but I don't think it is that important

Copy link
Collaborator

@maleck13 maleck13 left a comment

Choose a reason for hiding this comment

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

code looks ok, but will leave it to someone more familar with the impact of this to approve

@alexsnaps alexsnaps marked this pull request as ready for review November 6, 2024 20:12
@alexsnaps
Copy link
Member Author

So I don't know how this makes math... but there is no way this introduces a regression in test coverage as it tests my additions as well as code that wasn't test before...

Go home codecov, You're drunk!

Copy link

codecov bot commented Nov 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.10%. Comparing base (cc1b41f) to head (61661d2).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #981      +/-   ##
==========================================
- Coverage   76.15%   76.10%   -0.05%     
==========================================
  Files         111      111              
  Lines        8986     8998      +12     
==========================================
+ Hits         6843     6848       +5     
- Misses       1852     1853       +1     
- Partials      291      297       +6     
Flag Coverage Δ
bare-k8s-integration 10.86% <0.00%> (-0.02%) ⬇️
controllers-integration 58.66% <12.50%> (-0.20%) ⬇️
envoygateway-integration 32.47% <12.50%> (-0.04%) ⬇️
gatewayapi-integration 13.40% <0.00%> (-0.03%) ⬇️
istio-integration 34.06% <12.50%> (-0.27%) ⬇️
unit 25.81% <100.00%> (+0.44%) ⬆️

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

Components Coverage Δ
api/v1beta1 (u) 92.18% <100.00%> (ø)
api/v1beta2 (u) ∅ <ø> (∅)
pkg/common (u) 87.67% <ø> (ø)
pkg/istio (u) 47.03% <ø> (ø)
pkg/log (u) 93.18% <ø> (ø)
pkg/reconcilers (u) ∅ <ø> (∅)
pkg/rlptools (u) ∅ <ø> (∅)
controllers (i) 84.18% <85.36%> (-0.25%) ⬇️
Files with missing lines Coverage Δ
pkg/wasm/utils.go 90.32% <100.00%> (+7.78%) ⬆️

... and 9 files with indirect coverage changes

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.

🏅

@eguzki
Copy link
Contributor

eguzki commented Nov 7, 2024

Depends on Kuadrant/wasm-shim#126

@eguzki eguzki merged commit a46de69 into main Nov 7, 2024
34 checks passed
@eguzki eguzki deleted the cel_query_params branch November 7, 2024 11:35
@eguzki eguzki added the kind/enhancement New feature or request label Nov 7, 2024
maleck13 pushed a commit that referenced this pull request Nov 13, 2024
* Support HTTPQueryParamMatch as CEL routeRuleConditions

Signed-off-by: Alex Snaps <[email protected]>

* By default decodeQueryString will now ignore repeated params

Signed-off-by: Alex Snaps <[email protected]>

* By default queryMap will now ignore repeated params

Signed-off-by: Alex Snaps <[email protected]>

* Test for mapping `HTTPRouteMatch` to CEL Predicates

Signed-off-by: Alex Snaps <[email protected]>

---------

Signed-off-by: Alex Snaps <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants