Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ For app-surface changes, inspect the proof app at

- **Backend:** `backend/druks/` contains FastAPI, DBOS, SQLAlchemy 2.0,
Pydantic v2, and bundled apps.
- **Migrations:** `backend/migrations/` contains platform Alembic migrations.
- **Migrations:** `backend/druks/migrations/` contains platform Alembic migrations.
- **Tests:** `backend/tests/` contains the pytest suite backed by real Postgres.
- **Proof app:** `backend/tests/druks-field_notes/` contains the independently
packaged proof app.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion backend/druks/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from druks.db import db_session
from druks.settings import load_settings

_ALEMBIC_INI = Path(__file__).resolve().parent.parent / "alembic.ini"
_ALEMBIC_INI = Path(__file__).resolve().parent / "alembic.ini"
_MIGRATION_SUPPORT_ONLY = "migration_support_only"


Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions backend/tests/test_activity_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ async def test_event_transaction_migration_preserves_history(druks_db):
before = (await druks_db.execute(select(Event.id, Event.payload))).all()
migration = (
Path(__file__).resolve().parent.parent
/ "druks"
/ "migrations/versions/8b194c60e72a_event_transaction_visibility.py"
)
spec = importlib.util.spec_from_file_location("event_transaction_visibility", migration)
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/test_app_migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# that serves every app. These tests run a synthetic app's revisions through it
# from an external version_locations, proving the target shape: shared env, the
# app's own version_locations and version_table, isolated from core's history.
_ALEMBIC_INI = Path(__file__).resolve().parent.parent / "alembic.ini"
_ALEMBIC_INI = Path(__file__).resolve().parent.parent / "druks" / "alembic.ini"


class MigrationProbeFile(Base):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# inside the suite's rolled-back transaction and runs the real upgrade on it.
_MIGRATION = (
Path(__file__).resolve().parent.parent
/ "druks"
/ "migrations"
/ "versions"
/ "7e1c4b9d2a58_agents_resolve_on_user_settings.py"
Expand Down
1 change: 1 addition & 0 deletions backend/tests/test_migration_app_qualified_agent_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# current schema.
_MIGRATION = (
Path(__file__).resolve().parent.parent
/ "druks"
/ "migrations"
/ "versions"
/ "d2f7a9c4e816_app_qualified_agent_ids.py"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

_MIGRATION = (
Path(__file__).resolve().parent.parent
/ "druks"
/ "migrations"
/ "versions"
/ "b4d7e2a9c1f6_merge_review_into_software_factory.py"
Expand Down
8 changes: 7 additions & 1 deletion backend/tests/test_personal_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,13 @@ def upgrade(connection):
"7dc609a2d51a_move_preferences_to_accounts.py",
"b43924bf37db_enforce_installation_settings_singleton.py",
):
path = Path(__file__).resolve().parent.parent / "migrations" / "versions" / filename
path = (
Path(__file__).resolve().parent.parent
/ "druks"
/ "migrations"
/ "versions"
/ filename
)
spec = importlib.util.spec_from_file_location("settings_migration", path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/test_proof_app_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# out-of-tree package's hand-written baseline applies cleanly and tracks its own head,
# independent of core's. Manages its own DDL (via an AUTOCOMMIT engine) and cleans up, so
# it opts out of the suite's transaction-rollback isolation (conftest ``_OWN_DATABASE_MODULES``).
_ALEMBIC_INI = Path(__file__).resolve().parent.parent / "alembic.ini"
_ALEMBIC_INI = Path(__file__).resolve().parent.parent / "druks" / "alembic.ini"
_PACKAGE_ROOT = Path(__file__).resolve().parent / "druks-field_notes" / "druks_field_notes"
_VERSIONS = _PACKAGE_ROOT / "migrations" / "versions"

Expand Down
4 changes: 2 additions & 2 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ contains the built SPA and serves it from FastAPI.
| `backend/druks/contrib/software_factory/` | Bundled reference app, not framework core |
| `frontend/src/` | Shared dashboard shell and bundled app UI |
| `frontend/src/druksui/` | The renderer for an app's Python pages |
| `backend/migrations/` | Core/bundled schema history |
| `backend/druks/migrations/` | Core/bundled schema history |
| `deploy/`, `scripts/` | Images, Compose, Caddy, setup, and deployment |

The API process embeds DBOS and executes workflows. App modules register
Expand Down Expand Up @@ -110,7 +110,7 @@ tests together.
Core and bundled historical tables use the core Alembic history:

```bash
uv run alembic -c backend/alembic.ini revision --autogenerate -m "describe change"
uv run alembic -c backend/druks/alembic.ini revision --autogenerate -m "describe change"
uv run druks init-db
```

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ include = [
line-length = 100
target-version = "py311"
# Alembic-generated revisions are machine-written; don't hand-lint them.
extend-exclude = ["backend/migrations/versions"]
extend-exclude = ["backend/druks/migrations/versions"]

[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B", "SIM", "TID251"]
Expand Down
Loading