Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0d635a2
Test a cliff result per simulation run and its grants (failing)
anth-volk Nov 17, 2026
a2b29de
Record each simulation run's cliff calculations, with grants
anth-volk Nov 17, 2026
becca3b
Name the cliff impacts revision in the downgrade notes and table lists
anth-volk Nov 17, 2026
a4be631
Count cliff_impacts in the import test's v2 table total
anth-volk Nov 17, 2026
026892f
Merge master into the cliff impacts branch
anth-volk Nov 18, 2026
ddc422c
Call the service API v1 in the cliff impacts text
anth-volk Nov 19, 2026
e87b0ea
Merge master into the cliff impacts branch, after the dynamics revision
anth-volk Nov 19, 2026
c0b879a
Reach the dynamics revision by a downgrade in its downgrade test
anth-volk Nov 19, 2026
ac9f05c
Check the dynamics downgrade's rollback directly, and reword its comment
anth-volk Nov 19, 2026
d18a530
Require CI to run the dynamics migration and persistence tests (failing)
anth-volk Nov 19, 2026
dc706b5
Run the dynamics migration and persistence tests in CI
anth-volk Nov 19, 2026
22616f1
Check the dynamics tests' target first, and keep them out of the inte…
anth-volk Nov 19, 2026
cc86a0f
Require every database statement to go through the ORM (failing)
anth-volk Nov 24, 2026
ac7340b
Give tests ORM session factories, and move the shared row helpers ont…
anth-volk Nov 24, 2026
b619638
Run every database statement in API v1 through the ORM
anth-volk Nov 24, 2026
7765900
Test review round 1's findings in the ORM rule and conversion (failing)
anth-volk Nov 24, 2026
e6b195a
Fix review round 1's findings in the ORM rule and conversion
anth-volk Nov 24, 2026
6bcd4ea
Test review round 2's findings in the ORM rule's checker (failing)
anth-volk Nov 24, 2026
f642b35
Fix review round 2's findings in the ORM rule's checker
anth-volk Nov 24, 2026
69f0381
Test review round 3's findings in the ORM rule's checker (failing)
anth-volk Nov 24, 2026
4b2bbfa
Fix review round 3's findings in the ORM rule's checker
anth-volk Nov 24, 2026
41d63f3
Add a changelog fragment for running every database statement through…
anth-volk Nov 24, 2026
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
4 changes: 3 additions & 1 deletion .github/scripts/test_alembic_v2_lifecycle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ uv run --frozen --extra dev pytest -q \
tests/integration/test_alembic_v2_saved_item_keys.py \
tests/integration/test_alembic_v2_user_types.py \
tests/integration/test_alembic_v2_withheld_area_codes.py \
tests/integration/test_alembic_v2_shared_report_keys.py
tests/integration/test_alembic_v2_shared_report_keys.py \
tests/integration/test_alembic_v2_cliff_impacts.py \
tests/integration/test_alembic_v2_dynamics.py
8 changes: 4 additions & 4 deletions .github/workflows/v2-integration-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ jobs:
run: uv run --frozen --extra dev python scripts/reconcile_v2_privileges.py verify
- name: Test v2 metadata publication, resource routes, the countries list, reports, simulations and users' report runs
run: uv run --frozen --extra dev coverage run --branch -m pytest -q tests/integration/test_v2_catalog_publication.py tests/integration/test_v2_catalog_publication_time_periods.py tests/integration/test_v2_catalog_publication_pruning.py tests/integration/test_v2_catalog_spm_availability.py tests/integration/test_v2_catalog_statistics.py tests/integration/test_v2_metadata_routes.py tests/integration/test_v2_country_routes.py tests/integration/test_v2_report_reads.py tests/integration/test_v2_report_creation.py tests/integration/test_v2_budget_window_report_reads.py tests/integration/test_v2_budget_window_report_creation.py tests/integration/test_v2_report_runs.py tests/integration/test_v2_report_reads_by_run.py tests/integration/test_v2_user_report_runs.py tests/integration/test_v2_user_report_run_requesters.py tests/integration/test_v2_user_budget_window_runs.py tests/integration/test_v2_forced_report_reruns.py tests/integration/test_v2_user_report_views.py
- name: Test v2 policy persistence and immediate v1 mirroring
run: uv run --frozen --extra dev coverage run -a --branch -m pytest -q tests/integration/test_v2_policy_persistence.py tests/integration/test_v1_policy_dual_write.py tests/integration/test_mysql_policy_dual_write.py tests/integration/test_v2_user_policy_mirroring.py tests/integration/test_v1_user_policy_dual_write.py
- name: Test v2 policy and dynamic persistence and immediate v1 mirroring
run: uv run --frozen --extra dev coverage run -a --branch -m pytest -q tests/integration/test_v2_policy_persistence.py tests/integration/test_v2_dynamic_persistence.py tests/integration/test_v1_policy_dual_write.py tests/integration/test_mysql_policy_dual_write.py tests/integration/test_v2_user_policy_mirroring.py tests/integration/test_v1_user_policy_dual_write.py
- name: Test signed-in identity provisioning, user associations, saved detailed-save records and user types
run: uv run --frozen --extra dev coverage run -a --branch -m pytest -q tests/integration/test_v2_user_identity_persistence.py tests/integration/test_v2_user_type_persistence.py tests/integration/test_v2_saved_detailed_save_records.py tests/integration/test_v2_saved_budget_window_reports.py
- name: Test comparison-run persistence, the simulation API's roles, shared reports and runs, and privilege reconciliation as the managed roles
run: uv run --frozen --extra dev coverage run -a --branch -m pytest -q tests/integration/test_v2_stage12_comparison_persistence.py tests/integration/test_v2_simulation_role_privileges.py tests/integration/test_v2_shared_report_rows.py tests/integration/test_v2_privilege_reconciliation.py
- name: Test comparison-run persistence, the simulation API's roles, shared reports and runs, privilege reconciliation as the managed roles, the v2 migration target checks as roles that don't own the database, and the tests' database sessions
run: uv run --frozen --extra dev coverage run -a --branch -m pytest -q tests/integration/test_v2_stage12_comparison_persistence.py tests/integration/test_v2_simulation_role_privileges.py tests/integration/test_v2_shared_report_rows.py tests/integration/test_v2_privilege_reconciliation.py tests/integration/test_v2_migration_target_persistent.py tests/integration/test_database_sessions.py
- name: Test v2 household persistence, immediate v1 copying, household calculation reads and household reports
run: uv run --frozen --extra dev coverage run -a --branch -m pytest -q tests/integration/test_v2_household_persistence.py tests/integration/test_v1_household_dual_write.py tests/integration/test_mysql_household_spm_dual_write.py tests/integration/test_v2_household_calculation_reads.py tests/integration/test_v2_household_reports.py
- name: Test the row counts v1 ORM updates report on MySQL
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ To add or change a rule, read `docs/engineering/skills/rules-registry.md`.

