Version 0.2.0 with S3, docker, bells and whistles#1
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR migrates storage to optional S3-backed workflows, converts key utilities and portfolio functions to async, refactors configuration and API security, and updates packaging and deployment artifacts.
- Introduce
CloudObjectStoragewith S3 support alongsideLocalFileStorageand comprehensive tests. - Convert
utils, portfolio fetch/optimize/prepare functions to async and switch toopenbb_fmpfor data fetching. - Refactor FastAPI app to use OAuth2 security with Pydantic
AppConfig, update endpoint definitions, widget metadata, packaging (pyproject.toml), Dockerfile, and add Kubernetes manifests.
Reviewed Changes
Copilot reviewed 36 out of 40 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| allocator_bot/storage.py | Add CloudObjectStorage, S3 logic, update tests |
| tests/test_storage.py | New tests for S3 and local storage flows |
| allocator_bot/utils.py | Async-ify helpers (validate_api_key, sanitize_message, generate_id) |
| tests/test_utils.py | Update coverage for async utils |
| allocator_bot/portfolio.py | Async portfolio functions, switch to FMPEquityHistoricalFetcher |
| tests/test_portfolio.py | New async tests for portfolio logic |
| allocator_bot/api.py | OAuth2 security, Pydantic config, endpoint/widget metadata refactor |
| pyproject.toml | Migrate to [project] format, update dependencies |
| Dockerfile | Multi-stage Docker build |
| k8s/*.yaml | Add Kubernetes deployment, service, configmap, secret, namespace |
Comments suppressed due to low confidence (2)
allocator_bot/utils.py:30
- [nitpick] The docstring still says "total length of 4 characters" but the suffix length is now configurable. Please update the docstring to reflect that the total ID length = timestamp part length (2) + the
lengthparameter.
async def generate_id(length: int = 2) -> str:
allocator_bot/storage.py:108
- [nitpick] The parameter
allocation_idinsave_taskrefers to a task identifier, not an allocation. Consider renaming it totask_idfor clarity.
async def save_task(allocation_id: str, task_data: dict) -> str:
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.
This pull request introduces several updates to enhance the Allocator Bot's functionality, improve its deployment process, and streamline its codebase. Key changes include the addition of Docker support, updates to environment configuration, new GitHub Actions workflows, and significant refactoring of the bot's agent logic.
Deployment and Configuration Enhancements:
Dockerfilefor multi-stage builds, enabling easy deployment of the Allocator Bot as a Docker container. The runtime stage uses a non-root user for security, and the default port is exposed as4299..env.exampleto include new configuration options such as S3 storage settings and renamedAPI_KEYS_FILE_PATHtoAPP_API_KEYfor clarity..dockerignoreto exclude unnecessary files from Docker builds, improving build performance.GitHub Actions Workflows:
docker-publish.ymlworkflow to build and publish Docker images to GitHub Container Registry on pushes to themainbranch.lint_and_test.ymlworkflow to automate linting and testing on pushes and pull requests to themainbranch.Codebase Refactoring:
allocator_bot/agent.pyto replace OpenAI models with OpenRouter models, add retry logic, and improve the structure of LLM interactions. Introduced new helper methods such asmake_llmand updated theexecution_loopto yield reasoning steps and tables for better SSE responses. [1] [2]allocator_bot/__main__.pyand implemented aget_appfunction that loads environment variables and initializes the FastAPI app.Documentation Updates:
README.mdwith Docker setup instructions, environment variable descriptions, and updated usage details for integration with OpenBB Workspace. [1] [2] [3]Miscellaneous:
.markdownlint.jsonto configure markdown linting rules, disablingMD033andMD013..cursorrules,CLAUDE.md, andGEMINI.mdto include references tollms.md.