feat: add label management for repositories and issues #280 #311
No reviewers
Labels
No labels
Kind/Breaking
Kind/Bug
Kind/Design
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Kind/Upstream
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
Suspicious
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo-contrib/forgejo-cli!311
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "woodworker:feature/issue-labels"
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?
Implements issue #280 - adds label commands that were missing for
repositories and issues while already existing for orgs and PRs.
New commands:
Also shows labels in default issue view when present.
Refactors label rendering utilities (render_label, render_label_list)
from prs.rs to main.rs for shared use across modules.
This is coded via claude code with opus 4.5
i checked the code as far as possible for me, i know a bit of rust, no senior in rust yet
tested to create/delete repo labels, and adding removing labels to an issue
i told claude to refactor the label rendering to be moved to main.rs as it was in prs.rs since this was the only place that rendered issues yet
i put it into main because main.rs already had a few rendering function and i did not want to make the pr even bigger and extract the rendering stuff into thier own file
also told claude to stay stylewise as close a s possible to the existing code
if you dont want to integrate it because of ai i totally understand but i wanted that feature and had a claude subscription
The Initial Plan Documet:
Issue Labels Feature Design
Issue: #280
Date: 2026-01-28
Summary
Add label management for repositories and issues, addressing the feature gap where labels exist for orgs and PRs but not for issues or repos.
New Commands
Repository Labels
Issue Labels
Code Changes
Move to
src/main.rsExtract shared label rendering utilities from
prs.rs:render_label_list()- renders a list of labelsrender_label()- renders a single label with colorsparse_color()- parses hex color stringluma()- calculates luminance for text contrastdarken()- darkens color for exclusive label categoriesModify
src/repo.rsLabelvariant toRepoCommandenum with nestedLabelSubcommandlist_repo_labels(),add_repo_label(),edit_repo_label(),remove_repo_label()Modify
src/issues.rsLabelstoViewCommandenumLabelstoEditCommandenumview_issue_labels(),edit_issue_labels()Modify
src/prs.rscrate::insteadModify
src/org.rscrate::render_label_listAPI Mapping
Repository Labels
repo label listapi.issue_list_labels(owner, repo, query)repo label addapi.issue_create_label(owner, repo, CreateLabelOption)repo label editapi.issue_edit_label(owner, repo, id, EditLabelOption)repo label rmapi.issue_delete_label(owner, repo, id)Issue Labels
issue view labelsapi.issue_get_issue(...)then read.labelsissue edit labels --addapi.issue_add_label(owner, repo, index, IssueLabelsOption)issue edit labels --rmapi.issue_remove_label(owner, repo, index, id)Error Handling
#prefix, error on invalid hexReused Utilities
prs::render_label_list()→ moved tomain.rsprs::render_label()→ moved tomain.rsissues::label_names_to_ids()- converts label names to IDsYes, while I appreciate your desire to contribute, I cannot accept this PR because of my conscience about the cultural and environmental effects of AI, and my concerns about the copyright of the output. Thank you for your understanding.
Maybe add this Information to the README so no further attempts of AI pr are made
Yes that's a good idea, I've meant to for a little while now.
Pull request closed