Write dev seed data for representative local environment #19

Closed
opened 2026-06-07 15:28:58 +00:00 by ldraney · 1 comment
Owner

Type

Feature

Lineage

Standalone — dev database only has placeholder data. Need representative seeds for local development.

Repo

ldraney/palinks

User Story

As a developer
I want to run rails db:seed and get a realistic local dataset
So that I can develop and test features against representative data without connecting to prod

Context

Dev database currently has three placeholder links (GitHub, Ruby Docs, Rails). As palinks evolves into a multi-user app with visibility tiers, feature flags, and click tracking, dev needs representative data across all these dimensions. Seeds are opt-in via rails db:seed — never run automatically on container start.

File Targets

  • db/seeds.rb — write seed data

Acceptance Criteria

  • db/seeds.rb uses find_or_create_by for idempotency (safe to run multiple times)
  • Includes links with varied metadata (tags, categories)
  • Mix of favorited and non-favorited links
  • Some links with forgejo_url, some without
  • Covers enough variety to exercise filtering, sorting, and future click tracking
  • Works against current schema (no dependency on unreleased migrations)
  • Evolves to include visibility tiers once that column lands

Test Expectations

  • Run rails db:seed twice — no duplicates, no errors
  • Run command: docker compose exec web bundle exec rails db:seed

Constraints

  • Must be idempotent — find_or_create_by not create
  • No dependency on migrations that haven't shipped yet
  • Don't seed production-only data (real URLs, credentials, etc.)

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • ldraney/palinks #17 — visibility tiers will inform seed categories
  • story:auth-roles
### Type Feature ### Lineage Standalone — dev database only has placeholder data. Need representative seeds for local development. ### Repo `ldraney/palinks` ### User Story As a developer I want to run `rails db:seed` and get a realistic local dataset So that I can develop and test features against representative data without connecting to prod ### Context Dev database currently has three placeholder links (GitHub, Ruby Docs, Rails). As palinks evolves into a multi-user app with visibility tiers, feature flags, and click tracking, dev needs representative data across all these dimensions. Seeds are opt-in via `rails db:seed` — never run automatically on container start. ### File Targets - `db/seeds.rb` — write seed data ### Acceptance Criteria - [ ] `db/seeds.rb` uses `find_or_create_by` for idempotency (safe to run multiple times) - [ ] Includes links with varied metadata (tags, categories) - [ ] Mix of favorited and non-favorited links - [ ] Some links with `forgejo_url`, some without - [ ] Covers enough variety to exercise filtering, sorting, and future click tracking - [ ] Works against current schema (no dependency on unreleased migrations) - [ ] Evolves to include visibility tiers once that column lands ### Test Expectations - [ ] Run `rails db:seed` twice — no duplicates, no errors - [ ] Run command: `docker compose exec web bundle exec rails db:seed` ### Constraints - Must be idempotent — `find_or_create_by` not `create` - No dependency on migrations that haven't shipped yet - Don't seed production-only data (real URLs, credentials, etc.) ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `ldraney/palinks #17` — visibility tiers will inform seed categories - `story:auth-roles`
Author
Owner

Scope Review: READY

Review note: review-1381-2026-06-07
Ticket is well-scoped for a single agent pass. All template sections present, file target verified, no blocking dependencies.

Non-blocking observations:

  • project-palinks page and arch-palinks note do not yet exist in pal-e-docs (affects all palinks board items, not specific to this ticket)
  • AC mentions "categories" but schema only has tags in metadata JSONB — implementing agent can interpret correctly from model code
## Scope Review: READY Review note: `review-1381-2026-06-07` Ticket is well-scoped for a single agent pass. All template sections present, file target verified, no blocking dependencies. Non-blocking observations: - `project-palinks` page and `arch-palinks` note do not yet exist in pal-e-docs (affects all palinks board items, not specific to this ticket) - AC mentions "categories" but schema only has tags in metadata JSONB — implementing agent can interpret correctly from model code
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/palinks#19
No description provided.