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

[type:refactor] externalize Casdoor to plugin-store - #7500

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

Aias00 merged 3 commits into
apache:masterfrom
cloudbase-ai:cloudbase/externalize-casdoor

Conversation

@cloudbase-ai

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

Copy link
Copy Markdown
Contributor

Problem And Result

Hand off casdoor ownership to apache/shenyu-plugin-store#10, 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.

  • 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 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>
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.

Review: externalize Casdoor to plugin-store

Externalizing the Casdoor runtime plugin + Spring Boot starter to the plugin-store repo is the right direction and this PR executes it cleanly. I verified the build-critical pieces rather than assuming:

What is correct

  • No dangling compile references. Searching the default branch for the removed artifact (shenyu-spring-boot-starter-plugin-casdoor) and the removed classes (CasdoorPlugin, CasdoorConfig, CasdoorPluginDateHandler) returns 0 references. Both reactor poms correctly drop the shenyu-plugin-casdoor module and the bootstrap/starter poms drop the dependency.
  • Compatibility contract is preserved. PluginEnum.CASDOOR (40, "casdoor") is intentionally kept at head, and EnumServiceImpl now filters it out of the admin pluginEnums list via pluginEnum != PluginEnum.CASDOOR. The new docs/plugin-store-casdoor.md documents this explicitly (same plugin name/order/fields, and the downstream headers name/id/organization that the former in-tree CasdoorPlugin.handleToken injected — confirmed against the deleted source).
  • Five production SQL dialects are correctly cleaned. mysql, ob, og, oracle, pg each delete the casdoor plugin row (id 39), all 6 plugin_handle rows, the permission/resource rows, and the namespace_plugin_rel row (1801816010882822176), consistently.
  • License / SDK cleanup is consistent. casdoor-java-sdk 1.9.0 is removed from the root pom.xml property, the bootstrap-dist LICENSE, and the deleted module pom.

Issues

  1. [MUST-FIX before merge — shenyu-admin/src/main/resources/sql-script/h2/schema.sql] The h2 schema deletes only one of the six casdoor plugin_handle rows (the endpoint/1570590990341775360 row) and leaves five orphaned rows (client_id, client_secrect, certificate, organization-name, application-name, all plugin_id = '39') behind. The plugin row for id 39 is gone, so these rows reference a plugin that no longer exists in that schema. Every other dialect (mysql/ob/og/oracle/pg) removes all six. h2 is the embedded/dev/admin-test database, so this is the one schema that admin actually boots against in dev/test — leaving stale plugin_handle rows will surface casdoor config fields in the admin UI/API for a plugin that isn't shipped. Please delete the remaining five rows so h2 matches the other five dialects.

  2. [INFRA — not a regression] The CI is red, but the failures are broad and span entirely unrelated plugins — ShenyuClientPathControllerTest, SentinelPluginTest, ParamMappingPluginTest, CachePluginTest, Resilience4JPluginTest, CryptorRequestPluginTest, JwtPluginTest, plus the cross-cutting e2e-* and shenyu-integrated-test-* suites. None of these touch Casdoor (an authentication plugin), and the identical set failed on the sibling Hystrix externalization PR #7499 with The operation was canceled. This is the current CI-infrastructure instability, not a code regression from this PR. Recommend re-running the suite before merge, but it should not block review.

  3. [NON-BLOCKING follow-up] The historical website plugin docs still present Casdoor as a built-in plugin. That cleanup belongs to the plugin-store repo's migration scope (same as Hystrix), so it is out of scope here — just flagging for tracking.

Verdict: Approved. The only change I ask for before merge is the h2 plugin_handle cleanup in item 1; everything else is consistent and correct. Great work keeping the compat contract and migration doc in place.

INSERT IGNORE INTO plugin_handle (`id`, `plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES ('1529402613204172777', '38', 'ttl', 'ttl', 3, 3, 10, '{"required":"0","defaultValue":"30"}');

INSERT IGNORE INTO plugin_handle (`id`, `plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES ('1570590990341775360', '39', 'endpoint', 'casdoor endpoint', 2, 3, 0, '{"required":"1","rule":""}');
INSERT IGNORE INTO plugin_handle (`id`, `plugin_id`,`field`,`label`,`data_type`,`type`,`sort`,`ext_obj`) VALUES ('1570591047635968000', '39', 'client_id', 'client_id', 2, 3, 0, '{"required":"1","rule":""}');

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.

[MUST-FIX] The h2 schema deletes only the casdoor endpoint plugin_handle row (1570590990341775360) but leaves five orphaned rows referencing plugin_id='39' (client_id, client_secrect, certificate, organization-name, application-name). The casdoor plugin row (id 39) is removed above, so these rows point at a plugin that no longer exists in this schema. Every other dialect (mysql/ob/og/oracle/pg) deletes all six casdoor plugin_handle rows. h2 is the embedded/dev/admin-test database, so stale plugin_handle rows will surface casdoor config fields in the admin for a plugin that is no longer shipped. Please delete the remaining five rows so h2 matches the other five dialects.

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

Copy link
Copy Markdown
Contributor Author

Fixed the same H2 seed-cleanup gap identified in #7499. Commit ffe4ac4 removes the orphan Casdoor namespace_plugin_rel row (id=1801816010882822176, plugin_id=39) and five remaining Casdoor plugin_handle rows from the H2 init script. All six removed rows are already present in the plugin-store Casdoor H2 installer. Static inspection of H2, MySQL, PostgreSQL, OpenGauss, OceanBase and Oracle init scripts now finds no Casdoor plugin/plugin_handle/namespace_plugin_rel records and no orphan namespace relations. git diff --check passed. Compilation and tests were not run; CI recovery has not been verified.

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

Copy link
Copy Markdown
Contributor Author

Resolved all 11 conflicted files against master e24fb00 in merge commit 1a095e3. Preserved the prior H2 seed fix, the upstream plugin cutovers and RabbitMQ CI scheduling fix, and the Agent Gateway version resource. Combined EnumServiceImpl filters so both Hystrix and Casdoor remain excluded from the Admin plugin enum list. Six-dialect static inspection confirms only Casdoor-owned SQL statements are removed relative to master, all other SQL is preserved and no orphan namespace relations remain. Changed POM XML parses and git diff --check passes. The previous CI failure at https://github.com/apache/shenyu/actions/runs/37885804565/job/113676515613 was a RocketMQ access-log consumption timeout (1 of 4 tests failed); its root cause is not established by the inspected logs and is not claimed fixed by this conflict resolution. No compilation, tests or CI reruns were performed; the new CI result remains unverified.

@Aias00
Aias00 merged commit 34ab4c4 into apache:master Oct 9, 2026
51 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