test(seed): assert demo seed is the clean baseline with no zQA/QA prefix (PMS-629) #447
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/PMS-629-demo-seed-no-zqa"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
PMS-629: guarantee the first-visit demo seed is the clean, un-prefixed baseline, never the
zQA/QA-E2E fixtures, with a regression test.Finding: the separation already exists
Investigating the current code, the demo seed and the QA E2E fixtures are already distinct paths, and there is no
zQAanywhere:src/modules/seed/data.rsviaensure_demo_seeded): "Acme Corporation (Demo)", Alice/Bob contacts, three demo tickets, all taggeddemo. No prefix.src/modules/seed/qa.rs):QA-prefix +qa-seedtag, fail-closed tosettings->>'is_qa' = truetenants, run manually viamokosh-server qa-seed.zQAappears only in atests/contacts.rssearch fixture, never in a seed path. The prefix the issue describes was already replaced byQA-gated tois_qatenants (PMS-157 demo seed + qa.rs gating).So AC1/AC2 were already satisfied by prior work; AC3/AC4 were largely covered by the existing
tests/seed_demo.rs. This PR makes the guarantee explicit and regression-proof.Change
Adds
demo_seed_is_the_clean_baseline_with_no_qa_prefixtotests/seed_demo.rs: a fresh tenant's first-visit seed must produce exactly the demo baseline company and contain zeroQA-/zQA-prefixed companies, contacts, or tickets. Updates the module doc to state the demo-vs-QA separation invariant.Acceptance criteria
qa.rsQA-prefix,is_qa-gated; documented.tests/seed_demo.rs(existing + new), run by the Integration job.Out of scope (noted): coordinating the DB-reset baseline is a docker/data-repo concern.
Testing
just pre-commitgreen (fmt / clippy -D / compile --all-targets / unit / doc). The new#[sqlx::test]runs against Postgres in the Integration job.#PMS-629
The demo seed and the zQA/QA E2E fixtures are already separate code paths: first-visit demo data comes from src/modules/seed/data.rs (obviously-fake names like "Acme Corporation (Demo)", tagged demo) via ensure_demo_seeded, while the QA fixtures live only in src/modules/seed/qa.rs behind the QA- prefix and the fail-closed is_qa tenant marker. Migration 023 seeds pure config (statuses, priorities, queues, SLA, work types), no entities. A repo-wide search finds no zQA in any seed path; the prefix the issue describes was already dropped in favour of QA- gated to is_qa tenants. This locks that separation in with a regression test: a fresh tenant's first-visit seed must produce exactly the demo baseline company ("Acme Corporation (Demo)") and contain zero QA-/zQA-prefixed companies, contacts, or tickets. Combined with the existing seed_demo tests (fresh-tenant counts, idempotency, the PMS-239 shared-tenant exclusion, and the emptiness guard), this covers the PMS-629 acceptance criteria: a fresh copy seeds to the expected clean baseline and no demo record is zQA-prefixed. Note: coordinating the DB-reset baseline to use this seed data is a docker/data-repo concern, outside mokosh-server. #PMS-629