feat: add and filter issue labels by name #13
No reviewers
Labels
No labels
needs/docs
needs/research
needs/upstream
type/bug
type/external
type/feature
type/refactor
urgency
high
urgency
immediate
urgency
low
urgency
medium
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ScottyLabs/collar!13
Loading…
Reference in a new issue
No description provided.
Delete branch "krishsax/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?
Summary
Collar could show issue labels but not set them. This adds label names to the issue commands:
type/*,urgency/*,needs/*), so repository-only resolution would miss them. A 404 fromorgs/{owner}/labelsmeans a user-owned repository and is treated as having no organization labels; other errors propagate.issue list: Forgejo silently discards unknown names in itslabelsfilter, so a typo would list every issue. Names containing commas are rejected for the filter, since the API takes a comma-separated list. Repeated--labelrequires every label, which matches Forgejo's behavior (checked with live reads on kennel).issue createsends label IDs in the create request, so creation stays a single write.issue editcomputes the new label set from the issue it already fetches and replaces it with onePUT .../labels. It sends nothing when the set is unchanged, and rejects a label that is both added and removed before any request. With--title/--body, the PATCH runs first; if the label request then fails, the error states that the title or body was updated and the labels were not. Nothing is retried.client::HttpStatusis a small typed error so callers can recognize one status code. Error messages are unchanged.Docs: a "Label issues" section in the repository guide, new
issuehelp examples, and a regenerated command reference. The guide notes that labels do not move project board cards, since Forgejo 17 has no projects API.Validation
cargo clippy --all-targets -- -D warningsandtreefmtpass.create, filter validation and encoding forlist, unknown names and commas failing before requests, a singlePUTwith the merged set foredit, no write for an unchanged set, and the partial-write error.issue list -R kennel --state all --label type/feature --label urgency/highreturns the same four issues as the raw API, and--label type/featurfails with the available names. Writes were tested only against fixtures.clitest binary aborts on any test that panics (also onmain), so thecargo-testhook was skipped for this commit. Running each test in its own process: 147 of 149 pass. The two failures are existingenvironmenttests that compare/varwith/private/vartemp paths.Kennel Deployments
Last updated for commit
b79b01b.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.