Skip to content

Commit 67512de

Browse files
Chore/ops compose logs (#592)
* E2E: Odoo + Shopify wiring, Next image allow-list, VVD assets, smokes, and port hygiene * chore(gitignore): dedupe PID ignores per CodeRabbit * ci: backend+frontend workflows, env examples * dx: dev and smoke scripts * partcad: adapter + GLB/BOM endpoints, FE viewer * chore: align env ordering and share port helper * 📝 Add docstrings to `feat/partcad-adapter` (#581) Docstrings generation was requested by @shayancoin. * #580 (comment) The following files were modified: * `backend/api/routes_partcad.py` * `backend/services/partcad/adapter.py` * `frontend/app/partcad/[model]/page.tsx` * `frontend/components/GLBViewer.tsx` * `scripts/dev.sh` * `scripts/smoke.sh` Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: extend partcad integration and CI * 📝 Add docstrings to `feat/partcad-adapter` (#583) Docstrings generation was requested by @shayancoin. * #582 (comment) The following files were modified: * `backend/api/routes_partcad.py` * `backend/main.py` * `backend/services/partcad/adapter.py` * `frontend/app/partcad/[model]/page.tsx` * `frontend/components/GLBViewer.tsx` * `frontend/components/PartcadViewerShell.tsx` * `scripts/dev.sh` * `scripts/lib/common.sh` * `scripts/smoke.sh` Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Shayan <shayan@coin.link> * feat: extend partcad integration and CI * pricing: CPQ→Odoo quote+order endpoints * fix: stabilize ci, pricing, and partcad viewers * chore: harden pricing limiter and partcad integrations * fix: ensure partcad limiter receives request and restore smoke executability * chore: apply requested adjustments * 3d: bake pipeline (assimp) and baked dir * 3d: import vvd assets and baked glbs * ops: dev compose profiles, logrotate doc * ops: restore dev stack and polish partcad tooling --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 34b3007 commit 67512de

File tree

9 files changed

+71
-12
lines changed

9 files changed

+71
-12
lines changed

.github/workflows/backend-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ jobs:
8585
cat "${HEALTH_OUTPUT}"
8686
echo
8787
echo "== Odoo customer =="
88-
curl -sS -X POST http://127.0.0.1:8000/api/odoo/sync/customer -H 'content-type: application/json' --data '{"name":"CI User","email":"ci@example.com"}' || true
88+
curl -sS -X POST http://localhost:8000/api/odoo/sync/customer -H 'content-type: application/json' --data '{"name":"CI User","email":"ci@example.com"}' || true
8989
echo
9090
echo "== Odoo order =="
91-
curl -sS -X POST http://127.0.0.1:8000/api/odoo/sync/order -H 'content-type: application/json' --data '{"external_id":"SO-CI","total":42.0,"lines":[{"qty":1,"price":42.0}]}' || true
91+
curl -sS -X POST http://localhost:8000/api/odoo/sync/order -H 'content-type: application/json' --data '{"external_id":"SO-CI","total":42.0,"lines":[{"qty":1,"price":42.0}]}' || true
9292
echo
9393
} | tee -a logs/backend_e2e.txt
9494
rm -f "${HEALTH_OUTPUT}" "${HEALTH_ERROR}"

.github/workflows/frontend-ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
HEALTH_OUTPUT="$(mktemp)"
6464
health_ok=0
6565
for _ in {1..60}; do
66-
if curl -fsS http://127.0.0.1:3001/api/health > "${HEALTH_OUTPUT}"; then
66+
if curl -fsS http://localhost:3001/api/health > "${HEALTH_OUTPUT}"; then
6767
health_ok=1
6868
break
6969
fi
@@ -81,7 +81,7 @@ jobs:
8181
cat "${HEALTH_OUTPUT}"
8282
echo
8383
echo "== FE /api/env =="
84-
curl -fsS http://127.0.0.1:3001/api/env
84+
curl -fsS http://localhost:3001/api/env
8585
echo
8686
} | tee -a ../logs/frontend_e2e.txt
8787
@@ -93,7 +93,7 @@ import time
9393
import urllib.error
9494
import urllib.request
9595

