fix(forgejo-cli): include org-level labels in --list-labels #15
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
public/chiche-plugins!15
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-org-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?
Goal
fj_read.py --list-labelsonly returned repo-level labels, missing org-levellabels that are also assignable on the repo's PRs/issues.
Why
Forgejo labels can live at the org scope (
/orgs/{org}/labels) as well as therepo scope. The skill's label lookup only hit
/repos/{repo}/labels, soorg-wide labels never showed up when picking a label name to apply.
Steps
list_labelsnow fetches both/repos/{repo}/labelsand/orgs/{org}/labels, tolerating a 403/404 on the org call (user-owned repos,or a token missing
read:organizationscope).render_label_listsplits output into "Repo labels" / "Org labels" sections.--list-labelshelp text and the usage comment.Verification
python3 -m py_compileon the script.--list-labelslive againstpublic/skills: repo labels rendercorrectly; org call returned 403 (token lacks
read:organization), and thecode falls back gracefully instead of crashing.
Forgejo repos can be assigned org-level labels in addition to repo-level ones, but list_labels only queried /repos/{repo}/labels. Now also fetches /orgs/{org}/labels and renders both sections, tolerating 403/404 for user-owned repos or scope-limited tokens.