### Runtime persistence and route boundaries

- Checked: `api.data.runtime-sql-confined`, `api.data.sqlalchemy-and-alembic-only`, `api.legacy.removed-layers-stay-removed`, `api.routes.flask-blueprints-own-urls`, `api.routes.no-domain-logic-in-http`, `api.routes.no-inline-json-errors`, `api.services.no-direct-queries`, `api.services.session-ownership`
- Checked: `api.data.orm-only`, `api.data.runtime-sql-confined`, `api.data.sqlalchemy-and-alembic-only`, `api.legacy.removed-layers-stay-removed`, `api.routes.flask-blueprints-own-urls`, `api.routes.no-domain-logic-in-http`, `api.routes.no-inline-json-errors`, `api.services.no-direct-queries`, `api.services.session-ownership`

### Import and startup side effects

Expand Down
1 change: 1 addition & 0 deletions changelog.d/simulation-run-cliff-impacts.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The v2 database can store one cliff result per simulation run, its cliff gap and cliff share, with the state of its calculation. The simulation service may start each calculation, its Modal workers may write the result, and API v1 may read it.
1 change: 1 addition & 0 deletions changelog.d/v2-orm-only-database-statements.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
API v1 runs every database statement through SQLAlchemy's ORM, in its production code, scripts and tests, and rule api.data.orm-only enforces it; the few statements SQLAlchemy can't express, such as GRANT and COPY, are named exceptions. Commands, their arguments and their environment variables are unchanged.
Loading
Loading