Skip to content

Move staging join-request seeding into devtools, retire seed_staging #1387

Description

@leahpeker

Context

The repo has three separate seed paths: seed.py (local dev), seed_staging.py (staging QA fixtures), and e2e_seed.py (Playwright scenarios). Staging no longer needs seed_staging.py's bulk-seeding role — staging is already seeded, and /dev/test-events/ in backend/community/_dev_tools.py already provides an on-demand devtools pattern for generating test data (gated behind _require_dev_tools / MANAGE_EVENTS permission) instead of a fixed idempotent script.

One piece of seed_staging.py is still genuinely useful day-to-day: seeding join requests in various states (pending/tentative/approved/rejected, with/without email, custom answers) via _seed_join_requests.py and the JOIN_REQUEST_SPECS table in _seed_staging_data.py. Rather than deleting that capability outright, it should move into devtools as an on-demand endpoint, mirroring create_dev_test_event.

What needs to happen

  • Add a new devtools endpoint (e.g. POST /dev/test-join-requests/) in backend/community/_dev_tools.py, gated the same way as create_dev_test_event (_require_dev_tools, same router).
  • Generate a randomized join request per call using the existing filler-name pools in backend/community/_dev_tools_populate.py (_FIRST_NAMES/_LAST_NAMES) rather than the fixed JOIN_REQUEST_SPECS list — random phone number, and a payload letting the caller choose status (pending/tentative/approved/rejected) and whether the request has an email, matching the boolean/count-driven shape of DevTestEventIn.
  • Populate custom_answers against whatever JoinFormQuestions currently exist.
  • Once the devtools endpoint covers this, remove the now-unused staging seed surface:
    • Delete seed_staging.py, _seed_staging_data.py, _seed_staging_rsvps.py, test_seed_staging.py.
    • Move is_seed_allowed (currently in _seed_staging_data.py) into _dev_tools.py, since that's its only remaining consumer.
    • Trim _seed_join_requests.py down to just seed_join_form_questions (still used by local seed.py); drop seed_join_requests/reset_join_requests and the staging import.
    • Remove the railway run --environment staging python backend/manage.py seed_staging line from CLAUDE.md.

Acceptance criteria

  • New devtools endpoint creates a join request with a chosen status and email presence, using randomized filler data in the same style as create_dev_test_event
  • seed_staging.py, _seed_staging_data.py, _seed_staging_rsvps.py, and test_seed_staging.py are deleted
  • is_seed_allowed lives in _dev_tools.py and _seed_join_requests.py no longer imports from the deleted staging data module
  • CLAUDE.md no longer references seed_staging
  • make agent-ci passes

Metadata

Metadata

Assignees

No one assigned

    Labels

    automanaged by issue-supervisor loopbackendfeatureNew functionalityp2Normal / later

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions