SouthwestAsiaFloat opened a new pull request, #717:
URL: https://github.com/apache/shenyu-dashboard/pull/717
### Motivation
Provide a Dashboard interface for configuring upstream labels and Divide
canary routing, allowing users to manage routing conditions, traffic
percentages, and partition policies without manually editing JSON.
### Changes
- Add upstream label editing, including creating, updating, deleting, and
displaying existing labels.
- Reuse shared Props serialization across the relevant pages, preserving
existing `warmupTime`, `gray`, and other extension fields when saving labels.
- Add a Canary configuration editor to Divide rules, supporting:
- Enabling or disabling Canary routing and setting the traffic percentage.
- Request conditions with AND/OR matching.
- Sticky key sources and parameter names.
- Stable and Canary partition labels.
- Falling back to Stable or rejecting requests when the Canary pool is
empty.
- Reuse existing parameter-type and operator dictionaries, and add English
and Chinese translations.
- Validate percentages, required parameters, duplicate label keys, and
mutually exclusive partition labels. Prevent submission while a label row is
still being edited.
- Preserve compatibility with existing rules: saving a rule without adding
Canary configuration does not inject a Canary field, and existing extension
fields are retained.
### Additional fix
This branch also fixes a Dashboard startup failure caused by the `mcpServer`
model missing its initial state. It adds `state: {}` and a dva application
startup regression test.
### Validation
- `npm run test:unit`: all 311 tests across 60 suites passed.
- `NODE_OPTIONS=--openssl-legacy-provider npm run build`: production build
passed.
- Completed browser-based validation against the current Admin and Gateway,
including saving configuration, reopening it, and verifying actual HTTP routing:
- A 0% configuration routes requests to Stable; 100% routes requests to
Canary.
- Requests that do not match the conditions enter Stable.
- Removing or restoring upstream labels updates actual routing.
- Duplicate label keys and potentially overlapping partition
configurations are rejected.
- Saving labels preserves other Props extension fields.
- Saving legacy rules does not add Canary configuration, and existing
forwarding continues to work.
- All 100 formal HTTP requests in this regression run succeeded and reached
the expected upstream nodes.
### Backend dependency
This PR accompanies the upstream-label and Canary-routing changes in ShenYu.
Using the new configuration requires an Admin and Gateway version that supports
these capabilities.
--
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]