fix: correct API module paths from byte_bot to byte_api#129
Merged
JacobCoffee merged 1 commit intomainfrom Nov 23, 2025
Merged
Conversation
Updated all references to use the correct microservices module path: - .env.example: LITESTAR_APP=byte_api.app:create_app - services/api/Dockerfile: uvicorn byte_api.app:create_app --factory - services/api/README.md: documentation references This fixes the "Module not found" error when starting the API service. Note: .env also needs manual update (not tracked in git). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
🚅 Environment byte-pr-129 in byte has no services deployed. |
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideFixes incorrect Litestar application module references after the microservices migration by pointing configuration, Docker startup command, and documentation from the old byte_bot module paths to the correct byte_api app factory entrypoint. Sequence diagram for corrected Docker-based API service startupsequenceDiagram
participant R as "Runtime / Orchestrator"
participant C as "API Service Container"
participant S as "Shell Process (sh -c)"
participant M as "Alembic"
participant U as "Uvicorn"
participant B as "Python Module 'byte_api.app'"
participant F as "Factory Function 'create_app'"
participant L as "Litestar Application Instance"
R->>C: "Start container with CMD 'alembic upgrade head && uvicorn byte_api.app:create_app --factory ...'"
C->>S: "Execute combined shell command"
S->>M: "Run 'alembic upgrade head'"
M-->>S: "Migrations complete"
S->>U: "Start 'uvicorn byte_api.app:create_app --factory ...'"
U->>B: "Import module 'byte_api.app'"
B-->>U: "Module loaded successfully"
U->>F: "Call 'create_app()' (factory mode)"
F-->>U: "Return Litestar application instance"
U->>L: "Attach app instance and start serving"
L-->>R: "API service ready to accept HTTP requests"
Flow diagram for Litestar app startup using corrected byte_api factoryflowchart TD
A["Start API service container"] --> B["Load environment configuration ('.env' / '.env.example')"]
B --> C{"'LITESTAR_APP' set to 'byte_api.app:create_app'?"}
C -->|"Yes"| D["Run 'alembic upgrade head' via shell CMD"]
C -->|"No"| E["Startup fails: Litestar app reference invalid"]
D --> F["Invoke 'uvicorn byte_api.app:create_app --factory --host 0.0.0.0 --port 8000 --workers 2'"]
F --> G["Uvicorn imports module 'byte_api.app'"]
G --> H["Call factory function 'create_app()' (because of '--factory')"]
H --> I["Litestar app instance created"]
I --> J["Uvicorn binds to port 8000 and starts event loop"]
J --> K["API service is ready and serving HTTP requests"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Documentation preview will be available shortly at https://jacobcoffee.github.io/byte-docs-preview/129 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the API service startup failure caused by incorrect module path references after the Phase 2 microservices migration. The application was attempting to import
byte_bot.app:create_appinstead of the correctbyte_api.app:create_app.Root Cause: Old monolith module paths not updated during Phase 1/2 migration.
Error Fixed:
Changes
.env.example: UpdatedLITESTAR_APPto usebyte_api.app:create_appservices/api/Dockerfile: Updated uvicorn command to use correct module path with--factoryflagservices/api/README.md: Updated documentation references frombyte_bot/*tobyte_api/*Note:
.envalso needs manual update by users (file is gitignored)Impact
make run-dev-serverand DockerTesting
Checklist
--factoryflag🤖 Generated with Claude Code
Summary by Sourcery
Correct API service configuration and documentation to reference the new byte_api module entrypoint instead of legacy paths.
Bug Fixes:
Documentation:
Chores: