feat(labels): estate label tooling + auto-triage for new issues - #82
feat(labels): estate label tooling + auto-triage for new issues#82hyperpolymath wants to merge 1 commit into
Conversation
Ships the canonical label set and the classifier that labels newly-filed issues. Additive only: it never removes a label, never overrides a human's classification, stays silent when unsure, and never fails an issue. Also adds this repo's two new workflows to .github/workflows/actions.lock as '[]'. That lock is keyed by workflow path and refuses any workflow it does not list -- a startup_failure, which produces no check run and is therefore silent. `gh actions-lock` cannot add these: it records action versions, and both workflows deliberately use no actions. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 7 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Pull Request Overview
The PR successfully implements a canonical label set and automated triage system using JQ, meeting the requirement for a Python-free estate-wide solution. Codacy analysis indicates the code is 'Up to Standards'; however, several technical risks must be addressed before merging.
Crucially, the label synchronization logic in labels.yml is fragile due to TSV parsing and case-sensitive comparisons, which will lead to duplicate labels or failed updates. Additionally, the label application step in the triage workflow is vulnerable to shell word splitting, which will cause failures if label names contain spaces. The sophisticated regex logic in the classifier currently lacks unit tests, representing a high maintenance risk. Lastly, the PR mentions updating actions.lock, but this file was not found in the submitted changes.
About this PR
- The
kwrxregex engine is central to the classification consistency. Given the complexity of the suffix handling and word boundary logic, this should be accompanied by a suite of test cases to ensure no regressions occur as the taxonomy expands. - The PR description mentions updating
.github/workflows/actions.lock, but this file is missing from the pull request. Please ensure all lock files are included to prevent drift.
Test suggestions
- Verify 'feat:' and 'fix:' prefixes correctly map to 'enhancement' and 'bug' types
- Verify bracketed tags like '[docs]' or '[security]' are correctly extracted and mapped to labels
- Verify keyword mapping for specific areas (e.g., 'workflow' or 'actions.lock' mapping to 'cicd')
- Verify that human-applied labels in a tier (e.g., 'type') block the bot from adding another label of that same tier
- Verify the label sync workflow creates missing labels while ignoring updates to 'frozen' labels' definitions
- Automatable test for
kwrxfunction logic inclassify-issue.jqagainst common stems (e.g., 'test', 'testing') and 'testing')
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify 'feat:' and 'fix:' prefixes correctly map to 'enhancement' and 'bug' types
2. Verify bracketed tags like '[docs]' or '[security]' are correctly extracted and mapped to labels
3. Verify keyword mapping for specific areas (e.g., 'workflow' or 'actions.lock' mapping to 'cicd')
4. Verify that human-applied labels in a tier (e.g., 'type') block the bot from adding another label of that same tier
5. Verify the label sync workflow creates missing labels while ignoring updates to 'frozen' labels' definitions
6. Automatable test for `kwrx` function logic in `classify-issue.jq` against common stems (e.g., 'test', 'testing') and 'testing')
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
| # (`port` + `ion` = "portion", and `port` is a live keyword). They are enabled | ||
| # only for shapes that are unambiguously truncated stems -- `-at` | ||
| # (instantiat, investigat, adjudicat) and `-ment` (document, implement). | ||
| def kwrx($kw): |
There was a problem hiding this comment.
🟡 MEDIUM RISK
The regex generation logic in kwrx is highly specialized to handle the observed false-positive/miss distribution. Because this logic is implemented in JQ without direct unit tests in the PR, it represents a maintenance risk if the keyword taxonomy expands. Consider generating a set of test cases in a temporary JQ script that validates the kwrx function against common stems and inflections.
|
|
||
| printf 'applying: %s\n' "${apply[*]}" | ||
| gh issue edit "$NUM" -R "$GITHUB_REPOSITORY" \ | ||
| $(printf -- '--add-label %q ' "${apply[@]}") \ |
There was a problem hiding this comment.
🟡 MEDIUM RISK
This command expansion will break if label names contain spaces (e.g., 'good first issue') because word splitting occurs after the printf result is substituted. Use a loop to populate an array of arguments or use xargs to ensure arguments are passed correctly to the gh command.
| while IFS=$'\t' read -r name color desc; do | ||
| [ -z "$name" ] && continue | ||
| frozen=0 | ||
| for f in "${FROZEN[@]}"; do [ "$f" = "$name" ] && frozen=1 && break; done | ||
|
|
||
| cur=$(printf '%s\n' "$existing" | awk -F'\t' -v n="$name" '$1==n{print;exit}') | ||
| if [ -z "$cur" ]; then |
There was a problem hiding this comment.
🟡 MEDIUM RISK
The label synchronization logic is fragile and incomplete. Using TSV and awk for comparisons can break if label descriptions contain tab characters and currently performs case-sensitive matches, which conflicts with GitHub's case-insensitive label names. Refactor this block to use jq for comparison directly on the JSON objects; this will provide robustness against special characters and allow for a tolower comparison to correctly handle case-insensitive drift.
| && updated=$((updated+1)) | ||
| fi | ||
| fi | ||
| sleep 0.4 |
There was a problem hiding this comment.
⚪ LOW RISK
Nitpick: The rate-limiting sleep is applied to every iteration regardless of whether a change occurred. Moving it inside the if blocks for label creation or updates would significantly speed up the workflow execution when only a few labels need syncing.
Ships the canonical label set and the classifier that labels newly-filed issues.
Additive only — never removes a label, never overrides a human's classification, silent when unsure, never fails an issue.
Also adds this repo's two new workflows to
.github/workflows/actions.lockas[]. That lock is keyed by workflow path and refuses any workflow it does not list — astartup_failure, which produces no check run and is therefore silent.gh actions-lockcannot add these: it records action versions, and both workflows deliberately use none.See
docs/LABELS.adocin hyperpolymath/.git-private-farm.🤖 Generated with Claude Code