imDwAaY opened a new pull request, #7983: URL: https://github.com/apache/shenyu/pull/7983
Fixes #7978. ### Problem `AbstractShenyuPlugin.execute` handles a `FULL_FLOW` selector by taking `rules.get(rules.size() - 1)` and calling `doExecute` directly. `BaseDataCache` keeps every cached rule for the selector, including disabled ones, and the full-flow path never reaches `filterRule`, so a disabled highest-sort rule is executed. ### Fix - The full-flow branch now walks the rules from the end and executes the last rule whose `enabled` flag is `Boolean.TRUE`. - If no enabled rule remains, it delegates through `handleRuleIfNull`, matching the ordinary matching path. - Ordering semantics are unchanged: among enabled rules, the highest-sort rule still wins. - Condition evaluation for full-flow rules is unchanged, as called out in the issue. ### Tests Added three unit tests in `AbstractShenyuPluginTest`: - last rule disabled -> the previous enabled rule executes - all rules disabled -> `chain.execute` is invoked and `doExecute` never is - multiple enabled rules -> the highest-sort rule executes ### Validation - `./mvnw -pl shenyu-plugin/shenyu-plugin-base -am test -Dtest=AbstractShenyuPluginTest` -> 17 tests, 0 failures - full module suite (`shenyu-plugin-base -am`) -> 299 tests, 0 failures - `./mvnw -pl shenyu-plugin/shenyu-plugin-base checkstyle:check` -> 0 violations - mutation check: reverting the production change makes the new tests fail Make sure that: - [ ] You have read the [contribution guidelines](https://shenyu.apache.org/community/contributor-guide). - [x] You submit test cases (unit or integration tests) that back your changes. - [ ] Your local test passed `./mvnw clean install -Dmaven.javadoc.skip=true`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
