Content
View differences
Updated by Kabiru Mwenja 2 days ago
Per <mention class="mention" data-id="32181" data-type="work_package" data-text="#FND-5" data-display-id="FND-5">#FND-5</mention> : "any "any user-created label that isn't isn't in use is also removed from the admin list of labels".
**Acceptance criteria**
* A label created from the work package form (inline, via the labels API) that no work package carries and that never appeared in a work package's history is removed automatically. Admin-created labels are never removed automatically.
* "Never appeared in history" means no journal snapshot references the label. A label added and removed again within the journal aggregation window leaves no snapshot and is removed; a label removed after the window stays, so activity entries keep rendering it.
* Removal happens nightly, and only for labels older than one day, so a label created before the work package that uses it is saved survives.
* Editing a label in Administration > Labels turns it into a curated label that is never removed automatically.
* A label deleted while journals still reference it renders as "(deleted label)" in the activity.
**Technical notes**
* `labels.created_inline` boolean, set only by `Labels::FindOrCreateService` (POST /api/v3/labels), cleared by `Labels::SetAttributesService` on admin edit.
* `Labels::CleanupUnusedInlineJob` (cron `37 2 * * *`): `Label.created_inline.never_used` older than one day, locked `FOR UPDATE SKIP LOCKED` before deletion so a concurrent work package save never loses its labeling.
* Depends on label journaling (COMMS-1022, PR #25320); PR #26187 is stacked on it.
* Out of scope: journaling an admin deletion of a used label with a name snapshot, exposing the flag in the API, showing the origin in the admin list. labels".
**Acceptance criteria**
* A label created from the work package form (inline, via the labels API) that no work package carries and that never appeared in a work package's history is removed automatically. Admin-created labels are never removed automatically.
* "Never appeared in history" means no journal snapshot references the label. A label added and removed again within the journal aggregation window leaves no snapshot and is removed; a label removed after the window stays, so activity entries keep rendering it.
* Removal happens nightly, and only for labels older than one day, so a label created before the work package that uses it is saved survives.
* Editing a label in Administration > Labels turns it into a curated label that is never removed automatically.
* A label deleted while journals still reference it renders as "(deleted label)" in the activity.
**Technical notes**
* `labels.created_inline` boolean, set only by `Labels::FindOrCreateService` (POST /api/v3/labels), cleared by `Labels::SetAttributesService` on admin edit.
* `Labels::CleanupUnusedInlineJob` (cron `37 2 * * *`): `Label.created_inline.never_used` older than one day, locked `FOR UPDATE SKIP LOCKED` before deletion so a concurrent work package save never loses its labeling.
* Depends on label journaling (COMMS-1022, PR #25320); PR #26187 is stacked on it.
* Out of scope: journaling an admin deletion of a used label with a name snapshot, exposing the flag in the API, showing the origin in the admin list.