Skip to content

Archive labels #25237

Closed
Closed
@delvh

Description

@delvh

Feature Description

Sometimes, old labels should not be used anymore.
For Gitea, for example, those are the backport/v* labels.
Currently, the only way to stop them from polluting the search results when trying to assign labels to an issue or PR is to delete them completely.
However, this has the drawback that any old issue/PR that had that label loses it, thus losing information.
Instead, it would probably be better to filter out archived labels from the search results and keep them for anything that already has these labels.
So, in a sense, what I propose is a sort of soft deletion for labels (except instead of a boolean we store a timestamp that means unarchived when 0 and displays when this label was archived).
This also aligns with milestones and projects as you can close both already, which is their equivalent of archiving.
Labels are currently an outlier in their behavior among the "three scrum tools".

Proposed Approach

  • Add a checkbox archive(d) on the edit label screen (and to the PATCH API route /repos/{owner}/{repo}/labels/{id})
  • when editing a label and it is newly archived, store ArchivedUnix timestamp(now) inside the db
  • when a label is edited and no longer archived, set the archived timestamp to 0
  • when viewing a specific issue/ the issue list, display all labels on all issues
  • Behavior unclear yet:
    • when assigning labels to an issue, should we only suggest unarchived labels?
    • when viewing the issue list, should we suggest searching by archived labels as well?
    • in both these cases, these are the available approaches:
      1. add a checkbox include archived labels inside the suggestion box that is de-selected by default, and re-triggers the search when changed. Needs a lot of UI changes
      2. do not suggest them unless they are entered exactly into the search field. Doesn't need a lot of UI changes except it should only be shown when the name matches exactly
    • do we count the number of unarchived labels or the number of all labels as the number of labels?

Metadata

Metadata

Assignees

Labels

proposal/acceptedWe have reviewed the proposal and agree that it should be implemented like that/at all.type/featureCompletely new functionality. Can only be merged if feature freeze is not active.type/proposalThe new feature has not been accepted yet but needs to be discussed first.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions