shenyu icon indicating copy to clipboard operation
shenyu copied to clipboard

[Feature] Export selected divide http selector configurations

Open PoisonGodv opened this issue 4 weeks ago • 0 comments

Feature Request

Provide a backend API for exporting explicitly selected divide HTTP selectors and the configuration dependencies needed by the existing ZIP importer. The prototype and scope discussion are in draft PR #8296.

Is your feature request related to a problem? Please describe

A full namespace export includes unrelated routes when an operator only wants to move a selected group, such as the /orders routes without /users. Manually assembling selector/rule records can omit discovery, upstream or schema dependencies. This is a narrower configuration-migration capability than the broader cross-environment suggestions in #5030.

Describe the solution you'd like

The draft proposes POST /configs/exportBySelectors with a source namespace and 1–100 distinct selector IDs. It reuses the existing export permission and selector/rule read checks, emits the existing ZIP section format, and includes the selected routes, plugin/namespace configuration, field/dictionary definitions and supported local HTTP discovery dependencies.

The first version is bounded to exclusive selector-level local discovery with static HTTP/HTTPS upstreams and a clean target. It rejects external/shared/global/RPC discovery, custom plugin JARs, ambiguous relations and non-null Canary configurations. It preserves existing full exporters and importer reuse/skip behavior. It does not automatically infer other plugins' service policies or guarantee atomic migration between running Admin instances.

Archive budgets are 1,000 configuration objects and 10 MiB of uncompressed UTF-8 JSON. The latest test-only update covers exact object/byte boundaries; the draft documents its actual local validation and limits.

Describe alternatives you've considered

Use the current namespace export and manually remove unrelated configuration, or configure the target routes manually. Both require careful dependency handling. A broader collision-planning/import-preview capability is tracked separately in #8192.

Additional context

#5492/#5493 already established discovery dependencies in exports; this proposal adds selection rather than claiming that historical fix as new work. The API, supported boundary and collision policy remain proposals for normal maintainer review in #8296. AI tools assisted with the prototype, tests and this description; no maintainer acceptance is claimed.

PoisonGodv avatar Nov 04 '26 06:11 PoisonGodv