docs(commands): clarified triage filtering logic for label coverage distinction

- Clarified triage filtering logic to distinguish between partial and complete label coverage.
- Updated classification instructions to specify per-category label assignment behavior.
This commit is contained in:
can1357
2026-02-20 10:33:56 +01:00
parent 25b5d125d4
commit a34c7f62fe
+18 -16
View File
@@ -1,35 +1,37 @@
# Triage Command # Triage Command
Classify and label open GitHub issues that are missing labels. Classify and label **newly opened** GitHub issues that are missing labels.
## Arguments ## Arguments
- `$ARGUMENTS`: Scope filter — `open` (default), `closed`, or `all`. Append `--relabel` to re-classify issues that already have labels. - `$ARGUMENTS`: Optional window flag `--days <n>` (default: `7`). Only open issues created within this window are triaged.
## Steps ## Steps
### 1. Fetch Issues ### 1. Fetch Issues
Parse `$ARGUMENTS` to determine scope and whether `--relabel` is set. Parse `$ARGUMENTS` to determine the new-issue window (`--days`, default `7`).
```bash ```bash
# For open (default): # Build cutoff date (UTC) for "new" issues
gh issue list --state open --json number,title,body,labels,comments,createdAt --limit 50 CUTOFF_DATE="$(python - <<'PY'
from datetime import datetime, timedelta, timezone
print((datetime.now(timezone.utc) - timedelta(days=7)).strftime('%Y-%m-%d'))
PY
)"
# For closed: # Fetch only newly created open issues (default 7-day window)
gh issue list --state closed --json number,title,body,labels,comments,createdAt --limit 30 gh issue list --state open --search "created:>=${CUTOFF_DATE}" --json number,title,body,labels,comments,createdAt --limit 50
# For all: run both commands and merge results ### 2. Filter New Candidates
```
### 2. Filter Candidates - Skip any issue older than the cutoff window; this command only triages new issues.
- Skip issues with label `triaged` (already handled).
- If `--relabel` is NOT set, skip any issue that already has at least one label. - For remaining issues, if type + area + platform are already present, skip unless metadata is clearly missing.
- If `--relabel` IS set, process all fetched issues.
### 3. Classify Each Issue ### 3. Classify Each Issue
For each candidate issue, read the title, body, and **all comments** (comments often contain critical context). Apply labels from the categories below. An issue can receive multiple labels. For each candidate issue, read the title, body, and **all comments** (comments often contain critical context). Apply labels from the categories below. An issue can receive multiple labels. For each category, skip it only if the issue already has a label in that category — always fill in missing categories.
**Type labels** (pick exactly one): **Type labels** (pick exactly one):
| Label | Signals | | Label | Signals |
@@ -68,10 +70,10 @@ For each candidate issue, read the title, body, and **all comments** (comments o
### 4. Apply Labels ### 4. Apply Labels
For each issue, apply the chosen labels. **Never remove existing labels.** For each issue, apply the chosen labels and add `triaged`. **Never remove existing labels.**
```bash ```bash
gh issue edit <number> --add-label "bug,tui,platform:linux" gh issue edit <number> --add-label "bug,tui,platform:linux,triaged"
``` ```
### 5. Print Summary ### 5. Print Summary