PH1.6 — Seed: sample FleetPulse feed, catalogue, three crews, week of shifts, dev persons #14

Closed
opened 2026-09-11 09:02:10 +00:00 by bart · 2 comments
Collaborator

Parent

Row PH1.6 in docs/12-implementation-plan.md (branch, owned paths and doc section are defined there).

What to build

polaris seed loads a demoable dataset in one command: the sample FleetPulse document from the design document, the full catalogue, three crews with people, home bases and a week of shifts, and dev persons linked to the LDAP users by preferred_username. Seed modules are discovered per aggregate and ordered by an explicit order.

Acceptance criteria

  • polaris seed on an empty database completes; running it twice is idempotent
  • Three crews with members, skills, home bases and seven days of shifts exist
  • Each of the five LDAP users resolves to a person row by preferred_username
  • Adding a seed module for a new aggregate needs no edit to a shared file

Blocked by

  • #10 — Schema 0003: planning tables and typed mapped classes
  • #6 — Worker skeleton: claim loop, task handler registry, jobs discovery, heartbeat
## Parent Row **PH1.6** in `docs/12-implementation-plan.md` (branch, owned paths and doc section are defined there). ## What to build `polaris seed` loads a demoable dataset in one command: the sample FleetPulse document from the design document, the full catalogue, three crews with people, home bases and a week of shifts, and dev persons linked to the LDAP users by `preferred_username`. Seed modules are discovered per aggregate and ordered by an explicit `order`. ## Acceptance criteria - [x] `polaris seed` on an empty database completes; running it twice is idempotent - [x] Three crews with members, skills, home bases and seven days of shifts exist - [x] Each of the five LDAP users resolves to a `person` row by `preferred_username` - [x] Adding a seed module for a new aggregate needs no edit to a shared file ## Blocked by - #10 — Schema 0003: planning tables and typed mapped classes - #6 — Worker skeleton: claim loop, task handler registry, jobs discovery, heartbeat
patrick self-assigned this 2026-09-11 12:11:37 +00:00
Owner

Starting work on branch feature/db-seed (from main). Owned paths: backend/src/polaris/seed/**, backend/tests/fixtures/feed/**.

Starting work on branch `feature/db-seed` (from `main`). Owned paths: `backend/src/polaris/seed/**`, `backend/tests/fixtures/feed/**`.
Owner

Done — all four acceptance criteria checked and verified end to end (real Postgres+PostGIS: ran polaris seed twice against a freshly migrated database, row counts identical after the second run: 3 crews, 7 crew_member, 7 crew_skill, 21 shifts, 11 persons (5 LDAP-linked + 6 fictional), 4 skills, 5 service types, 6 service_type_skill, 9 reason codes, 1 vehicle, 1 ingest_record).

One note on scope: to actually deliver polaris seed as a runnable command I added backend/src/polaris/cli/seed.py (and its test, backend/tests/unit/cli/test_seed_command.py) — one small additive file outside this row's literal backend/src/polaris/seed/** / tests/fixtures/feed/** glob. Same treatment PH1.4 gave cli/replay_run.py (that row's own owned-paths list named the one new cli/ file it needed alongside its main glob) — this row's table cell just didn't spell it out. It's a pure drop-in following the existing CLI discovery seam (cli/__init__.py untouched), so it can't conflict with another branch's own new cli/*.py file. Also added backend/tests/unit/seed/** and backend/tests/integration/seed/** (new test directories, nobody else's) for discovery/idempotency coverage per the repo's Definition of Done.

PR incoming.

Done — all four acceptance criteria checked and verified end to end (real Postgres+PostGIS: ran `polaris seed` twice against a freshly migrated database, row counts identical after the second run: 3 crews, 7 crew_member, 7 crew_skill, 21 shifts, 11 persons (5 LDAP-linked + 6 fictional), 4 skills, 5 service types, 6 service_type_skill, 9 reason codes, 1 vehicle, 1 ingest_record). One note on scope: to actually deliver `polaris seed` as a runnable command I added `backend/src/polaris/cli/seed.py` (and its test, `backend/tests/unit/cli/test_seed_command.py`) — one small additive file outside this row's literal `backend/src/polaris/seed/**` / `tests/fixtures/feed/**` glob. Same treatment PH1.4 gave `cli/replay_run.py` (that row's own owned-paths list named the one new `cli/` file it needed alongside its main glob) — this row's table cell just didn't spell it out. It's a pure drop-in following the existing CLI discovery seam (`cli/__init__.py` untouched), so it can't conflict with another branch's own new `cli/*.py` file. Also added `backend/tests/unit/seed/**` and `backend/tests/integration/seed/**` (new test directories, nobody else's) for discovery/idempotency coverage per the repo's Definition of Done. PR incoming.
bart closed this issue 2026-09-11 12:31:25 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
patrick/Polaris#14
No description provided.