ci: add label policy check - #693
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR adds a label policy validation system for GitHub. A new validation script defines and enforces labeling rules (exactly one priority, one type, at least one routing label per item); a GitHub Actions workflow runs the validation on issues and pull requests; comprehensive tests cover all policy scenarios; and the PR template is updated to document the labeling requirements. ChangesLabel Policy Validation System
Sequence Diagram(s)sequenceDiagram
participant GitHub as GitHub Event<br/>(issue/PR)
participant Workflow as label-policy.yml
participant Script as label-policy-check.js
participant Validation as validateLabelPolicy
GitHub->>Workflow: Trigger on issues or pull_request_target
Workflow->>Workflow: Checkout code
Workflow->>Script: Dynamic import
Workflow->>Validation: Call validateLabelPolicy(itemType, labels)
Validation->>Validation: Validate against POLICY rules
Validation-->>Workflow: Return {ok, errors}
alt Validation passes
Workflow->>GitHub: Log success message
else Validation fails
Workflow->>GitHub: Fail workflow with error details
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Code Review
This pull request introduces a label policy enforcement mechanism, including a validation script and corresponding tests, while updating the PR template to reflect the new requirements. Feedback suggests including the missing workflow file to execute the checks in CI, adding a default value for the labels parameter to improve robustness, and refactoring error messages to use defined constants instead of hardcoded strings for better maintainability.
Prepare PawWork v2026.5.18 for the stable desktop release. - Bump the desktop package version to 2026.5.18. - Scope the diagnostics unreadable-file retention test to POSIX permission semantics so Windows advisory does not fail on chmod behavior that Windows does not enforce the same way. Verification: - Focused desktop diagnostics test passed locally: 11 pass / 0 fail. - Release typecheck passed locally for packages/desktop-electron. - PR #706 CI passed, including ci, desktop-smoke, e2e-artifacts, CodeQL, dependency-review, label-policy, commit-lint, and title lint. Release notes: - Drafted against the merged range since v2026.5.17: #691, #692, #693, #694, #702, and #703. - Cold-read review completed before merge; wording was tightened to avoid overclaiming diagnostics impact and to keep verification short.
Summary
Add a label policy check for issues and pull requests.
Why
PawWork labels are now used as a small MECE taxonomy: one type, one priority, and at least one routing label. Without a check, issues and PRs can silently drift into missing labels, duplicate priority labels, or broad labels such as
tech-debton user-facing bugs.This PR keeps the first enforcement slice small: it checks hard label-shape rules and does not auto-edit labels or infer business priority.
Related Issue
No dedicated issue. This follows the maintainer-requested label governance cleanup.
Human Review Status
Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.
Review Focus
cishould be accepted as a primary routing label for workflow/tooling PRs.documentationpath labeling is the right way to avoid type-label conflicts.Risk Notes
Low. The workflow only validates labels and does not modify issues or PRs. It uses
pull_request_targetwith checkout pinned to the base SHA so it does not execute scripts from an untrusted PR branch.How To Verify
Screenshots or Recordings
Not applicable. No visible UI changes.
Checklist
bug,enhancement,task, ordocumentation), at least one primary routing label (app,ui,platform,harness, orci), and exactly one priority label (P0toP3), or I requested maintainer labelingdev, and my PR title and commit messages use Conventional Commits in EnglishSummary by CodeRabbit