Repository navigation
[ISSUE #7592] Remove obsolete API-doc viewer backend and preserve API management - #7603
Conversation
Aias00
left a comment
There was a problem hiding this comment.
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(/apidocendpoint), the viewer VO classes (DocVO,MenuDocItemVO,MenuModuleVO,MenuProjectVO),DocManager/DocManagerImpl(whoseDOC_DEFINITION_MAPhad zeroputcalls — 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 inSwaggerImportServiceImplTest, which is the correct cleanup once the interface is gone. - Frontend bundle is renamed
index.c7270c38.js→index.1d06dc68.js(rebuilt without the viewer) andindex.htmlreferences the new hash, so the admin SPA still loads.
Verification
Analyze (java)and everybuild (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/getDocMenusexists (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.
|
@yangjj-iso This PR currently has merge conflicts with Please rebase onto the latest |
3683ce1 to
3b8a926
Compare
Aias00
left a comment
There was a problem hiding this comment.
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_buildpasses → no dangling references to the removed classes or/apidocendpoints remain in the codebase.Analyze (java),check-license-header,rat_check,scope,sql-matrix,registry_dependenciesall pass.
Notes (non-blocking)
- As a removal PR, worth a confirmation that the removed
/apidocviewer endpoints were not part of a documented public admin API contract.
Conclusion
APPROVE.
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
/apidocviewer backend while retaining the current dashboard's database-backed API/tag management, Swagger import, MCP generation and request debugging. The missing legacy/apidoc/getDocItemendpoint 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. RemoveApiDocController, its test, the unused viewer response models, and theDOC_DEFINITION_MAP/listAll()contract. KeepaddDocInfo, 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
/apiand/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/apidocEnvendpoint and removes the obsoletegetDocMenus/getDocItemhelpers. 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
masteratad89a887a; this PR contains one scoped commit. Resolved the dashboard bundle conflicts while preserving the newer dashboard changes from chore: sync dashboard build artifacts #7620../mvnw -B -pl shenyu-admin apache-rat:check: passed.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./mvnw clean install -Dmaven.javadoc.skip=truepassed (focused validation above).