Visitar URL original
[type:refactor] externalize Hystrix to plugin-store by cloudbase-ai · Pull Request #7499 · apache/shenyu · GitHub
Skip to content

[type:refactor] externalize Hystrix to plugin-store - #7499

Merged
Aias00 merged 2 commits into
apache:masterfrom
cloudbase-ai:cloudbase/externalize-hystrix
Oct 9, 2026
Merged

Aias00 merged 2 commits into
apache:masterfrom
cloudbase-ai:cloudbase/externalize-hystrix

Conversation

@cloudbase-ai

@cloudbase-ai cloudbase-ai commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Problem And Result

Hand off hystrix ownership to apache/shenyu-plugin-store#9, which now includes original tests, fixtures, examples, deployment assets and SQL ownership manifests. Remove active plugin modules and owned assets from core once store delivery is ready. Shared schema DDL, generic APIs and complete historical upgrade SQL remain in core.

Receiving Assets And Validation

Ship db/plugins/<slug>/{h2,mysql,pg,og,ob,oracle}/preflight.sql and install.sql, row manifests, provenance and plugin-specific historical SQL archives. Metadata includes plugin definitions, selector/rule handles, menu resources, permissions and default-namespace relations. Run preflight before installation; repeat installs preserve existing plugin and namespace configuration. Full historical core upgrade files stay in main.

SQL provenance is recorded under the receiving db/plugins directories; original tests, examples and deployment fixtures retain their source layouts.

  • Preserved original HystrixPluginTest: 2 tests passed, 0 skipped, against the external store JAR. Fresh SQL preflight/config checks and Compose teardown passed.
  • CI invokes the original integration runner after building store runtime JARs.
  • Executed shipped SQL twice on H2, MySQL (default and NO_BACKSLASH_ESCAPES) and PostgreSQL; verified row identities, conflicts and configuration preservation. Native Oracle/OpenGauss/OceanBase execution remains unverified.

Cutover Gates

This PR remains draft. Receiving CI/release validation and externally available store artifacts must pass before merge. Receiving GitHub CI must complete before main cutover. Native Oracle/OpenGauss/OceanBase SQL execution remains a named validation gap. No upstream merge or Maven publication has been performed.

Core does not depend on store artifacts; deployments select optional external starters and apply the matching store metadata scripts.

Roadmap: #7306.

Signed-off-by: cloudbase-ai <22498243+cloudbase-ai@users.noreply.github.com>
import okhttp3.RequestBody;
import okhttp3.Response;
import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang3.RandomStringUtils;

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.

[NIT] This org.apache.commons.lang.RandomStringUtils -> org.apache.commons.lang3.RandomStringUtils swap looks unrelated to the Hystrix externalization, but it is almost certainly a necessary fix: removing the hystrix starter drops hystrix-core 1.5.18's transitive commons-lang (lang2) from this module's classpath, so the lang2 RandomStringUtils would no longer resolve. Harmless if lang2 is still transitively present via shenyu-common; correct if hystrix-core was its only lang2 provider here. Just confirming the intent is captured.

Aias00
Aias00 previously approved these changes Oct 9, 2026

@Aias00 Aias00 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.

Summary

This PR externalizes the Hystrix plugin out of the main repository: the runtime plugin (shenyu-plugin-hystrix) and its Spring Boot starter (shenyu-spring-boot-starter-plugin-hystrix) are removed, and every built-in reference to Hystrix in the default distribution is cleaned up. A migration doc (docs/plugin-store-hystrix.md) is added explaining how existing deployments opt back in via the external plugin-store starter.

