feat: enforce required baseline issue statuses with custom status support #681
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Since the custom status dropdown is replacing the traditional open/closed buttons, there needs to be a guaranteed set of baseline statuses that always exist. Organizations can add custom statuses on top of these, but the required set cannot be deleted.
Required Baseline Statuses
These statuses must always exist for every org and cannot be removed:
Current Behavior
/-/admin/issue-statusesor APIDesired Behavior
is_required: truein the databaseImplementation Notes
is_required boolcolumn toissue_status_definitiontableis_required = trueCritical: Open/Closed must be indestructible
The
OpenandClosedstatuses are the two that map directly to Gitea's internalis_closedboolean on issues. If a user deleted either of these:Closeddeleted)Opendeleted)state: "closed"orstate: "open"would have no status to resolve tois:openandis:closedwould breakSafety layers needed:
is_required = truecolumn, seeded on org creation403 Forbiddenwith message "Cannot delete required status"The other baseline statuses (In Progress, Waiting, In Review, Won't Fix) are strongly recommended but their deletion wouldn't break core functionality — only
OpenandClosedare truly critical.