-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat: Add dependency protocol checking and deletion checking for stream routing #12794
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
base: master
Are you sure you want to change the base?
Conversation
…am routing Signed-off-by: Orician <2018783812@qq.com>
…eanup. Fixed status code check in pingpong test to ensure correct error message is output when 400 error is returned 1. Update TEST 15 to expect 400 when creating a route with a non-existent superior_id, reflecting the new validation logic. 2. Add TEST 22 to clean up created stream routes after tests to prevent Etcd data pollution affecting subsequent tests (e.g., redis.t). Signed-off-by: Orician <2018783812@qq.com>
|
Modified |
…quest body is missing The plugin now returns HTTP 400 (HTTP_BAD_REQUEST) when the request body is missing instead of just logging a warning and continuing. This prevents unnecessary upstream requests when the client fails to provide a request body. TEST 4 in ai-request-rewrite2.t was updated to expect status 400 instead of 200 when sending a POST request without a body. Signed-off-by: Orician <2018783812@qq.com>
Add TEST 5 cleanup to delete the route created in the test suite, preventing etcd data pollution that could affect subsequent tests. This follows the same pattern used in t/xrpc/pingpong.t.
|
|
…st expectation to 200
4ca5e42 to
c07855a
Compare
| ngx.say("failed: unexpected body: ", body) | ||
| return | ||
| end | ||
| ngx.say("passed") |
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's best to check the error message returned by the original admin API here.
Sync feature branch with latest master changes to perform up-to-date testing in the local environment.
…thorizations returned as arrays (matching "Authorization": ["hello"])
CI test failure occurred in the job: Error log details: Error: 2025/12/12 06:10:14 [error] 95223#95223: *1 [lua] config_etcd.lua:602: load_full_data(): failed to check item data of [/apisix/routes] err:object matches none of the required: ["plugins","uri"] or ["upstream","uri"] or ["upstream_id","uri"] or ["service_id","uri"] or ["plugins","uris"] or ["upstream","uris"] or ["upstream_id","uris"] or ["service_id","uris"] or ["script","uri"] or ["script","uris"] ,val: {"priority":0,"status":1,"uri":"/2"}, context: init_worker_by_lua*Root cause analysis: The CLI test script issue: #12815 |
|
During the last CI test run, I noticed that the Therefore, I modified the expected response in However, in today's CI test run, Should we revert the expected response back to |
|
Hi @yixianOu, without any logical changes, we cannot make tests pass by modifying the test code. All test-related modifications in a PR must revolve around the functionality of the PR itself; irrelevant modifications should not be included. I addressed a portion of the issues in CI at #12805. Have you merged that part of the code? |
|
https://github.com/apache/apisix/actions/runs/20190600057/job/58037592121?pr=12794
|
Signed-off-by: Orician <2018783812@qq.com>
Description
This PR implements dependency protocol checking and deletion protection for stream routes, resolving #6939.
Previously, it was possible to create a subordinate stream route referencing a non-existent
superior_idor a superior route with a mismatched protocol. Additionally, superior routes could be deleted even while being referenced by subordinate routes, leading to potential runtime errors.Checklist
Changes
check_confto ensure that when asuperior_idis provided:delete_checkerto prevent the deletion of a stream route if it is currently referenced as asuperior_idby other routes.t/admin/stream-routes-subordinate.tcovering various scenarios including creation, protocol mismatch, and deletion protection.Related Issue
Resolves #6939
Sign-off
Signed-off-by: Orician 2018783812@qq.com