Expose resource_group_id in session read model and v2 responses
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 17h 7m
- Merged PRs (30d)
- 358
Description
Goal
Carry resource_group_id through the session read model and expose it in v2 API responses, and key the GQL resource-group dataloader by id. This removes read-path dependence on the session name column and makes the v2 API symmetric: it accepts resource_group_id since BA-6681 but currently only returns the name.
Scope
- Read model: add resource_group_id to SessionData / ResourceSpec (data/session/types.py ~:182,245) and populate in to_dataclass / to_session_info (models/session/row.py ~:742,851).
- Strawberry GQL: expose resource_group_id on the session resource info type; switch the resource_group sub-object resolver (api/gql/session/types.py ~:372-377) from the name-keyed dataloader to an id-keyed one.
- v2 DTO: add resource_group_id to session response models (common/dto/manager/v2/session/response.py) and populate in api/adapters/session/adapter.py (~:942).
- Keep existing name fields (scaling_group_name / resource_group_name) unchanged for compatibility.
Success Criteria
- [ ] v2 REST/GQL session responses include resource_group_id
- [ ] GQL session resource_group sub-object resolves via the id-keyed loader
- [ ] Existing name fields keep returning the same values
- [ ] pants test passes for affected packages
JIRA Issue: BA-6710
Contributor guide
Research direction
Start with data/session/types.py and models/session/row.py to trace SessionData/ResourceSpec population, then inspect api/gql/session/types.py and the v2 response and adapter files named in the issue. Run the affected packages' pants tests; done means v2 REST/GQL responses expose resource_group_id, the GQL sub-object uses the id-keyed loader, and existing name fields remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100