lablup / lablup/backend.ai

Drop the removed association_scopes_entities blocks that abort the manager fixtures

Open Beginner friendly
#14,485 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

## Goal

Restore the RBAC seed data that `install-dev.sh` loads, by dropping the `association_scopes_entities` blocks left behind in two manager fixtures.

## Background

BA-7796 removed the table from the ORM metadata, but `fixtures/manager/example-users.json` and `fixtures/manager/example-roles.json` still declare it as a top-level key. `populate_fixture` looks every top-level key up in `metadata.tables` and raises `DataTransformationFailed` when it is missing. It also commits one table per transaction, so the abort keeps every table before the key and loses every table after it.

Lost on a fresh install:

- `example-users.json`: virtual_entities, entity_memberships, scope_bindings
- `example-roles.json`: role_presets, role_permission_presets, virtual_entities, entity_memberships, scope_bindings

Observed consequences on a fresh dev install: creating a vfolder fails with `VFolder ... was created in no project`, and `mgr image rescan` fails with `No virtual entity for entities: container_registry:`. install-dev.sh still exits 0, so the breakage surfaces only as two ERROR lines in its output.

## Acceptance criteria

- Neither fixture declares `association_scopes_entities` any more.
- A fresh `install-dev.sh` loads every table in both files.
- VFolder creation and `mgr image rescan` work on a fresh dev install.

## Notes

- Nothing is lost by the deletion. The 10 entries in example-users.json are all (project, user) and are already present in `entity_memberships`; 22 of the 27 in example-roles.json likewise.
- The remaining 5 are user->keypair, which the new model cannot express: `virtual_entities.entity_id` is a uuid column while those carry an access key string, and no current code treats a keypair as an RBAC entity. Whether that is intended is for BA-7796 to say.
- Related but out of scope: `populate_fixture` returns rather than continues when a table's row list is empty, which would silently skip every table after it.

JIRA Issue: BA-7815

Contributor guide

Open the contributing guide

Research direction

Start with fixtures/manager/example-users.json and fixtures/manager/example-roles.json, then inspect populate_fixture and metadata.tables to confirm why the stale top-level key aborts loading. Run install-dev.sh on a fresh development install and verify that all fixture tables load; done when vfolder creation and mgr image rescan succeed without fixture errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
authorization, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.