-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[backport 3.5]feat(router/atc): http segments matching and other improvements #12397
Conversation
5c96d34
to
0b38029
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 🚀
I double checked commits & PRs so I don't have any other comments than those described here: #12400 (review)
I have double checked PRs that need to be cherry-picked TODO: I'll assist with running perf test on release/3.5.x after this PR is merged. |
…pressions` flavor (#11905) `traditional_compatible` flavor remains case insensitive to stay compatible with `traditional` flavor. This change allow `expressions` route authors to pick whether they want case sensitive or insensitive matches. KAG-2905 --------- Co-authored-by: Datong Sun <[email protected]>
…ssions router schema (#11914) KAG-2961 --------- Co-authored-by: Datong Sun <[email protected]>
…outer (#12127) Cache key and context generation are closely related on field present inside configured expressions. It is advantageous to unify the logic for generating them to: 1. Improve cache hit rate, so that only fields referenced inside expressions participates in cache key generation. This is particularly important since we plan on adding more match fields into expressions in the future 2. Improve performance, allows field value to be cached and reused between cache key and context generation 3. Reduced code duplication KAG-3032
Fix `03-http-log/01-log_spec.lua` Fix `13-cors/01-access_spec.lua` Fix `spec/03-plugins/03-http-log/01-log_spec.lua`
Full changelog: https://github.com/Kong/atc-router/releases/tag/v1.5.1 This primarily contains the small Bazel change which reduced artifact size by 50%. Thanks @ADD-SP for the work.
This field represents how much segments the request path contains. For example, "/a/b/c/" contains 3 segments, "/a" contains 1 and "/" contains 0 segment. It is useful for implementing segment based routing logic such as these used in OpenAPI spec. KAG-3604
… field (#12406) KAG-3604 --------- Co-authored-by: Datong Sun <[email protected]>
…ot" operator support in ATC (#12405) KAG-3605 --------- Co-authored-by: Datong Sun <[email protected]>
* perf(router): use static functions for callbacks Signed-off-by: Aapo Talvensaari <[email protected]> * tuning some code * style clean * style clean * style clean --------- Signed-off-by: Aapo Talvensaari <[email protected]> Co-authored-by: chronolaw <[email protected]>
0b38029
to
24480f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a backport, I'm OK with the change. Just leaving some comments about namings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The naming is over-generized. The functions in it are just for conversion between naming conventions. Please consider renaming this file and the functions.
We cannot tell what the function does by its name: replace dashes for what?
local PREFIX_LEN = 13 -- #"http.headers." | ||
local HTTP_HEADERS_PREFIX = "http.headers." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
local PREFIX_LEN = 13 -- #"http.headers." | |
local HTTP_HEADERS_PREFIX = "http.headers." | |
local HTTP_HEADERS_PREFIX = "http.headers." | |
local PREFIX_LEN = #"http.headers." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I will do it later.
@@ -19,8 +24,35 @@ local PROTOCOLS_OVERRIDE = { | |||
} | |||
|
|||
|
|||
local function get_exp_and_priority(route) | |||
-- net.port => net.dst.port | |||
local function transform_expression(route) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about naming this function "migrate_deprecated_variables"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will have more transform actions in the future, not only for migration.
HTTP_SCHEMA = generate_schema(fields.HTTP_FIELDS) | ||
STREAM_SCHEMA = generate_schema(fields.STREAM_FIELDS) | ||
|
||
-- used by running router | ||
CACHED_SCHEMA = is_http and HTTP_SCHEMA or STREAM_SCHEMA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems one of those is not used. Is it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, HTTP_SCHEMA and STREAM_SCHEMA will be used by validation.
Summary
KAG-3586
git cherry-pick 59670a1 #11721
git cherry-pick 5f5e272 #11904
git cherry-pick 6ce1262 #11905
git cherry-pick 12f45ad #11914
git cherry-pick 12f45ad #11948
git cherry-pick c9fd6c1 #12127
git cherry-pick 8c2b5a4 #12258
git cherry-pick 86f0a6c #12261, fixing *.test
git cherry-pick f49abd6 #12180, fixing *.test (https://github.com/Kong/kong/pull/12268/files#diff-50dcfdce82665f85d2027363af6956fc788e5b8f6c6b8de907e9bd82e8871501)
git cherry-pick 11d7639 #12266
git cherry-pick 560fdfb #11950
git cherry-pick ce12f68 #12307, fixing *.test
git cherry-pick 9305665 #12283
git cherry-pick ef87932 #12378
Checklist
changelog/unreleased/kong
orskip-changelog
label added on PR if changelog is unnecessary. README.mdIssue reference
Fix #[issue number]