Skip to content

feat(seed): generate Profile workspace data alongside migrations - #37

Merged
cvega merged 1 commit into
mainfrom
feat/seed-profile-data
Jun 19, 2026
Merged

feat(seed): generate Profile workspace data alongside migrations#37
cvega merged 1 commit into
mainfrom
feat/seed-profile-data

Conversation

@cvega

@cvega cvega commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Summary

The seed script (bun run seed) only populated the Migrate workspace, leaving the Profile workspace empty for UI stress-testing. This extends it to also generate realistic profile data, mirroring the migrate seed's richness.

What's seeded

  • Standalone org runs across every state — 6 completed (28–305 repos each), plus one each of running, paused, and failed.
  • Two enterprise runs — one completed (8 child orgs) and one still crawling (a live child + an inaccessible-org count), exercising the aggregate roll-up, the inaccessible-orgs banner, and child drill-down.
  • Genuine considerations — per-repo signals run through the real analyzeRepo engine, so the stored considerations / blockers / warnings match what a live crawl records (not hand-faked). Signal ranges occasionally trip the size blockers (2 GiB disk, 10/40 GiB release assets) and the warning/info considerations (LFS, packages, webhooks, rulesets, …) for a realistic mix.

All rows use a seed- id prefix and are deleted + regenerated on each run (existing real data is untouched).

Parity fix: keep seeded running data alive across reboot

The Migrate seed's running rows survive a dev reboot because recovery skips seed-%. The Profile recovery had no such exclusion, so seeded running runs would be failed on first boot. This adds the same seed-% exclusion to:

  • recoverInterruptedProfiles (both the org and enterprise UPDATEs)
  • listStandaloneRunningProfileRuns / listRunningEnterpriseRuns (so the with-creds resume path doesn't try to crawl fake seeded orgs either)

A new schema.test.ts test asserts seeded running runs are left intact while non-seed runs are still recovered. (Paused runs were already safe — recovery only touches running.)

Verification

  • Data integrity (queried): all 4 states present, enterprise aggregates correct, 0 FK orphans, 0 JSON parse failures, all 315 real (non-seed) runs preserved.
  • Live boot: the seeded running run survives startup recovery (proving the exclusion); /api/profile lists all 9 standalone runs with correct states.
  • Browser-smoked: the Profile feed, the completed-enterprise detail page (aggregate tiles, the "3 organizations not accessible" banner from the seeded inaccessible_orgs, and 8 child org runs with drill-down) all render.
  • Full gate suite green, coverage 89.46 / 86.74.

Files

  • scripts/seed.ts — profile seeding (the bulk of the change)
  • src/lib/server/profile/schema.ts, store.tsseed-% recovery exclusion (migrate parity)
  • src/lib/server/profile/schema.test.ts — exclusion test

The seed script only populated the Migrate workspace, leaving the Profile
workspace empty for UI stress-testing. Extend it to also seed profile data:

- Standalone org runs across every state — 6 completed (28–305 repos), plus
  one each of running, paused, and failed.
- Two enterprise runs (one completed with 8 child orgs, one still crawling
  with a live child + inaccessible-org count) that exercise the aggregate
  roll-up and drill-down.
- Per-repo signals are run through the real `analyzeRepo` engine, so the
  stored considerations / blockers / warnings are genuine, not hand-faked.
  Signal ranges occasionally trip the size blockers (2 GiB disk, 10/40 GiB
  release assets) and the warning/info considerations (LFS, packages,
  webhooks, rulesets, …) for a realistic mix.

All rows use a `seed-` id prefix and are deleted+regenerated each run.

Parity with the Migrate seed: profile startup recovery now also skips
`seed-%` rows (recoverInterruptedProfiles + the list-running queries), so
seeded running/enterprise runs survive a dev reboot instead of being failed.

Verified: seeded data renders across the Profile feed, enterprise detail
(aggregates + inaccessible-orgs banner + child drill-down), and the running
run survives boot. Full gate suite green (coverage 89.46/86.74).
@cvega
cvega merged commit 33205f0 into main Jun 19, 2026
2 checks passed
@cvega
cvega deleted the feat/seed-profile-data branch June 19, 2026 23:28
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