Skip to content

[ISSUE #7592] Remove obsolete API-doc viewer backend and preserve API management - #7603

Merged
Aias00 merged 1 commit into
apache:masterfrom
yangjj-iso:fix/7592-remove-dead-apidoc
Oct 17, 2026
Merged

Aias00 merged 1 commit into
apache:masterfrom
yangjj-iso:fix/7592-remove-dead-apidoc

Conversation

@yangjj-iso

@yangjj-iso yangjj-iso commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #7592.
Closes #7593 through the removal option described in that issue.
Supersedes the alternative repair in #7601; these two approaches must not be merged together.

The selected approach retires the unused /apidoc viewer backend while retaining the current dashboard's database-backed API/tag management, Swagger import, MCP generation and request debugging. The missing legacy /apidoc/getDocItem endpoint is retired with its unused client helper. Existing /api/{id} detail access is preserved.

Companion frontend source change: apache/shenyu-dashboard#720

DocManagerImpl.listAll() reads a cache that is never populated. Remove ApiDocController, its test, the unused viewer response models, and the DOC_DEFINITION_MAP / listAll() contract. Keep addDocInfo, Swagger parsing/import, API-document registration, client registration, and MCP generation intact. Strengthen the registration test to check the published DTO, callback checksum, and unchanged-document handling.

Why the existing page and menu remain

The current dashboard page still provides database-backed API/tag management through /api and /tag, as well as Swagger import and request debugging. Its tree is loaded independently of the empty legacy cache. The legacy response also supplies debug environments that the page actively consumes. Deleting the entire page/menu as originally proposed would therefore remove working functionality.

The companion frontend change reads enabled environments from the existing /shenyu-dict/all/apidocEnv endpoint and removes the obsolete getDocMenus / getDocItem helpers. This PR preserves menu/permission records and ships the corresponding changes in the embedded dashboard. Only the API service and API-document page modules are replaced; the other 2,362 compiled modules remain byte-identical to the updated upstream bundle. Both replaced modules match the companion source PR #720 production build after normalizing local identifier names. The API service also matches the current upstream module after removing only the two legacy helpers.

For independently deployed dashboards, deploy the companion frontend change before upgrading the backend that removes /apidoc/getDocMenus.

Validation

  • Rebased onto upstream master at ad89a887a; this PR contains one scoped commit. Resolved the dashboard bundle conflicts while preserving the newer dashboard changes from chore: sync dashboard build artifacts #7620.
  • 41 focused Maven tests passed, with Checkstyle enabled, covering document registration/parsing, Swagger/MCP import, the API-doc subscriber, and API/tag/dictionary controllers.
  • ./mvnw -B -pl shenyu-admin apache-rat:check: passed.
  • Companion dashboard: 6 suites / 21 tests, changed-file ESLint, and production build passed.
  • Embedded bundle: JavaScript syntax, execution of the compiled enabled-environment mapping and empty-list case, preserved Swagger/MCP request routes, removal of legacy helpers, and the 2,364-module scope check passed. Only two modules differ from the latest upstream bundle.
  • New upstream CI has been triggered for the rebased head; results are pending. Full repository install and Docker integration/e2e suites were not run locally for this update.

Maven test command:

./mvnw -B -pl shenyu-admin -am test \
  -Dtest=DocManagerImplTest,SwaggerDocParserTest,SwaggerDocManagerImplTest,SwaggerImportServiceTest,SwaggerImportServiceImplTest,SwaggerImportControllerTest,ApiDocExecutorSubscriberTest,ShenyuDictControllerTest,ApiControllerTest,TagControllerTest \
  -Dsurefire.failIfNoSpecifiedTests=false \
  -Dmaven.javadoc.skip=true -Djacoco.skip=true
  • Read the contribution guidelines.
  • Submit test cases that back the changes.
  • Full local ./mvnw clean install -Dmaven.javadoc.skip=true passed (focused validation above).

Aias00
Aias00 previously approved these changes Oct 15, 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: APPROVE

This cleanly implements the obsolete API-doc viewer removal while preserving API management, exactly as scoped in #7592.

What's good

  • Removes only the viewer surface: ApiDocController (/apidoc endpoint), the viewer VO classes (DocVO, MenuDocItemVO, MenuModuleVO, MenuProjectVO), DocManager/DocManagerImpl (whose DOC_DEFINITION_MAP had zero put calls — dead state), and the corresponding tests.
  • API document management (Swagger import, metadata) is preserved — the only test change outside deletion is removing the DocManager.listAll() override stub from a mock inner class in SwaggerImportServiceImplTest, which is the correct cleanup once the interface is gone.
  • Frontend bundle is renamed index.c7270c38.js → index.1d06dc68.js (rebuilt without the viewer) and index.html references the new hash, so the admin SPA still loads.

Verification

  • Analyze (java) and every build (shenyu-integrated-test-*) pass — this is strong evidence the deletion left no dangling references in the committed tree (any orphaned import would fail compilation).

Non-blocking note

  • If any downstream/docs reference to /apidoc/getDocMenus exists (e.g. dashboard or release notes), double-check it was also removed. Not a blocker for this PR.

Clean, well-scoped, and CI-confirmed safe — approving.

@Aias00

Aias00 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

@yangjj-iso This PR currently has merge conflicts with master (the merge commit cannot be cleanly created) and cannot be merged.

Please rebase onto the latest master and resolve the conflicts, then ensure CI passes. Once resolved it can be merged. Thanks!

@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

Removes the obsolete API-doc viewer backend (#7592) while preserving API management: deletes ApiDocController, DocVO, MenuDocItemVO, trims MenuModuleVO / MenuProjectVO / DocManager / DocManagerImpl and their tests, and regenerates the admin static assets (index.html, hashed JS bundle).

Verification

  • pr_build passes → no dangling references to the removed classes or /apidoc endpoints remain in the codebase.
  • Analyze (java), check-license-header, rat_check, scope, sql-matrix, registry_dependencies all pass.

Notes (non-blocking)

  • As a removal PR, worth a confirmation that the removed /apidoc viewer endpoints were not part of a documented public admin API contract.

Conclusion

APPROVE.

@Aias00
Aias00 merged commit 5f35cb0 into apache:master Oct 17, 2026
54 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

2 participants