Skip to content

Fixed #149 -- Moved built-in documentation routes into a dedicated mo…#179

Merged
DevilsAutumn merged 1 commit into
mainfrom
issue_149
Jul 15, 2026
Merged

Fixed #149 -- Moved built-in documentation routes into a dedicated mo…#179
DevilsAutumn merged 1 commit into
mainfrom
issue_149

Conversation

@DevilsAutumn

Copy link
Copy Markdown
Owner

Summary

Moved built-in OpenAPI, Swagger UI, and MCP docs route construction, including Swagger asset handlers, out of Quater into a focused docs module. Paths, route names, auth metadata, and public behavior are unchanged. (#149)

Linked Issue

Fixes #149

Contributor Checklist

  • The linked issue was marked accepted before I started.
  • Nobody else was assigned or already working on the issue before I started.
  • My branch is named issue_{issue_number}.
  • The PR is focused on one issue with no unrelated changes.
  • Tests are added or updated when behavior changes.
  • Docs are updated when user-facing behavior changes.
  • Changelog is updated when the change is release-visible.
  • I listed the checks I ran below.

Checks Run


@codecov-commenter

codecov-commenter commented Jul 15, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.63%. Comparing base (83eddd8) to head (5e3b093).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@greptile-apps

greptile-apps Bot commented Jul 15, 2026

Copy link
Copy Markdown

Greptile Summary

This PR moves built-in documentation route construction into a dedicated docs module. The main changes are:

  • OpenAPI, Swagger UI, Swagger asset, and MCP docs route assembly now live in quater.docs.routes.
  • Quater._builtin_routes() delegates docs routes to the new builder and still appends CLI built-in routes locally.
  • The auth-surface metadata key is shared from quater.core.
  • Unit tests cover default routes, disabled surfaces, custom docs paths, Swagger asset handlers, and CLI route composition.
  • The developer changelog records the internal cleanup.

Confidence Score: 5/5

Safe to merge with minimal risk.

The change is a focused refactor that preserves existing route contracts and adds targeted tests for the moved behavior.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • The general-contract-validation-proof confirms the test run completed with EXIT_CODE 0 and records the exact pytest command and working directory.
  • The runtime-before-proof documents the baseline behavior for the same GET endpoints, with EXIT_CODE 0.
  • The runtime-after-proof documents the current-code behavior for the same GET endpoints, with EXIT_CODE 0, showing consistency with the baseline.
  • A supplemental probe script was saved to enable repeatable runtime checks, as described by the proofs.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

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
Loading
%%{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
Loading

Reviews (2): Last reviewed commit: "Fixed #149 -- Moved built-in documentati..." | Re-trigger Greptile

@DevilsAutumn DevilsAutumn merged commit e359a8a into main Jul 15, 2026
6 checks passed
@DevilsAutumn DevilsAutumn deleted the issue_149 branch July 15, 2026 08:15
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.

Extract built-in docs routes out of Quater

2 participants