-
Notifications
You must be signed in to change notification settings - Fork 68
LCORE-1092: Better docstring for Uvicorn runner #900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LCORE-1092: Better docstring for Uvicorn runner #900
Conversation
WalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/runners/uvicorn.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
src/**/*.py: Use absolute imports for internal modules in LCS project (e.g.,from auth import get_auth_dependency)
All modules must start with descriptive docstrings explaining their purpose
Uselogger = logging.getLogger(__name__)pattern for module logging
All functions must include complete type annotations for parameters and return types, using modern syntax (str | int) andOptional[Type]orType | None
All functions must have docstrings with brief descriptions following Google Python docstring conventions
Function names must use snake_case with descriptive, action-oriented names (get_, validate_, check_)
Avoid in-place parameter modification anti-patterns; return new data structures instead of modifying input parameters
Useasync deffor I/O operations and external API calls
All classes must include descriptive docstrings explaining their purpose following Google Python docstring conventions
Class names must use PascalCase with descriptive names and standard suffixes:Configurationfor config classes,Error/Exceptionfor exceptions,Resolverfor strategy patterns,Interfacefor abstract base classes
Abstract classes must use ABC with@abstractmethoddecorators
Include complete type annotations for all class attributes in Python classes
Useimport loggingand module logger pattern with standard log levels: debug, info, warning, error
Files:
src/runners/uvicorn.py
🪛 GitHub Actions: Black
src/runners/uvicorn.py
[error] 1-1: Black formatting check failed. 1 file would be reformatted: /home/runner/work/lightspeed-stack/lightspeed-stack/src/runners/uvicorn.py. Run 'black' to format. Command: 'uv tool run black --check .' exited with code 1.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: build-pr
- GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-on-pull-request
- GitHub Check: E2E: server mode / azure
- GitHub Check: E2E: library mode / azure
- GitHub Check: E2E: server mode / ci
- GitHub Check: E2E: library mode / ci
| """ | ||
| Start the Uvicorn server using the provided service configuration. | ||
| Parameters: | ||
| configuration (ServiceConfiguration): Configuration providing host, | ||
| port, workers, and `tls_config` (including `tls_key_path`, | ||
| `tls_certificate_path`, and `tls_key_password`). TLS fields may be None | ||
| and will be forwarded to uvicorn.run as provided. | ||
| """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix Black formatting failure and clarify tls_key_password handling.
The pipeline reports that Black would reformat this file. Additionally, the docstring states TLS fields "will be forwarded to uvicorn.run as provided," but line 36 shows that tls_key_password is converted from None to an empty string "" rather than being passed as-is.
Run Black to fix the formatting:
#!/bin/bash
# Fix Black formatting
black src/runners/uvicorn.pyConsider this diff to clarify the tls_key_password behavior:
"""
Start the Uvicorn server using the provided service configuration.
Parameters:
configuration (ServiceConfiguration): Configuration providing host,
port, workers, and `tls_config` (including `tls_key_path`,
- `tls_certificate_path`, and `tls_key_password`). TLS fields may be None
- and will be forwarded to uvicorn.run as provided.
+ `tls_certificate_path`, and `tls_key_password`). TLS key and certificate
+ paths may be None. The tls_key_password is converted to an empty string
+ if None.
"""🤖 Prompt for AI Agents
In src/runners/uvicorn.py around lines 13 to 21, run Black to fix formatting
(e.g., black src/runners/uvicorn.py) and update the docstring to accurately
describe TLS password handling: state that tls_key_password is normalized from
None to an empty string ("") before being forwarded to uvicorn.run (or adjust
the code if you prefer to pass None through), and ensure the docstring wording
and punctuation match Black's formatting rules so the file passes the formatter.
e9e2991 to
8a91fb5
Compare
Description
LCORE-1092: Better docstring for Uvicorn runner
Type of change
Tools used to create PR
Identify any AI code assistants used in this PR (for transparency and review context)
Related Tickets & Documents
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.