Commit 26c2031
authored
Chore/ci consolidation (#105)
* chore: ignore VSCode workspace file
* cleanup: remove duplicated CI workflows and stabilize pipeline
* fix(security): remove hardcoded bind and rely on env host
* feat(observability): add telemetry and test configuration
* ci(railway): add automated docker build and deployment workflow
* docs: cleanup deployment documentation
* style: fix import order for isort/black
* style: fix import order in app/main.py
* fix(api): align root response with tests and harden settings
* fix(security): remove hardcoded 0.0.0.0 default to satisfy bandit B104
* fix(api): align root endpoint response with tests (add features)
* fix(api): stabilize root endpoint and logging lifecycle
* fix(api): align root endpoint response with tests (add features)
* fix(app): remove arguments from setup_logging (CodeQL)
* fix(app): sort imports and finalize main app lifecycle
* fix(lint): satisfy isort import order
* fix(lint): satisfy isort 7 and CodeQL
* chore(lint): configure isort to align with black
* fix(backoffice): correct APIRouter import and routing
* fix(core): stabilize app lifecycle, routing and logging
* chore(lint): configure isort to align with black
* feat(app): implement lifespan management and health check endpoints
* fix: resolve architectural issues - cyclic imports and CodeQL errors
- Refactor app/config.py to ONLY contain Settings class and get_settings()
- Remove FastAPI app definition and lifespan (moved to main.py)
- Remove router imports to break circular dependencies
- Add pydantic extra='ignore' to handle extra env vars
- Update app/utils/logging.py setup_logging() to accept ZERO arguments
- Read LOG_LEVEL from environment internally
- Fixes CodeQL error: 'Wrong number of arguments in call to setup_logging'
- Refactor app/main.py as ONLY place for FastAPI app and lifespan
- Define lifespan() with lazy settings import
- Call setup_logging() with no arguments
- Import routers directly (no circular dependencies)
- Add timestamp to health check endpoint
- Verify routers (operator, backoffice) don't import config or main
Dependency flow: main.py -> config.py, routers (NEVER reverse)
All tests pass (7/7 ✓)
Black + isort formatting applied
CodeQL circular import issues resolved
* fix(tests): configure environment variables for CI tests
- Add pytest-env configuration in pytest.ini with required vars:
- API_KEY, SECRET_KEY for authentication tests
- CORS_ORIGINS as JSON array format for pydantic-settings
- ENVIRONMENT=testing for test environment
- Update .env.test with proper test values
- Use JSON format for list values: CORS_ORIGINS=["*"]
Fixes test failure in CI:
- ValueError: API_KEY environment variable is required
- Tests now pass with mocked environment variables
All tests pass locally: 7/7 ✓
* fix(ci): configure test environment variables properly
- Move env vars from pytest.ini (unsupported) to CI workflow
- Add environment variables directly in ci.yml test step:
- API_KEY, SECRET_KEY, CORS_ORIGINS, ENVIRONMENT, etc.
- Create app/tests/conftest.py for local testing:
- Automatically sets test env vars if not present
- Ensures consistent behavior between local and CI
- Remove invalid 'env' section from pytest.ini
- pytest-env plugin not needed anymore
Fixes CI error:
- "ERROR: Unknown config option: env"
- Tests now have proper environment in both local and CI
All tests pass: 7/7 ✓
* style: format conftest.py with black1 parent d7f1756 commit 26c2031
File tree
17 files changed
+254
-929
lines changed- .github/workflows
- app
- backoffice
- tests
- utils
17 files changed
+254
-929
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
9 | 8 | | |
10 | 9 | | |
11 | | - | |
| 10 | + | |
12 | 11 | | |
13 | 12 | | |
14 | | - | |
15 | 13 | | |
16 | | - | |
| 14 | + | |
17 | 15 | | |
18 | 16 | | |
19 | | - | |
20 | | - | |
| 17 | + | |
21 | 18 | | |
22 | | - | |
23 | | - | |
| 19 | + | |
24 | 20 | | |
25 | 21 | | |
26 | 22 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 23 | + | |
42 | 24 | | |
43 | 25 | | |
44 | 26 | | |
45 | | - | |
| 27 | + | |
46 | 28 | | |
47 | | - | |
| 29 | + | |
48 | 30 | | |
49 | | - | |
50 | 31 | | |
51 | | - | |
52 | 32 | | |
53 | 33 | | |
54 | | - | |
| 34 | + | |
55 | 35 | | |
56 | | - | |
57 | 36 | | |
58 | | - | |
59 | 37 | | |
60 | 38 | | |
61 | | - | |
62 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
| 19 | + | |
21 | 20 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 21 | + | |
29 | 22 | | |
30 | | - | |
31 | | - | |
32 | | - | |
| 23 | + | |
33 | 24 | | |
34 | 25 | | |
35 | | - | |
36 | | - | |
37 | | - | |
| 26 | + | |
38 | 27 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 28 | + | |
| 29 | + | |
43 | 30 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 31 | + | |
| 32 | + | |
49 | 33 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | 34 | | |
62 | 35 | | |
63 | | - | |
64 | 36 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 37 | + | |
| 38 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
12 | | - | |
13 | 10 | | |
14 | | - | |
15 | 11 | | |
16 | 12 | | |
17 | 13 | | |
18 | 14 | | |
19 | 15 | | |
20 | | - | |
21 | | - | |
| 16 | + | |
22 | 17 | | |
23 | | - | |
24 | | - | |
| 18 | + | |
25 | 19 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
30 | 24 | | |
31 | | - | |
32 | | - | |
| 25 | + | |
33 | 26 | | |
34 | 27 | | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 5 | + | |
9 | 6 | | |
10 | 7 | | |
11 | 8 | | |
12 | 9 | | |
13 | | - | |
14 | 10 | | |
15 | 11 | | |
16 | | - | |
17 | | - | |
18 | | - | |
| 12 | + | |
19 | 13 | | |
20 | 14 | | |
21 | 15 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
This file was deleted.
0 commit comments