build: add PR severity classification workflow#10526
Conversation
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
ziggie1984
left a comment
There was a problem hiding this comment.
looks good, pending CI
|
Addressed review feedback:
Regarding the labels question from @ziggie1984: Yes, all 8 labels have already been created in the repository (4 severity + 4 override labels). |
0a7531b to
86034aa
Compare
ziggie1984
left a comment
There was a problem hiding this comment.
LGTM (pending bot comment)
b42273d to
273ec34
Compare
🟢 PR Severity: LOW
🟢 Low (1 file)
AnalysisThis PR adds a GitHub Actions workflow for automated PR severity classification. Changes are limited to CI/CD configuration files ( Why LOW severity:
Review focus areas:
To override, add a |
Add a GitHub Actions workflow that uses Claude Code to automatically classify PRs by severity based on the files changed. This helps reviewers prioritize and understand PR complexity at a glance. The workflow: - Triggers on PR open and synchronize events - Uses Claude Code to analyze changed files against severity mapping - Applies one of four severity labels (critical/high/medium/low) - Posts a detailed comment explaining the classification - Supports manual override via severity-override-* labels Severity mapping: - CRITICAL: lnwallet, htlcswitch, contractcourt, peer, keychain, input, channeldb, funding, lnwire, server.go, rpcserver.go - HIGH: routing, invoices, sweep, discovery, graph, watchtower, feature, lnrpc, macaroons, chainntnfs, etc. - MEDIUM: payments, autopilot, lncfg, kvdb, proto files, etc. - LOW: docs, tests, scripts, CI/CD config
273ec34 to
ba52a27
Compare
🟢 PR Severity: LOW
🟢 Low (1 file)
AnalysisThis PR introduces a new GitHub Actions workflow for automatic PR severity classification. Since it only modifies CI/CD configuration under Why LOW severity?
The change adds valuable automation for triaging PRs but carries minimal risk to the Lightning Network Daemon's core functionality. To override, add a |
This PR adds a GitHub Actions workflow that uses Claude Code to automatically classify pull requests by severity based on the files they touch. When a PR is opened or updated, Claude analyzes the changed files against a predefined severity mapping and applies an appropriate label to help reviewers quickly understand the complexity and risk level of the changes.
The severity classification follows a four-tier system. Critical severity is assigned to changes touching security-sensitive code paths including lnwallet, htlcswitch, contractcourt, peer/brontide, keychain, input, channeldb, funding, lnwire, and the core server files. High severity covers important subsystems like routing, invoices, sweep, discovery, graph, watchtower, feature bits, and the RPC layer. Medium severity applies to infrastructure components such as payments, autopilot, configuration, and protocol buffer definitions. Low severity is reserved for documentation, tests, scripts, and CI/CD configuration changes.
Claude posts a detailed comment on each PR explaining its classification decision. The comment includes collapsible sections showing which files fall into each severity tier, along with an analysis explaining why the overall severity level was chosen. When new commits are pushed to the PR, Claude updates its existing comment rather than creating duplicate comments, keeping the PR thread clean.
The workflow supports manual overrides through dedicated labels. Maintainers can apply a severity-override-critical, severity-override-high, severity-override-medium, or severity-override-low label to force a specific classification. When an override label is present, Claude respects it and notes the manual override in its comment. This allows human judgment to take precedence when the automated classification doesn't capture the full context.
Additional classification rules help catch edge cases. PRs touching more than 20 files or changing more than 500 lines get bumped up one severity level to account for increased review complexity. Changes to database migration files are always treated as critical regardless of their location. PRs touching multiple distinct critical packages are flagged with additional urgency in Claude's analysis.
This workflow integrates with the existing Claude Code infrastructure added in PR 10525, using the same OAuth token and action version. Eight new labels have been created in the repository to support the classification system.