Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .flox/env/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ ruff.pkg-path = "ruff"
uv.pkg-path = "uv"
vulture.pkg-path = "python313Packages.vulture"
yamllint.pkg-path = "yamllint"
# libpqxx.pkg-path = "libpqxx"

[options]
systems = [
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/BUG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Bug
about: Create a bug report
title: ''
labels: ["bug", "backlog"]
labels: ["bug"]
projects: ["pocketsizefund/11"]

---
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/FEATURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Feature
about: Create a feature request
title: ''
labels: ["feature", "backlog"]
labels: ["feature"]
projects: ["pocketsizefund/11"]

---
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
deploy:
name: Deploy infrastructure
runs-on: macos-latest
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ on:
push
jobs:
python_quality_check:
name: Run Python quality checks (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
name: Run Python quality checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
29 changes: 22 additions & 7 deletions .mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ COMPOSE_BAKE=true

[tasks."python:install"]
description = "Install Python dependencies"
run = "uv sync --all-groups"
run = "uv sync --all-packages"

[tasks."python:format"]
description = "Format Python code"
Expand All @@ -30,10 +30,12 @@ ruff check \

[tasks."python:test"]
description = "Run Python tests"
run = "docker compose run tests"

run = """
docker compose build tests
docker compose run -T tests
"""

[tasks."application:service:run"]
[tasks."application:service:run:production"]
description = "Run the application service"
run = """
docker run \
Expand All @@ -42,20 +44,34 @@ docker run \
pocketsizefund/{{arg(name="service_name")}}:latest \
"""

[tasks."application:service:development"]
[tasks."application:service:run:development"]
description = "Run the application service locally with hot reloading"
run = """
cd application/{{arg(name="service_name")}}
uv run uvicorn src.{{arg(name="service_name")}}.main:application --reload
"""

[tasks."application:service:test"]
[tasks."application:service:test:integration"]
description = "Run integration tests"
run = """
cd application/{{arg(name="service_name")}}
docker-compose up --build --abort-on-container-exit --remove-orphans
"""
Comment on lines +54 to 59
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Unify Docker Compose CLI usage
The integration test task still uses docker-compose (hyphenated) while other tasks use docker compose. This inconsistency can cause failures if one CLI is unavailable.

Apply this diff to standardize on the Compose v2 CLI:

-[tasks."application:service:test:integration"]
-run = """
- cd application/{{arg(name="service_name")}}
- docker-compose up --build --abort-on-container-exit --remove-orphans
-"""
+[tasks."application:service:test:integration"]
+run = """
+cd application/{{arg(name="service_name")}}
+docker compose up --build --abort-on-container-exit --remove-orphans
+"""

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In .mise.toml around lines 54 to 59, the integration test task uses the old
hyphenated `docker-compose` command, which is inconsistent with other tasks
using the newer `docker compose` CLI. Update the command by replacing
`docker-compose` with `docker compose` to unify the Docker Compose CLI usage
across all tasks and avoid potential failures.


[tasks."application:service:test:behavioral"]
description = "Run behavioral tests"
run = """
cd application/{{arg(name="service_name")}}
docker-compose up --build --abort-on-container-exit
"""

Comment on lines +61 to +67
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Standardize behavioral test invocation
The behavioral test task also uses docker-compose instead of docker compose. Aligning them improves reliability across environments.

-[tasks."application:service:test:behavioral"]
- description = "Run behavioral tests"
- run = """
- cd application/{{arg(name="service_name")}}
- docker-compose up --build --abort-on-container-exit
- """
+[tasks."application:service:test:behavioral"]
+description = "Run behavioral tests"
+run = """
+cd application/{{arg(name="service_name")}}
+docker compose up --build --abort-on-container-exit
+"""
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[tasks."application:service:test:behavioral"]
description = "Run behavioral tests"
run = """
cd application/{{arg(name="service_name")}}
docker-compose up --build --abort-on-container-exit
"""
[tasks."application:service:test:behavioral"]
description = "Run behavioral tests"
run = """
cd application/{{arg(name="service_name")}}
docker compose up --build --abort-on-container-exit
"""
🤖 Prompt for AI Agents
In .mise.toml around lines 61 to 67, the behavioral test task uses the
deprecated `docker-compose` command. Replace `docker-compose` with the modern
`docker compose` syntax in the run script to standardize and improve
compatibility across environments.

[tasks."application:service:cleanup:behavioral"]
description = "Clean up behavioral tests"
run = """
cd application/{{arg(name="service_name")}}
docker-compose down -v
"""

Comment on lines +68 to +74
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Standardize cleanup of behavioral tests
Similarly, the cleanup task should use docker compose down -v to match the Compose v2 CLI syntax.

-[tasks."application:service:cleanup:behavioral"]
- description = "Clean up behavioral tests"
- run = """
- cd application/{{arg(name="service_name")}}
- docker-compose down -v
- """
+[tasks."application:service:cleanup:behavioral"]
+description = "Clean up behavioral tests"
+run = """
+cd application/{{arg(name="service_name")}}
+docker compose down -v
+"""
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[tasks."application:service:cleanup:behavioral"]
description = "Clean up behavioral tests"
run = """
cd application/{{arg(name="service_name")}}
docker-compose down -v
"""
[tasks."application:service:cleanup:behavioral"]
description = "Clean up behavioral tests"
run = """
cd application/{{arg(name="service_name")}}
docker compose down -v
"""
🤖 Prompt for AI Agents
In .mise.toml around lines 68 to 74, the cleanup task uses the old Docker
Compose CLI syntax `docker-compose down -v`. Update this command to use the
Compose v2 CLI syntax by changing it to `docker compose down -v` to standardize
the cleanup process.

[tasks."lint"]
depends = ["python:lint"]
description = "Run code quality checks"
Expand All @@ -69,4 +85,3 @@ run = """
cd infrastructure
uv run pulumi up --yes
"""

4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ This project uses **mise** tasks for code quality and testing. Before committing
4. Execute tests with `mise run python:test`.

## Code Style

- Write tested, self-documenting code. Avoid comments unless the code is complex.

## Pull Requests

- Use the Pull Request template: `.github/PULL_REQUEST_TEMPLATE.md`.

## GitHub Issues

- When creating an issue, use the templates under `.github/ISSUE_TEMPLATE`.
- Include a clear title, the reason the feature or fix is needed, and two implementation options with cost-benefit analysis.

5 changes: 3 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ When asked to create a new GitHub issue:
- `.github/ISSUE_TEMPLATE/FEATURE.md` for new features
2. Include:
- A descriptive title (without [FEATURE|BUG] prefix)
- Set its GitHub Project status to "To Do"
- Explain why the feature is needed
- Detail the benefits it will bring
- Propose two implementation options (after considering at least five)
Expand All @@ -26,5 +27,5 @@ When asked to create a new GitHub issue:
## GitHub Issue Workflow

1. After creating a ticket, it will be reviewed and possibly modified
2. Issues with "todo" status are prepared for implementation
3. When asked to look at tickets ready for implementation, search for GitHub issues with "in progress" status
2. Issues with "To Do" Project status are prepared for implementation
3. When asked to look at tickets ready for implementation, search for GitHub issues with "To Do" Project status
2 changes: 1 addition & 1 deletion application/datamanager/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Integration Tests for datamanager service
name: Data manager integration tests

services:
datamanager:
Expand Down
1 change: 0 additions & 1 deletion application/datamanager/features/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@


def before_all(context):
"""Set up test environment."""
context.base_url = os.environ.get("BASE_URL", "http://datamanager:8080")
1 change: 0 additions & 1 deletion application/datamanager/features/steps/health_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@

@when('I send a GET request to "{endpoint}"')
def step_impl(context, endpoint):
"""Send a GET request to the specified endpoint."""
url = f"{context.api_url}{endpoint}"
context.response = requests.get(url)
11 changes: 0 additions & 11 deletions application/datamanager/mise.toml

This file was deleted.

2 changes: 0 additions & 2 deletions application/datamanager/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ dependencies = [
"polars>=1.29.0",
"pyarrow>=20.0.0",
"google-cloud-storage>=2.16.0",
"loguru>=0.7.3",
"httpx>=0.28.1",
"prometheus-fastapi-instrumentator>=7.1.0",
"datamanager"
]

Expand Down
2 changes: 1 addition & 1 deletion application/datamanager/src/datamanager/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ async def lifespan(app: FastAPI):
application = FastAPI(lifespan=lifespan)
Instrumentator().instrument(application).expose(application)


@application.get("/health")
async def health_check():
return Response(status_code=status.HTTP_200_OK)
Expand Down Expand Up @@ -149,7 +150,6 @@ async def fetch_equity_bars(request: Request, summary_date: SummaryDate) -> Bars
return BarsSummary(date=summary_date.date.strftime("%Y-%m-%d"), count=count)



@application.delete("/equity-bars")
async def delete_equity_bars(request: Request, summary_date: SummaryDate):
bucket = request.app.state.bucket
Expand Down
1 change: 0 additions & 1 deletion application/positionmanager/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ dependencies = [
"pandas>=2.1.0",
"pyportfolioopt>=1.5.6",
"ecos>=2.0.14",
"prometheus-fastapi-instrumentator>=7.1.0",
]

[tool.hatch.build.targets.wheel]
Expand Down
2 changes: 2 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---
name: Application unit tests

services:
tests:
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ dev = [
"pyportfolioopt>=1.5.6",
"pytest>=8.3.5",
"requests>=2.32.3",
"behave>=1.2.6",
"prometheus-fastapi-instrumentator>=7.1.0",
"loguru>=0.7.3",
]


[tool.pytest.ini_options]
testpaths = [
"/tests/",
Expand Down
Loading