Drop scaling_group_name column from session row
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 368
Description
Goal
Remove sessions.scaling_group_name now that all writers and readers use resource_group_id (or resolve the name via join). Final step of the session-side id migration; kernels/agents legacy name columns and the PK swap are handled in BA-6050.
Scope
- ORM: remove SessionRow.scaling_group_name; rewire the scaling_group relationship to the resource_group_id FK (models/session/row.py ~:456-461).
- Alembic: drop the column. Optional: also drop the dead target_sgroup_names column (list of names, never read by the scheduler) to clear name remnants in one pass.
- Sweep remaining compile-time references; SessionData.scaling_group_name stays as an API-compat field populated via the join/relationship.
Success Criteria
- [ ] sessions table has no scaling_group_name; sessions reference scaling groups by resource_group_id only
- [ ] Full session lifecycle works on the live server: create -> schedule -> app launch -> terminate
- [ ] All GQL/REST session list/filter/order queries pass
- [ ] pants test passes for affected packages
JIRA Issue: BA-6713
Contributor guide
Research direction
Start in models/session/row.py around lines 456-461, then locate the Alembic migration and sweep remaining compile-time references to SessionRow.scaling_group_name. Verify that SessionData.scaling_group_name remains API-compatible, the sessions table uses resource_group_id only, and the full lifecycle, GQL/REST queries, and affected-package pants tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, databases
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100