lablup / lablup/backend.ai

Refactor ScalingGroup PK from name to UUID

Open
#11,743 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
15h 13m
Merged PRs (30d)
368

Description

Background

The `scaling_groups` table currently uses its `name` column (VARCHAR) as the primary key. This forces every FK reference and external identifier across the codebase to carry a string name, which makes renames impossible, leaks user-visible names into internal data structures, and complicates RBAC scope handling.

This epic introduces a UUID `id` column to the `scaling_groups` table, demotes `name` to a unique constraint, and incrementally migrates downstream layers (API, FK columns, RBAC) to the new identifier.

Sub-stories

S-1: Add UUID `id` column, update ORM/Alembic, add ResourceGroupID identifier

S-2: Expose `id` in APIs and migrate identifier from `name` to `id` (REST, GraphQL, SDK, CLI)

S-3: Migrate FK references from `scaling_group`/`scaling_group_name`/`resource_group` to `scaling_group_id`

S-4: Migrate RBAC `ScalingGroup(name)` scope and related data/logic to id-based

Dependency

1 must merge first; 2, 3, 4 can proceed in parallel afterwards (recommended order 3 → 4 to keep RBAC mapping consistent with FK state).

Note

Split from BA-6043 (which now tracks only the Domain track).

JIRA Issue: BA-6145

Contributor guide

Open the contributing guide

Research direction

Begin with S-1 by locating the scaling_groups table, its ORM/Alembic definitions, and ResourceGroupID references. Review the dependency before starting S-2, S-3, or S-4. Done means the UUID identifier is introduced and the API, foreign-key, and RBAC migrations are completed across the listed sub-stories.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, python
Domain
api, authorization, backend, cli, databases
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.