The externalization is executed consistently and the repository still compiles cleanly. Verified:

  1. No dangling references to the removed code. A code search across the default branch returns 0 references to the removed artifact shenyu-spring-boot-starter-plugin-hystrix, and 0 references to the removed classes HystrixPlugin, HystrixCommand, HystrixBuilder, HystrixPluginDataHandler. The two reactor pom.xml files (shenyu-plugin-fault-tolerance/pom.xml and shenyu-spring-boot-starter-plugin/pom.xml) correctly drop the hystrix modules from <modules>, and the bootstrap / integrated-test-http / e2e shenyu-cm.yml dependencies are removed in lockstep.
  2. Compatibility contract is deliberately preserved, as stated in the new doc. At the PR head shenyu-common still ships HystrixHandle, HystrixIsolationModeEnum (and their tests), and PluginEnum.HYSTRIX (HYSTRIX(130, 0, "hystrix")). These let the external plugin-store and pre-existing admin rule data keep working during the cutover window — a reasonable, well-documented decision.
  3. Admin surface updated consistently. EnumServiceImpl.list() now filters PluginEnum.HYSTRIX out of pluginEnums and drops the hystrixIsolationModeEnums block; EnumServiceTest is updated to match (removed hystrixIsolationModeEnums from both the non-null-key and support-key streams).
  4. Seed data removed uniformly across all dialects. plugin (id 9), resource (1529402639284355099 and the 9 button rows ...5435654..5662), permission (...306626620 and ...76629888..896), and namespace_plugin_rel (...808282186 → plugin_id 9) rows are deleted from mysql, ob, og, oracle, pg, and the h2 admin schema, all consistently.
  5. LICENSE and fallback config cleaned. The three hystrix-* entries are removed from the dist LICENSE, and /fallback/hystrix is removed from application.yml and both shenyu-cm.yml files. A code search confirms no Java fallback mapping still references hystrix, so those path removals leave no dangling dispatch.

On CI

The check list shows many fail entries, but the sampled build (shenyu-integrated-test-http) job log ends with ##[error]The operation was canceled. — a cancellation, not a compile or test failure. The root build, Analyze (java), check-license-header, changes, and native-sql (pg/oracle/ob) jobs are green, and the failures span unrelated modules (apache-dubbo, grpc, combination, websocket, e2e-rabbitmq/rocketmq/grpc/springcloud, …). This is the standard infrastructure/cancellation pattern rather than a regression introduced by this PR. Please re-run before merging, but the red is not a reason to block.

Non-blocking suggestions

  • RELEASE-NOTES.md: Dropping a formerly built-in plugin from the default bootstrap distribution is a user-visible behavior change. The new docs/plugin-store-hystrix.md covers the cutover, but a short ### Behavior Changes entry under ## Unreleased in RELEASE-NOTES.md is the canonical signal downstream users watch for. Recommended to add.
  • HttpTestControllerTest.java import swap (org.apache.commons.lang.RandomStringUtils → org.apache.commons.lang3.RandomStringUtils): this looks unrelated to the Hystrix change at first glance, but it is almost certainly a necessary fix — removing the hystrix starter drops hystrix-core 1.5.18's transitive commons-lang (lang2) from this module's classpath, so the lang2 RandomStringUtils would no longer resolve. If commons-lang (lang2) is still available transitively via shenyu-common, the swap is harmless noise; otherwise it is the right fix. Either way it is fine; just confirming the intent is captured.
  • Historical website plugin docs: the new doc correctly describes the externalized plugin, but the existing ShenYu website plugin documentation still presents Hystrix as a built-in plugin. That is naturally the plugin-store repo's responsibility to migrate, so it is out of scope here — just flagging it as a follow-up so the two repos stay consistent after this lands.

Decision

Clean, consistent externalization with the compatibility contract intact and no dangling references. No blocking issues. Approved.

Signed-off-by: cloudbase-ai <22498243+cloudbase-ai@users.noreply.github.com>
@cloudbase-ai

Copy link
Copy Markdown
Contributor Author

Correction to the earlier review conclusion: H2 still contained namespace_plugin_rel id=1801816010882822186 with plugin_id=9 after the Hystrix plugin row was removed. Commit 84cf73a removes that orphan seed row. Static inspection of the current H2, MySQL, PostgreSQL, OpenGauss, OceanBase and Oracle init scripts found no remaining Hystrix plugin/plugin_handle/namespace_plugin_rel records and no orphan namespace relations. The supplied CI logs establish the null-name PLUGIN refresh failure; interruption before loading later plugins such as Divide remains an inference. Compilation and tests were not run, and CI recovery has not yet been verified. Admin/gateway defensive handling is outside this focused SQL fix.

@Aias00
Aias00 merged commit 6717830 into apache:master Oct 9, 2026
52 checks passed
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.

2 participants