Docker service image fixes and updates#773
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughReplaced dynamic ENV path concatenation in datamanager Dockerfile with fixed paths; equity-bars now short-circuits weekend dates; equity-details now reads and returns raw CSV from S3 and its sync handler is NOT_IMPLEMENTED; renamed S3 key and added CSV-read helper; updated tests, two pyproject deps, and MASSIVE_BASE_URL. Changes
Sequence Diagram(s)mermaid mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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.
Pull request overview
Updates service dependencies and datamanager behavior to support backfill-related fixes, including shifting equity details to a direct S3 CSV read path and adding guardrails around equity bars syncing.
Changes:
- Add
uvicornto Python service dependencies (anduv.lock) for FastAPI runtimes. - Update datamanager equity details: use
equity/details/details.csvand return501 Not Implementedfor sync; adjust handlers/storage and tests accordingly. - Add weekend short-circuit for
/equity-barssync; update Dockerfile env var handling and align Cargo lock versioning.
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Adds uvicorn to the workspace lock to match service runtime needs. |
| infrastructure/main.py | Updates the MASSIVE_BASE_URL value passed into the datamanager task. |
| applications/portfoliomanager/pyproject.toml | Adds uvicorn dependency for serving FastAPI. |
| applications/equitypricemodel/pyproject.toml | Adds uvicorn dependency for serving FastAPI. |
| applications/datamanager/tests/test_storage.rs | Updates tests to use the new equity details S3 key. |
| applications/datamanager/tests/test_handlers.rs | Reworks tests for equity details sync (now not implemented) and adds weekend NO_CONTENT coverage for equity bars. |
| applications/datamanager/src/storage.rs | Renames equity details key and adds an API to read raw CSV content from S3. |
| applications/datamanager/src/equity_details.rs | Switches GET to return raw CSV from S3; sync now returns NOT_IMPLEMENTED. |
| applications/datamanager/src/equity_bars.rs | Skips weekend dates and tweaks error logging. |
| applications/datamanager/Dockerfile | Attempts to improve env var concatenation for library paths. |
| Cargo.lock | Aligns datamanager package version with its Cargo.toml. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile SummaryThis PR fixes missing dependencies and simplifies the equity details workflow by switching from automated sync to manual CSV uploads.
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| applications/datamanager/src/equity_bars.rs | Added weekend date checking to skip API calls on Saturdays/Sundays, and improved error logging security by using .without_url() to prevent exposing sensitive URL information |
| applications/datamanager/src/equity_details.rs | Removed complex sync logic (200+ lines) in favor of manual CSV uploads to S3, simplified get endpoint to return raw CSV content instead of converting from DataFrame |
| applications/datamanager/src/storage.rs | Changed S3 key from categories.csv to details.csv, refactored to add read_equity_details_csv_from_s3 function that returns raw CSV string |
| applications/datamanager/Dockerfile | Simplified environment variable assignments by removing conditional expansion syntax; variables now set twice (lines 24-26 and 54-55) which is redundant but harmless |
| infrastructure/main.py | Changed Massive API base URL from https://api.massive.io to https://api.massive.com |
| applications/equitypricemodel/pyproject.toml | Added missing uvicorn>=0.34.0 dependency which is required by the Dockerfile entrypoint |
| applications/portfoliomanager/pyproject.toml | Added missing uvicorn>=0.34.0 dependency which is required by the Dockerfile entrypoint |
Last reviewed commit: 287abe8
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@applications/datamanager/src/storage.rs`:
- Around line 757-787: The S3 object retrieval, body collection and UTF-8
conversion are duplicated between read_equity_details_csv_from_s3 and
read_equity_details_dataframe_from_s3; refactor by extracting the shared logic
into a single helper (e.g., read_s3_object_as_string or similar) that accepts
State and key (or have read_equity_details_dataframe_from_s3 simply call
read_equity_details_csv_from_s3) and returns Result<String, Error>, reuse the
same error mapping and logging, and update both read_equity_details_csv_from_s3
and read_equity_details_dataframe_from_s3 to call that helper to avoid
duplication.
ℹ️ Review info
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (2)
Cargo.lockis excluded by!**/*.lockuv.lockis excluded by!**/*.lock
📒 Files selected for processing (9)
applications/datamanager/Dockerfileapplications/datamanager/src/equity_bars.rsapplications/datamanager/src/equity_details.rsapplications/datamanager/src/storage.rsapplications/datamanager/tests/test_handlers.rsapplications/datamanager/tests/test_storage.rsapplications/equitypricemodel/pyproject.tomlapplications/portfoliomanager/pyproject.tomlinfrastructure/__main__.py
Additional Comments (1)
Prompt To Fix With AIThis is a comment left during a code review.
Path: applications/datamanager/src/equity_details.rs
Line: 24-28
Comment:
client-facing error message includes internal error details which could expose system information
```suggestion
warn!("Failed to fetch equity details from S3: {}", err);
(
StatusCode::INTERNAL_SERVER_ERROR,
"Failed to fetch equity details",
)
```
How can I resolve this? If you propose a fix, please make it concise. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 11 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
applications/datamanager/src/equity_details.rs:28
- The HTTP 500 response body includes the underlying internal error string (
format!("Failed to fetch equity details: {}", err)). Since this error can include AWS/S3 details (bucket/key/request IDs) and other internal context, it can unintentionally leak operational information to clients. Prefer returning a generic client-facing message (and keep the detailed error in logs only).
warn!("Failed to fetch equity details from S3: {}", err);
(
StatusCode::INTERNAL_SERVER_ERROR,
format!("Failed to fetch equity details: {}", err),
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Overview
Changes
details.csvto S3datamanager"equity details" endpoints for direct load/"not implemented"Context
More bugs I ran into backfilling the data.
Summary by CodeRabbit
New Features
Bug Fixes
Changes
Tests