Fixed #149 -- Moved built-in documentation routes into a dedicated mo…#179
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #179 +/- ##
==========================================
+ Coverage 92.51% 92.63% +0.12%
==========================================
Files 65 66 +1
Lines 6546 6546
Branches 1114 1113 -1
==========================================
+ Hits 6056 6064 +8
+ Misses 297 291 -6
+ Partials 193 191 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Greptile SummaryThis PR moves built-in documentation route construction into a dedicated docs module. The main changes are:
|
| Filename | Overview |
|---|---|
| docs/en/dev/changelog.md | Adds a changelog entry describing the internal docs-route refactor with no behavior changes. |
| src/quater/app.py | Delegates built-in documentation route construction to the new docs routes module while preserving CLI built-ins in place. |
| src/quater/core.py | Moves the shared auth-surface metadata key into core so both app and docs route construction can use the same constant. |
| src/quater/docs/routes.py | Introduces focused helpers for OpenAPI, Swagger UI asset, and MCP docs route definitions; behavior matches the previous app implementation. |
| tests/unit/test_builtin_docs_routes.py | Adds coverage for route contract preservation, enabled and disabled docs surfaces, custom docs paths, Swagger asset handlers, and integration with CLI built-ins. |
Sequence Diagram
%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Q as Quater._builtin_routes
participant D as quater.docs.routes
participant S as Swagger docs helpers
participant R as RouteDefinition list
Q->>D: build_builtin_docs_routes(config, handlers)
alt openapi_path enabled
D->>R: add quater_openapi_json
end
alt docs_path enabled
D->>S: ensure_swagger_ui_assets_available()
D->>R: add quater_openapi_docs
D->>D: docs_asset_paths(docs_path)
D->>R: add Swagger asset routes
end
alt mcp_docs_path enabled
D->>R: add quater_mcp_docs with mcp auth metadata
end
D-->>Q: docs RouteDefinition tuple
alt CLI routes present
Q->>R: append actions manifest and RPC routes
end
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Q as Quater._builtin_routes
participant D as quater.docs.routes
participant S as Swagger docs helpers
participant R as RouteDefinition list
Q->>D: build_builtin_docs_routes(config, handlers)
alt openapi_path enabled
D->>R: add quater_openapi_json
end
alt docs_path enabled
D->>S: ensure_swagger_ui_assets_available()
D->>R: add quater_openapi_docs
D->>D: docs_asset_paths(docs_path)
D->>R: add Swagger asset routes
end
alt mcp_docs_path enabled
D->>R: add quater_mcp_docs with mcp auth metadata
end
D-->>Q: docs RouteDefinition tuple
alt CLI routes present
Q->>R: append actions manifest and RPC routes
end
Reviews (2): Last reviewed commit: "Fixed #149 -- Moved built-in documentati..." | Re-trigger Greptile
Summary
Moved built-in OpenAPI, Swagger UI, and MCP docs route construction, including Swagger asset handlers, out of
Quaterinto a focused docs module. Paths, route names, auth metadata, and public behavior are unchanged. (#149)Linked Issue
Fixes #149
Contributor Checklist
acceptedbefore I started.issue_{issue_number}.Checks Run