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

feat: WebAssembly filter chains #362

Merged
merged 10 commits into from
Apr 1, 2024
Merged

feat: WebAssembly filter chains #362

merged 10 commits into from
Apr 1, 2024

Conversation

hishamhm
Copy link
Contributor

@hishamhm hishamhm commented Jul 28, 2023

This PR introduces the FilterChains entity, a new entity released in Kong Gateway 3.4 (OSS and Enterprise) to manage WebAssembly filters ("filters" are the WebAssembly analog to Lua plugins — we call them filters because it's the already-established terminology used by the proxy-wasm API we implemented, which is also implemented by other WebAssembly-enabled gateways such as Envoy).


KAG-4005
KOKO-1274

@codecov-commenter
Copy link

codecov-commenter commented Jul 28, 2023

Codecov Report

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

Project coverage is 59.34%. Comparing base (241dbb8) to head (2ee7cad).

Files Patch % Lines
kong/filter_chain_service.go 61.97% 27 Missing and 27 partials ⚠️
kong/filter_chain.go 0.00% 6 Missing ⚠️
kong/consumer_group_consumer_service.go 60.00% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #362      +/-   ##
==========================================
+ Coverage   59.32%   59.34%   +0.01%     
==========================================
  Files          69       71       +2     
  Lines        4219     4378     +159     
==========================================
+ Hits         2503     2598      +95     
- Misses       1134     1170      +36     
- Partials      582      610      +28     
Flag Coverage Δ
2.1 35.60% <0.61%> (-1.32%) ⬇️
2.2 48.21% <1.22%> (-1.80%) ⬇️
2.3 48.85% <1.22%> (-1.82%) ⬇️
2.4 48.90% <1.22%> (-1.82%) ⬇️
2.5 48.90% <1.22%> (-1.82%) ⬇️
2.6 48.90% <1.22%> (-1.82%) ⬇️
2.7 50.61% <4.90%> (-1.82%) ⬇️
2.8 50.61% <4.90%> (-1.82%) ⬇️
3.0 54.56% <4.90%> (-1.97%) ⬇️
3.1 56.21% <4.90%> (-2.03%) ⬇️
3.2 56.25% <4.90%> (-2.03%) ⬇️
3.3 56.25% <4.90%> (-2.03%) ⬇️
3.4 58.65% <60.73%> (+0.04%) ⬆️
community 43.30% <56.44%> (+0.54%) ⬆️
enterprise 57.94% <60.73%> (+0.06%) ⬆️
integration 59.34% <60.73%> (+0.01%) ⬆️

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.

@hishamhm hishamhm force-pushed the feat/filter-chains branch 2 times, most recently from ba69f3f to 982daa2 Compare July 28, 2023 15:11
@hishamhm
Copy link
Contributor Author

Regarding the failing test: we probably need KONG_WASM=on set on the 3.4/nightly tests for the filter chain operations to work, and probably KONG_WASM_FILTERS_PATH=filters/ as well, containing a dummy filters/example-filter.wasm

@CLAassistant
Copy link

CLAassistant commented Mar 20, 2024

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@flrgh
Copy link
Contributor

flrgh commented Mar 20, 2024

CI problems...

The nightly tests were using an old tag (master-alpine), so those tests were broken for filter chains. I updated this to master. However, now some other tests are failing now that they are being executed against a real nightly image:

=== RUN   TestFillPluginDefaults/no_config_no_protocols
    plugin_service_test.go:671:   &kong.Plugin{
          	... // 6 identical fields
          	Consumer:      nil,
          	ConsumerGroup: nil,
          	Config: kong.Configuration{
          		"anonymous":        nil,
          		"hide_credentials": bool(false),
        - 		"realm":            string("service"),
          	},
          	Enabled: &true,
          	RunOn:   &"test",
          	... // 3 identical fields
          }

@flrgh flrgh marked this pull request as ready for review March 20, 2024 17:36
@flrgh flrgh requested a review from a team as a code owner March 20, 2024 17:36
@flrgh flrgh requested a review from a team March 20, 2024 17:36
@flrgh flrgh changed the title feat: WebAssembly filter chains, coming in Kong Gateway 3.4 feat: WebAssembly filter chains Mar 20, 2024
@flrgh flrgh force-pushed the feat/filter-chains branch 2 times, most recently from a846c8c to 70da1db Compare March 25, 2024 17:07
@flrgh
Copy link
Contributor

flrgh commented Mar 25, 2024

Lint fixes are in #421

kong/plugin_service_test.go Outdated Show resolved Hide resolved
@flrgh flrgh force-pushed the feat/filter-chains branch 4 times, most recently from d0e1d08 to 2ee7cad Compare March 26, 2024 23:28
@flrgh
Copy link
Contributor

flrgh commented Mar 26, 2024

I had to fix a host of testing problems in order to get CI working against Kong nightly/master, so there are a bunch of additional commits in this PR. I can move them to another PR if desired.

@flrgh
Copy link
Contributor

flrgh commented Mar 26, 2024

@hishamhm who is a good person to tag for review on this?

flrgh and others added 6 commits April 1, 2024 10:08
A new `realm` field was recently added to the basic-auth plugin:

Kong/kong#11795

To address this I added version awareness to the test cases.
The dev portal is deprecated and now requires a special secret to
enable, so it is no longer feasible to test this in nightly (>=3.7).

Kong/kong-ee#6812
Copy link
Contributor

@rainest rainest left a comment

Choose a reason for hiding this comment

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

The consumer groups stuff should have probably gone in separately but otherwise the new entity looks fine.

@flrgh flrgh merged commit 8f4d15c into main Apr 1, 2024
67 checks passed
@flrgh flrgh deleted the feat/filter-chains branch April 1, 2024 23:11
@pmalek
Copy link
Member

pmalek commented Apr 3, 2024

#362 (comment) is being addressed in #432

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants