Skip to content

issue --label fails for org-level labels (only repo labels resolved) #216

Description

@q-soriarty

Summary

copia-cli issue create --label (and issue edit --label) only resolves repository-scoped labels by name to their ID. Organization-level labels are not recognized, so applying an org label — or mixing repo and org labels in one command — fails because the CLI does not know the org label's ID.

Reproduce

On a repo whose organization defines org-level labels, attach a repo label and an org label together:

copia-cli issue create -R my-org/my-repo \
  --title "Example" \
  --label "bug" \           # repo-scoped label — resolves
  --label "priority/high"   # org-scoped label — NOT resolved

The org-scoped label fails to resolve (its ID is unknown to the CLI), so the create errors out / the org label is not applied.

Expected

--label resolves label names across both scopes — repository labels and organization labels — and attaches all of them.

Actual

Only repo-scoped labels are resolved. Org-level label names are treated as unknown (no matching ID found), breaking mixed repo+org label use.

Likely cause

Label name→ID resolution queries only the repository labels endpoint (/repos/{owner}/{repo}/labels) and never the organization labels endpoint (/orgs/{org}/labels). The two label sets must be merged when resolving --label.

Suggested fix

When resolving --label, fetch both /repos/{owner}/{repo}/labels and /orgs/{org}/labels, merge them, and match the given names against the combined set (repo label winning on a name collision, matching the server's own precedence).

Environment

copia-cli version 1.1.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions