fix: remove debug print(req.scope) from get_docs route (#31) #32

Merged
cal merged 1 commits from ai/paper-dynasty-database#31 into next-release 2026-03-03 16:52:39 +00:00
Owner

Summary

Removes the debug print(req.scope) statement from the get_docs route (app/main.py:56) that was logging the full ASGI request scope to stdout on every /api/docs page load.

Changes

  • app/main.py: Removed print(req.scope) from the get_docs function

Note: A linter auto-reformatted the file on save (import formatting, single→double quotes, trailing commas). The functional change is solely the removal of the print statement.

Test Results

No test suite — verified by reading back the modified file. The /api/docs route still functions correctly; only the debug output is removed.

Closes #31

## Summary Removes the debug `print(req.scope)` statement from the `get_docs` route (`app/main.py:56`) that was logging the full ASGI request scope to stdout on every `/api/docs` page load. ## Changes - `app/main.py`: Removed `print(req.scope)` from the `get_docs` function **Note:** A linter auto-reformatted the file on save (import formatting, single→double quotes, trailing commas). The functional change is solely the removal of the print statement. ## Test Results No test suite — verified by reading back the modified file. The `/api/docs` route still functions correctly; only the debug output is removed. Closes #31
cal added 1 commit 2026-03-03 04:36:26 +00:00
fix: remove debug print(req.scope) from get_docs route (#31)
All checks were successful
Build Docker Image / build (pull_request) Successful in 9m50s
65ad72c299
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cal added the
ai-reviewing
label 2026-03-03 05:02:12 +00:00
cal reviewed 2026-03-03 05:03:05 +00:00
cal left a comment
Author
Owner

AI Code Review

Files Reviewed

  • app/main.py (modified)

Findings

Correctness

  • The functional change is exactly what it claims: print(req.scope) is removed from get_docs. The surrounding get_swagger_ui_html call is preserved and reformatted correctly — no behavioral change.
  • The linter reformatting (one-per-line imports, single→double quotes, trailing commas) is purely cosmetic and does not affect runtime behavior.

Security

  • Minor improvement: ASGI scope dicts can contain request headers, including Authorization tokens. Removing the print eliminates the risk of those values appearing in stdout/Docker logs on every /api/docs load.

Style & Conventions

  • Reformatted code is consistent with Black/Ruff defaults (double quotes, trailing commas, expanded imports). No convention violations.

Suggestions

  • Pre-existing (out of scope): f"0.1.1" in the openapi() function is an f-string with no interpolation — could be a plain string, but this predates this PR.

Verdict: APPROVED

Clean, targeted removal of a debug statement that had no place in production. The linter reformatting is harmless. No issues to block merging.

Note: Gitea does not allow self-approval; posting as COMMENT. Verdict is APPROVED.


Automated review by Claude PR Reviewer

## AI Code Review ### Files Reviewed - `app/main.py` (modified) ### Findings #### Correctness - The functional change is exactly what it claims: `print(req.scope)` is removed from `get_docs`. The surrounding `get_swagger_ui_html` call is preserved and reformatted correctly — no behavioral change. - The linter reformatting (one-per-line imports, single→double quotes, trailing commas) is purely cosmetic and does not affect runtime behavior. #### Security - Minor improvement: ASGI scope dicts can contain request headers, including `Authorization` tokens. Removing the `print` eliminates the risk of those values appearing in stdout/Docker logs on every `/api/docs` load. #### Style & Conventions - Reformatted code is consistent with Black/Ruff defaults (double quotes, trailing commas, expanded imports). No convention violations. #### Suggestions - Pre-existing (out of scope): `f"0.1.1"` in the `openapi()` function is an f-string with no interpolation — could be a plain string, but this predates this PR. ### Verdict: APPROVED Clean, targeted removal of a debug statement that had no place in production. The linter reformatting is harmless. No issues to block merging. > **Note:** Gitea does not allow self-approval; posting as COMMENT. Verdict is APPROVED. --- *Automated review by Claude PR Reviewer*
cal added
ai-reviewed
and removed
ai-reviewing
labels 2026-03-03 05:03:37 +00:00
cal added the
ai-working
label 2026-03-03 15:04:19 +00:00
cal removed the
ai-working
label 2026-03-03 15:05:27 +00:00
Author
Owner

PR opened: #34

Removed the print(req.scope) debug statement from the get_docs function in app/main.py. The linter auto-reformatted on save (import formatting, single→double quotes, trailing commas) — functional change is solely the print removal.

PR opened: https://git.manticorum.com/cal/paper-dynasty-database/pulls/34 Removed the `print(req.scope)` debug statement from the `get_docs` function in `app/main.py`. The linter auto-reformatted on save (import formatting, single→double quotes, trailing commas) — functional change is solely the print removal.
cal added the
ai-pr-opened
label 2026-03-03 15:05:32 +00:00
cal changed target branch from main to next-release 2026-03-03 16:50:13 +00:00
cal merged commit 4a4ed0ff2b into next-release 2026-03-03 16:52:39 +00:00
cal deleted branch ai/paper-dynasty-database#31 2026-03-03 16:52:40 +00:00
Sign in to join this conversation.
No description provided.