lablup / lablup/backend.ai

Purging an app config allow-list entry leaves the RBAC nodes of its cascaded fragments

Closed
#14,613 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

AppConfigAllowListPurger deletes the allow-list row, and the database cascades the delete to app_config_fragments through the (config_name, scope_type) foreign key (ON DELETE CASCADE). The generic purge path (V2WriteOps.purge_entity → _teardown) removes only the purged entity's own virtual entity and labels, so the cascaded fragments lose their rows but keep their virtual_entities rows and everything hanging off them by foreign key.

## Expected

- Purging an allow-list entry removes the virtual entity of every fragment the delete cascades to.

## What it needs

The same shape as the definition purge (BA-7879): the allow-list purge runs a service method whose repository deletes the fragments under the entry (an EntityBatchPurger selecting by the entry's config_name and scope_type) and then the entry, in one write_ops() transaction.

## Acceptance

- After purging an entry that has a fragment, no virtual_entities row remains for the fragment.
- A test seeds the entry, the fragment and their nodes directly and checks the graph after the purge.

## Related

Sibling of BA-7879 (definition purge), which found this gap on the allow-list path and left it out of scope.

JIRA Issue: BA-7882

Contributor guide

Open the contributing guide

Research direction

Start by locating AppConfigAllowListPurger, V2WriteOps.purge_entity, _teardown, and EntityBatchPurger, then compare the definition purge described in BA-7879 with the allow-list path. Add a test that seeds an entry, fragment, and nodes directly, runs the purge through one write_ops() transaction, and verifies that no fragment virtual_entities row or dependent graph remains.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.