fix(forgejo-cli): include org-level labels in --list-labels #15

Merged
jerome merged 1 commit from fix-org-labels into main 2026-07-01 01:53:13 +03:00
Collaborator

Goal

fj_read.py --list-labels only returned repo-level labels, missing org-level
labels 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 the
repo scope. The skill's label lookup only hit /repos/{repo}/labels, so
org-wide labels never showed up when picking a label name to apply.

Steps

  • list_labels now fetches both /repos/{repo}/labels and
    /orgs/{org}/labels, tolerating a 403/404 on the org call (user-owned repos,
    or a token missing read:organization scope).
  • render_label_list splits output into "Repo labels" / "Org labels" sections.
  • Updated --list-labels help text and the usage comment.

Verification

  • python3 -m py_compile on the script.
  • Ran --list-labels live against public/skills: repo labels render
    correctly; org call returned 403 (token lacks read:organization), and the
    code falls back gracefully instead of crashing.
## Goal `fj_read.py --list-labels` only returned repo-level labels, missing org-level labels 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 the repo scope. The skill's label lookup only hit `/repos/{repo}/labels`, so org-wide labels never showed up when picking a label name to apply. ## Steps - `list_labels` now fetches both `/repos/{repo}/labels` and `/orgs/{org}/labels`, tolerating a 403/404 on the org call (user-owned repos, or a token missing `read:organization` scope). - `render_label_list` splits output into "Repo labels" / "Org labels" sections. - Updated `--list-labels` help text and the usage comment. ## Verification - `python3 -m py_compile` on the script. - Ran `--list-labels` live against `public/skills`: repo labels render correctly; org call returned 403 (token lacks `read:organization`), and the code falls back gracefully instead of crashing.
fix(forgejo-cli): include org-level labels in --list-labels
All checks were successful
gitleaks / gitleaks (pull_request) Successful in 4s
0a25e7e477
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.
jerome merged commit cdb76435ac into main 2026-07-01 01:53:13 +03:00
jerome deleted branch fix-org-labels 2026-07-01 01:53:14 +03:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
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
public/chiche-plugins!15
No description provided.