Skip to content

Commit 1d6e972

Browse files
authored
Merge pull request #36 from ChingEnLin/feat/queryargus-integration
feat: QueryArgus data-quality integration
2 parents 4758c73 + f382402 commit 1d6e972

39 files changed

Lines changed: 5347 additions & 304 deletions

.github/workflows/ci.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ jobs:
1515
steps:
1616
- name: Checkout code
1717
uses: actions/checkout@v4
18-
18+
with:
19+
submodules: recursive
20+
1921
- name: Set up Python 3.12
2022
uses: actions/setup-python@v4
2123
with:
@@ -34,6 +36,9 @@ jobs:
3436
run: |
3537
python -m pip install --upgrade pip
3638
pip install -r requirements.txt
39+
# queryargus (submodule) installed with --no-deps; its google-genai<1 pin
40+
# conflicts with langchain-google-genai. 1.x API is compatible.
41+
pip install --no-deps -e ./queryargus
3742
3843
- name: Lint with flake8
3944
working-directory: ./backend
@@ -53,7 +58,9 @@ jobs:
5358
env:
5459
GEMINI_API_KEY: "dummy-key-for-tests"
5560
run: |
56-
PYTHONPATH=. pytest --cov=. --cov-report=term-missing --cov-report=xml --verbose
61+
# Skip queryargus submodule tests: they need extras (azure-*, typer)
62+
# that we deliberately don't install via `pip install --no-deps`.
63+
PYTHONPATH=. pytest --ignore=queryargus --cov=. --cov-report=term-missing --cov-report=xml --verbose
5764
5865
- name: Upload coverage to Codecov
5966
uses: codecov/codecov-action@v3
@@ -70,7 +77,9 @@ jobs:
7077
steps:
7178
- name: Checkout code
7279
uses: actions/checkout@v4
73-
80+
with:
81+
submodules: recursive
82+
7483
- name: Set up Node.js 20
7584
uses: actions/setup-node@v4
7685
with:
@@ -103,7 +112,9 @@ jobs:
103112
steps:
104113
- name: Checkout code
105114
uses: actions/checkout@v4
106-
115+
with:
116+
submodules: recursive
117+
107118
- name: Set up Node.js 20
108119
uses: actions/setup-node@v4
109120
with:

.github/workflows/google-cloudrun-docker.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535
steps:
3636
- name: 'Checkout'
3737
uses: 'actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332' # actions/checkout@v4
38+
with:
39+
submodules: recursive
3840

3941
- id: 'auth'
4042
name: 'Authenticate to Google Cloud'

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,10 @@ CLAUDE.md
5656
.claude/settings.local.json
5757
HANDOFF.md
5858
DESIGN_HANDBOOK.md
59+
60+
# virtual environment
61+
.venv/
62+
63+
# HITL experiment artifacts (lives on experiment/hitl-* branches)
64+
results/
65+
backend/experiments/

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "backend/queryargus"]
2+
path = backend/queryargus
3+
url = https://github.com/ChingEnLin/QueryArgus
4+
branch = dev

backend/.flake8

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ exclude =
77
.pytest_cache,
88
htmlcov,
99
venv,
10-
.venv
10+
.venv,
11+
queryargus
1112
per-file-ignores =
1213
__init__.py:F401

backend/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Backend Dockerfile
2-
FROM python:3.11-slim
2+
FROM python:3.12-slim
33

44
WORKDIR /app/backend
55

66
COPY requirements.txt .
7+
COPY queryargus ./queryargus
78
RUN pip install --no-cache-dir --upgrade pip \
8-
&& pip install --no-cache-dir -r requirements.txt
9+
&& pip install --no-cache-dir -r requirements.txt \
10+
&& pip install --no-cache-dir --no-deps -e ./queryargus
911

1012
COPY . .
1113

backend/main.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
import os
2+
from contextlib import asynccontextmanager
3+
24
import uvicorn
35
from fastapi import FastAPI
46
from fastapi.middleware.cors import CORSMiddleware
5-
from routes import query, azure, system, user_queries, data_documents, audit
7+
from routes import query, azure, system, user_queries, data_documents, audit, argus
8+
9+
10+
@asynccontextmanager
11+
async def lifespan(app: FastAPI):
12+
from services.argus_store import get_report_store
13+
14+
get_report_store()
15+
yield
16+
617

7-
app = FastAPI()
18+
app = FastAPI(lifespan=lifespan)
819

920
# Configure CORS origins based on environment
1021
# Check for production indicators
@@ -56,6 +67,7 @@ async def health_check():
5667
app.include_router(user_queries.router, prefix="/user", tags=["User Queries"])
5768
app.include_router(data_documents.router, prefix="/data", tags=["Data Documents"])
5869
app.include_router(audit.router, prefix="/audit", tags=["Audit"])
70+
app.include_router(argus.router, prefix="/argus", tags=["Argus"])
5971

6072
if __name__ == "__main__":
6173
uvicorn.run(app, host="0.0.0.0", port=8000)

backend/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ exclude = '''
1010
| htmlcov
1111
| venv
1212
| \.venv
13+
| queryargus
1314
)/
1415
'''

backend/pytest.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ testpaths = tests
33
python_files = test_*.py
44
python_classes = Test*
55
python_functions = test_*
6-
addopts =
6+
addopts =
77
--strict-markers
88
--strict-config
99
--verbose
1010
--cov=.
1111
--cov-report=term-missing
1212
--cov-report=html
1313
--cov-exclude=tests/*
14+
--cov-exclude=queryargus/*
15+
--ignore=queryargus
1416
markers =
1517
unit: Unit tests
1618
integration: Integration tests

backend/queryargus

Submodule queryargus added at 719b0de

0 commit comments

Comments
 (0)