Skip to content

feat(router): add affinity and script resource contracts - #1552

Merged
robocanic merged 3 commits into
apache:developfrom
xiaobaicai66695:feat/affinity-script-resource-contract
Oct 17, 2026
Merged

robocanic merged 3 commits into
apache:developfrom
xiaobaicai66695:feat/affinity-script-resource-contract

Conversation

@xiaobaicai66695

@xiaobaicai66695 xiaobaicai66695 commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Related issue

Related to #1547.

Summary

  • add resource contracts and codecs for affinity and script router rules
  • register rule suffixes and version normalization support
  • cover YAML/resource conversion behavior

Testing

  • go test ./pkg/core/resource/apis/mesh/v1alpha1

Notes

This is the first PR in a stacked series. Follow-up PRs add config-center propagation, Console APIs, the Vue UI, and E2E coverage.

@robocanic

Copy link
Copy Markdown
Contributor

yangrui

@AsperforMias AsperforMias left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Against #1547, this PR only covers the resource and YAML contract. Kinds, suffixes, affinityAware, v3.1, and the pre-write checks are in place. Config center, API, UI, and E2E belong in the follow-ups.

What blocks this is enabled / runtime. If those keys are missing, a read-back that gets published again writes them as false and turns off a rule that is currently active. Details on the lines below.

@xiaobaicai66695

Copy link
Copy Markdown
Contributor Author

@AsperforMias need review

@sonarqubecloud

Copy link
Copy Markdown

@AsperforMias

Copy link
Copy Markdown
Contributor

LGTM for the resource/YAML-codec scope at d9a60d1.

Rechecked boolean field presence, non-empty rule validation, and the Affinity/Script nil-Spec guards. The package tests, race check, and my original nil-Spec reproducer all pass:

go test ./pkg/core/resource/apis/mesh/v1alpha1 ./pkg/common/constants
go test -race ./pkg/core/resource/apis/mesh/v1alpha1

The Script execution timeout remains tracked separately in apache/dubbo-go#3566 / apache/dubbo-go#3575. The configuration-center path-precedence and API/history findings remain with #1553 and #1554. This LGTM applies to #1552's resource/codec scope.

@AsperforMias

Copy link
Copy Markdown
Contributor

@robocanic this seems enough LGTM for me, ask for check this guy's this pr

@robocanic
robocanic merged commit 288511b into apache:develop Oct 17, 2026
6 checks passed
@xiaobaicai66695
xiaobaicai66695 deleted the feat/affinity-script-resource-contract branch October 19, 2026 12:35
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.

3 participants