Skip to content

WIP: MariaDB baseline rescue and CI handoff - #107

Draft
thedancingdeveloper wants to merge 9 commits into
mainfrom
feat/mariadb-baseline
Draft

WIP: MariaDB baseline rescue and CI handoff#107
thedancingdeveloper wants to merge 9 commits into
mainfrom
feat/mariadb-baseline

Conversation

@thedancingdeveloper

Copy link
Copy Markdown
Collaborator

Status

Rescues the in-flight MariaDB baseline work and records the handoff issues. This is intentionally a draft.

Blocking review

Verification

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-features --locked -- -D warnings
  • The full Rust test suite was previously run locally; ignored MariaDB tests still require a live service.

See docs/2026-08-03-handoff-issues.md for the evidence register.

thedancingdeveloper and others added 6 commits August 2, 2026 21:52
Preservation commit. A previous agent performed most of P1's database work
and crashed before committing any of it; 94 files were sitting unstaged on
this branch with zero commits ahead of main.

Nothing here is reviewed. Committed as-is, unsplit, so the work survives.
State at time of rescue, measured against origin/main (81c865b):

  migrations      18 files deleted, replaced by 001_baseline.sql
                  (907 lines, 60 tables, MariaDB 11.4 dialect)
  sqlx feature    postgres -> mysql
  PgPool refs     153 -> 0
  $n placeholders 1420 -> 1
  ON CONFLICT     77 -> 0
  RETURNING       78 -> 8
  crate rename    stackarr-postgres -> stackarr-mariadb

Two things need a decision before any of this becomes a PR:

1. The rename dropped the embedded-database subsystem. stackarr-postgres
   was 1,216 LOC of Postgres provisioning (download binaries, initdb,
   supervise a child process, in external/managed/embedded modes).
   stackarr-mariadb is 98 LOC; config.rs, lifecycle.rs and provision.rs
   were deleted rather than ported. Whether StackArr still ships a
   self-provisioning database is a product decision, not a task detail.

2. This spans T21-T25 in one commit. It must be split per item before
   review, since the repository requires one item per branch and PR.

Refs #59, #60, #61, #62, #64
The rescued swap renamed crates/stackarr-postgres to crates/stackarr-mariadb
in Cargo.toml but left AGENTS.md naming the old crate, so the doc-drift guard
landed by T29 failed:

  $ python3 scripts/check_workspace_docs.py
  workspace documentation drift: Cargo.toml has [... 'crates/stackarr-mariadb'],
  AGENTS.md has [... 'crates/stackarr-postgres']
  exit=1

Now green: "workspace documentation verified: 17 members".

Also drops the sentence announcing the rename as future work, since it has
happened. This is the guard doing exactly the job §P0.3 gave it.

Refs #60
The rescued swap converted Rust code but left every surface around it on
PostgreSQL, so the binary spoke the sqlx mysql driver while the deployment
stack still started postgres:17 and handed it a postgresql:// URL. P1's exit
criterion — a fresh docker run reaching /health from an empty database — could
not have passed.

Runtime and deployment:
  docker/docker-compose.yml       postgres:17 -> mariadb:11.4, mysql:// URL
  docker/docker-compose.dev.yml   likewise; now publishes 3306, matching the
                                  TEST_DATABASE_URL default the tests already
                                  assumed
  docker/docker-compose.prod.yml  likewise; volume path and the required env
                                  var change (see below)
  docker/docker-compose.test.yml  likewise
  docker/run-tests.sh             pg_isready -> healthcheck.sh
  tests/e2e/*.yml, *.toml         five stacks and five configs
  docker/mariadb-init/            new: grants the dev account server-wide
                                  CREATE/DROP, which TestDb needs to make and
                                  drop a database per test

CI (T19, the MariaDB-service part):
  - mariadb:11.4 service container on the test job, with a health gate
  - TEST_DATABASE_URL pointing at it
  - a second test step running the #[ignore]d tests. Those 31 tests are the
    only ones that touch a real server, so without this the service container
    would have proved nothing.

Source and config:
  - 34 stale #[ignore = "requires running postgres"] reasons
  - two connect_lazy() URLs still using the postgresql:// scheme
  - config.example.toml and stackarr.toml still advertising port 5432
  - no "postgres" left in any .rs file

Docs:
  - docs/DATABASE.md rewritten for MariaDB and the single baseline. It had
    described 18 migrations that no longer exist and a PgPool API.
  - docs/UNIFIED-ARR-PLAN.md: corrected two statements that said the swap was
    concentrated in stackarr-postgres and amounted to a rename. That crate
    held zero PgPool and zero sqlx references.

Deployment-affecting, needs a human decision before deploy:
  - prod requires STACKARR_MARIADB_PASSWORD, not STACKARR_POSTGRES_PASSWORD
  - the prod data volume moves to .../stackarr/mariadbdata
  - docker/Dockerfile.standalone builds --features managed-postgres, which the
    rename deleted. Left in place and flagged in-file rather than rewritten or
    removed, because whether StackArr still ships a self-provisioning database
    is a product decision. Nothing in CI builds it.
  - the indexarr sidecar keeps its own postgres service; D8 (#29) owns whether
    it merges in, so this change does not decide it.

Gates, locally, with no server present:
  cargo fmt --all -- --check                     pass
  cargo clippy --workspace --all-features -Dwarn pass
  cargo test --workspace --all-features          1010 passed, 0 failed, 31 ignored
  scripts/check_workspace_docs.py                pass
  scripts/check_dependency_sources.py            pass

The 31 ignored tests have still never executed against MariaDB — no docker
daemon on this host. The new CI step is the first thing that will run them.

Refs #57, #58, #59, #60, #61, #62, #63, #64
Commits the working-tree change that was sitting unstaged, plus the
handoff issue register.

NOT complete T19. Still missing, and raised as #105: coverage ratcheting
(the referenced coverage-watchdog is a monitoring web application, not a
Rust coverage-ratchet command, so a tool decision and a recorded baseline
are needed first), and musl, which is not representable as a Docker
platform.

Committed rather than left in the working tree because that is how work
gets destroyed -- this checkout already lost most of a day's rescue to
being uncommitted once. Deliberately NOT pushed: the register makes
pushing conditional on T20 (#58) acceptance.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@thedancingdeveloper

Copy link
Copy Markdown
Collaborator Author

Harness execution update: T19 was selected after human-decision/epic rows were blocked as queue cleanup, but the Fleet worker exited with the item claimed and session orphaned (tracked in agent-harness#87). T19 was re-queued and no application fix was applied. The PR remains draft/dirty pending careful ci.yml conflict resolution and upstream harness lifecycle repair.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant