Skip to content

OSPP feat(dashboard): add upstream label and Divide canary configuration editors - #717

Open
SouthwestAsiaFloat wants to merge 3 commits into
apache:masterfrom
SouthwestAsiaFloat:ospp2662f0084
Open

SouthwestAsiaFloat wants to merge 3 commits into
apache:masterfrom
SouthwestAsiaFloat:ospp2662f0084

Conversation

@SouthwestAsiaFloat

Copy link
Copy Markdown

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 branch has not been deployed

No deployments
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.

1 participant