Add forge_convert_labels.py to convert to templated labels (#1) #3

Manually merged
kparal merged 0 commits from label-convert into main 2026-04-29 10:56:53 +00:00
Owner

As part of the Pagure migration process, per-repo labels were
created to match Pagure's labels, priorities and statuses. But
in Forgejo we also have similar quality org-wide labels templated
from instance-wide labels, which is confusing and redundant.

This script runs on a Forgejo repo and removes the per-repo
priority labels, replacing them with the templated priority
labels. It also replaces 'bug' with 'Work Item/Bug' and
'task' with 'Work Item/Task', since they seem pretty good
equivalents.

We use color to distinguish between the per-repo and templated
priority labels as they actually have the exact same names. The
colors for the 'bug' and 'task' labels seem pretty consistent
from repo to repo, except one outlier where the 'task' color
was different; it's easy to edit on the fly if necessary.

Signed-off-by: Adam Williamson awilliam@redhat.com

As part of the Pagure migration process, per-repo labels were created to match Pagure's labels, priorities and statuses. But in Forgejo we also have similar quality org-wide labels templated from instance-wide labels, which is confusing and redundant. This script runs on a Forgejo repo and removes the per-repo priority labels, replacing them with the templated priority labels. It also replaces 'bug' with 'Work Item/Bug' and 'task' with 'Work Item/Task', since they seem pretty good equivalents. We use color to distinguish between the per-repo and templated priority labels as they actually have the exact same names. The colors for the 'bug' and 'task' labels seem pretty consistent from repo to repo, except one outlier where the 'task' color was different; it's easy to edit on the fly if necessary. Signed-off-by: Adam Williamson <awilliam@redhat.com>
As part of the Pagure migration process, per-repo labels were
created to match Pagure's labels, priorities and statuses. But
in Forgejo we also have similar quality org-wide labels templated
from instance-wide labels, which is confusing and redundant.

This script runs on a Forgejo repo and removes the per-repo
priority labels, replacing them with the templated priority
labels. It also replaces 'bug' with 'Work Item/Bug' and
'task' with 'Work Item/Task', since they seem pretty good
equivalents.

We use color to distinguish between the per-repo and templated
priority labels as they actually have the exact same names. The
colors for the 'bug' and 'task' labels seem pretty consistent
from repo to repo, except one outlier where the 'task' color
was different; it's easy to edit on the fly if necessary.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
kparal self-assigned this 2026-02-10 15:08:07 +00:00
kparal requested review from kparal 2026-02-10 15:08:23 +00:00
kparal added this to the Sprint 3 project 2026-02-10 16:12:35 +00:00
kparal removed this from the Sprint 3 project 2026-02-24 16:32:13 +00:00
First-time contributor

This script is referenced in the forge migration docs, but this PR is still unmerged. Is it ready for use?

This script is referenced in the [forge migration docs](https://docs.fedoraproject.org/en-US/forge-documentation/migration/pagure_repository/#_next_steps), but this PR is still unmerged. Is it ready for use?
Author
Owner

@kparal ? Was still waiting on your review, I guess.

As far as I'm concerned it's fine to use, but you might have to tweak it a bit to match the labels you actually want/need to migrate for your org/projects.

@kparal ? Was still waiting on your review, I guess. As far as I'm concerned it's fine to use, but you might have to tweak it a bit to match the labels you actually want/need to migrate for your org/projects.
Owner

Sigh, sorry, wanted to do it after the F44 cycle. But since Adam tested it in a real-world usage already, I'll just merge this ASAP. I can do a more detailed review later, if there's time. (I originally wanted to make it a bit more flexible, but that can happen some other time).

@adamwill Would you be so kind and add a short usage example into README as part of this PR, before I merge this?

Sigh, sorry, wanted to do it after the F44 cycle. But since Adam tested it in a real-world usage already, I'll just merge this ASAP. I can do a more detailed review later, if there's time. (I originally wanted to make it a bit more flexible, but that can happen some other time). @adamwill Would you be so kind and add a short usage example into README as part of this PR, before I merge this?
kparal added this to the Sprint 8 project 2026-04-22 08:11:15 +00:00
kparal left a comment

Please add a README example with a couple of useful hints on how a general audience can use this, thanks.

Please add a README example with a couple of useful hints on how a general audience can use this, thanks.
adamwill force-pushed label-convert from f0354e1d80 to 9cd4def047 2026-04-29 02:14:42 +00:00 Compare
Author
Owner

I went a bit further and split the replacements mapping out into a JSON file that can be replaced, so it's easier to use this for other orgs/repos. And added the doc section.

I went a bit further and split the replacements mapping out into a JSON file that can be replaced, so it's easier to use this for other orgs/repos. And added the doc section.
Author
Owner

maybe I should use Path instead of str for this...meh.

maybe I should use Path instead of str for this...meh.
kparal force-pushed label-convert from 9cd4def047 to 79855da7be 2026-04-29 10:53:07 +00:00 Compare
kparal manually merged commit 79855da7be into main 2026-04-29 10:56:53 +00:00
kparal deleted branch label-convert 2026-04-29 10:57:16 +00:00
Owner

Thanks, merged.

Btw, adding new commits during review is better for comparing changes, rather than rewriting commits and force-pushing. The PR can be squashed before merging.

Thanks, merged. Btw, adding new commits during review is better for comparing changes, rather than rewriting commits and force-pushing. The PR can be squashed before merging.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
quality/forge-helpers!3
No description provided.