96-
BASE_URL = "http://127.0.0.1:3001"
96+
BASE_URL = "http://localhost:3001"
9797

9898

9999
def log(message: str) -> None:

backend/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,14 @@ uvicorn api.main:app --reload
1717
### With Docker
1818

1919
```bash
20-
# From the root directory
21-
docker compose --env-file .env.development -f docker-compose.dev.yml up backend-dev
20+
# Start the backend with hot-reload (requires ODOO_ADMIN_USER/ODOO_ADMIN_PASS)
21+
ODOO_ADMIN_USER=admin ODOO_ADMIN_PASS=admin scripts/dev.sh be
22+
```
23+
24+
To launch only the supporting containers (Postgres + Odoo) run:
25+
26+
```bash
27+
docker compose --env-file .env.development -f docker-compose.dev.yml --profile dev up -d
2228
```
2329

2430
### Environment variables

backend/api/routes_partcad.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import logging
55
import time
66
from dataclasses import dataclass, field
7+
from functools import lru_cache
78
from pathlib import Path
89
from typing import Any, Dict, Optional
910
from uuid import uuid4

backend/limiter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import logging
2+
from collections.abc import Sequence
3+
14
from slowapi import Limiter
25
from slowapi.util import get_ipaddr
36

backend/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "MVP Backend API"
55
readme = "README.md"
66
requires-python = ">=3.12"
77
dependencies = [
8-
"fastapi>=0.115.0",
8+
"fastapi>=0.112.2,<0.113.0",
99
"uvicorn>=0.30.0",
1010
"python-dotenv>=1.0.0",
1111
"pydantic>=2.5.0",
@@ -14,7 +14,7 @@ dependencies = [
1414
"sqlalchemy>=2.0.36",
1515
"alembic>=1.13.2",
1616
"psycopg[binary]>=3.2.1",
17-
"aiosqlite>=0.19.0",
17+
"aiosqlite>=0.20.0",
1818
"email-validator>=2.2.0",
1919
"sentry-sdk[fastapi,httpx,opentelemetry]==2.42.0",
2020
"opentelemetry-api>=1.28.0",

docker-compose.dev.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,34 @@ services:
6565
networks:
6666
- app-network
6767

68+
db:
69+
image: postgres:16
70+
environment:
71+
POSTGRES_USER: paform
72+
POSTGRES_PASSWORD: paform
73+
ports:
74+
- "5432:5432"
75+
profiles:
76+
- dev
77+
networks:
78+
- app-network
79+
80+
odoo:
81+
image: odoo:18
82+
environment:
83+
DB_HOST: db
84+
DB_PORT: 5432
85+
DB_USER: paform
86+
DB_PASSWORD: paform
87+
depends_on:
88+
- db
89+
ports:
90+
- "8069:8069"
91+
profiles:
92+
- dev
93+
networks:
94+
- app-network
95+
6896
networks:
6997
app-network:
7098
driver: bridge

frontend/README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@ npm install
1111
npm run dev
1212
```
1313

14-
### With Docker
14+
### With Docker/Helper Script
1515

1616
```bash
17-
# From the root directory
18-
docker compose --env-file .env.development -f docker-compose.dev.yml up frontend-dev
17+
# From the repository root
18+
scripts/dev.sh fe
19+
```
20+
21+
To start only the shared Postgres and Odoo dependencies in containers:
22+
23+
```bash
24+
docker compose --env-file .env.development -f docker-compose.dev.yml --profile dev up -d
1925
```
2026

2127
## Project Structure

ops/logrotate.conf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# run weekly via cron or CI (doc only)
2+
logs/*.log {
3+
weekly
4+
size 100M
5+
maxage 28
6+
rotate 4
7+
compress
8+
missingok
9+
notifempty
10+
copytruncate
11+
postrotate
12+
# TODO: send SIGHUP to long-running services if they need to reopen log files.
13+
# e.g. kill -HUP $(cat /var/run/your-service.pid) || true
14+
endscript
15+
}

0 commit comments

Comments
 (0)