Skip to content

Commit 7633cea

Browse files
authored
Merge pull request #10 from fairagro/feature/workflow_fixes
Feature/workflow fixes
2 parents 3c4c5fb + 7ef3e22 commit 7633cea

8 files changed

Lines changed: 161 additions & 133 deletions

File tree

.devcontainer/antigravity/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
"version": "0.9.5"
4040
},
4141
"ghcr.io/devcontainers-extra/features/actions-runner:1": {
42-
"version": "latest",
43-
"dotnetVersion": "latest"
42+
"version": "2.319.1",
43+
"dotnetVersion": "8.0"
4444
},
4545
"ghcr.io/devcontainers-extra/features/age:1": {
4646
"version": "1.2.1"

.devcontainer/vscode/devcontainer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
"version": "0.9.5"
4646
},
4747
"ghcr.io/devcontainers-extra/features/actions-runner:1": {
48-
"version": "latest",
49-
"dotnetVersion": "latest"
48+
"version": "2.319.1",
49+
"dotnetVersion": "8.0"
5050
},
5151
"ghcr.io/devcontainers-extra/features/age:1": {
5252
"version": "1.2.1"
@@ -115,7 +115,7 @@
115115

116116
// Load encrypted environment variables automatically (with error tolerance)
117117
"postCreateCommand": {
118-
"setup bashrc": "grep -qF 'source \\${containerWorkspaceFolder}/scripts/load-env.siner h' ~/.bashrc || echo 'source \\${containerWorkspaceFolder}/scripts/load-env.sh' >> ~/.bashrc"
118+
"setup bashrc": "grep -qF 'source \\${containerWorkspaceFolder}/scripts/load-env.sh' ~/.bashrc || echo 'source \\${containerWorkspaceFolder}/scripts/load-env.sh' >> ~/.bashrc"
119119
},
120120
"postStartCommand": {
121121
"install ggshield": "sudo /usr/local/py-utils/bin/pipx install --global ggshield"

AGENTS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,15 @@ uv run pytest --cov=middleware/sql_to_arc middleware/sql_to_arc/tests/
135135
- DB passwords and API secrets should be managed via environment variables or `.env`.
136136
- `client.key` is dynamically handled in container secrets (`tmpfs`).
137137

138+
## ✨ Code Quality Standards
139+
140+
Agents are expected to maintain high code quality by addressing issues reported by the project's configured tools: **Ruff, Pylance, MyPy, Pylint, and Bandit**.
141+
142+
- **Automatic Fixes**: Actively check for and fix code smells, warnings, and notices.
143+
- **Real Fixes vs. Suppression**: Issues must be resolved with actual code changes. Using comments to suppress warnings (e.g., `# noqa`, `# type: ignore`, `# pylint: disable`) is an **option of last resort**.
144+
- **When to Suppress**: Only suppress if a fix is technically impossible or would result in unnecessarily complex or unreadable code.
145+
- **Comprehensive Coverage**: Fix all reported issues, including low-severity notices and warnings, not just critical errors.
146+
138147
## 📚 File Modifications Pattern
139148

140149
When editing files:

docker/Dockerfile.sql_to_arc

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,33 @@ COPY middleware ./middleware
5656
# as pre-built wheels on PyPI.
5757
# 3. Thus, we use 'uv sync' to create a virtual environment (.venv) and resolve all
5858
# complex dependencies exactly as specified in the uv.lock.
59-
RUN HATCH_VCS_PRETEND_VERSION=${APP_VERSION#v} \
60-
SETUPTOOLS_SCM_PRETEND_VERSION=${APP_VERSION#v} \
59+
RUN SETUPTOOLS_SCM_PRETEND_VERSION=${APP_VERSION#v} \
6160
uv sync --no-dev
6261

63-
# 4. Finally, for packages like sql_to_arc that exist both as a workspace dependency
64-
# and as a pre-built wheel, we explicitly 'uv pip install' the wheel. This ensures
65-
# we use our optimized, pre-built package instead of the 'editable' source install.
66-
RUN HATCH_VCS_PRETEND_VERSION=${APP_VERSION#v} \
67-
SETUPTOOLS_SCM_PRETEND_VERSION=${APP_VERSION#v} \
62+
# 4. Install the application wheel.
63+
# This replaces the editable install from 'uv sync' with the optimized wheel.
64+
RUN SETUPTOOLS_SCM_PRETEND_VERSION=${APP_VERSION#v} \
6865
uv pip install /tmp/wheels/*.whl pyinstaller
6966

67+
# 5. FIX: Manually reinstall git dependencies using their INTERNAL names (underscore)
68+
# to ensure proper namespace installation. We do this AFTER installing the wheel
69+
# to ensure the namespace merging happens correctly.
70+
RUN . .venv/bin/activate && \
71+
uv pip install --force-reinstall \
72+
"api_client @ git+https://github.com/fairagro/m4.2_advanced_middleware_api.git@main#subdirectory=middleware/api_client" \
73+
"shared @ git+https://github.com/fairagro/m4.2_advanced_middleware_api.git@main#subdirectory=middleware/shared"
74+
7075
# Build standalone binary using the .venv's context.
76+
# We point PyInstaller to the 'main.py' INSTALLED in site-packages.
77+
# Since we merged everything into site-packages/middleware, we can largely rely on auto-discovery.
78+
# --copy-metadata is still needed because the code checks its own version at runtime.
7179
RUN . .venv/bin/activate && \
72-
python -m PyInstaller --onedir \
80+
.venv/bin/python -m PyInstaller --onedir \
7381
--name sql_to_arc \
74-
/build/middleware/sql_to_arc/src/middleware/sql_to_arc/main.py
82+
--copy-metadata sql_to_arc \
83+
--copy-metadata api_client \
84+
--copy-metadata shared \
85+
.venv/lib/python3.12/site-packages/middleware/sql_to_arc/main.py
7586

7687

7788
# ---- Runtime Stage ----

middleware/sql_to_arc/pyproject.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ dependencies = [
1313
"opentelemetry-api>=1.39.1",
1414
]
1515

16-
[tool.uv.sources]
17-
api_client = { git = "https://github.com/fairagro/m4.2_advanced_middleware_api.git", branch = "main", subdirectory = "middleware/api_client" }
18-
shared = { git = "https://github.com/fairagro/m4.2_advanced_middleware_api.git", branch = "main", subdirectory = "middleware/shared" }
19-
2016
[tool.hatch.version]
2117
source = "vcs"
2218
raw-options = { root = "../.." }

middleware/sql_to_arc/src/middleware/sql_to_arc/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@ async def process_single_dataset(
383383
)
384384
# Use status from response if available (e.g., 'created', 'updated')
385385
status_text = "processed"
386-
if response.arcs:
387-
status_text = response.arcs[0].status.value
386+
if response.arc:
387+
status_text = response.arc.status.value
388388

389389
logger.info(
390390
"%s ARC %s successfully (RDI: %s).",

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ dev = [
2626

2727
[tool.uv.sources]
2828
sql_to_arc = { workspace = true }
29+
api_client = { git = "https://github.com/fairagro/m4.2_advanced_middleware_api.git", branch = "main", subdirectory = "middleware/api_client" }
30+
shared = { git = "https://github.com/fairagro/m4.2_advanced_middleware_api.git", branch = "main", subdirectory = "middleware/shared" }
2931

3032
[tool.uv.workspace]
3133
members = [

0 commit comments

Comments
 (0)