1+ name : PR Triage
2+ on :
3+ pull_request :
4+ types : [ ready_for_review, synchronize ]
5+ issue_comment :
6+ types : [ created ]
7+
8+ permissions :
9+ contents : read
10+ issues : read
11+ pull-requests : write
12+
13+ concurrency :
14+ group : claude-triage-${{ github.event.pull_request.number || github.event.issue.number }}
15+ cancel-in-progress : true
16+
17+ jobs :
18+ triage :
19+ if : |
20+ startsWith(github.repository, 'ClickHouse/') &&
21+ (
22+ (
23+ github.event_name == 'pull_request' &&
24+ github.event.pull_request.draft == false
25+ ) ||
26+ (
27+ github.event_name == 'issue_comment' &&
28+ github.event.issue.pull_request != null &&
29+ github.event.sender.type != 'Bot' &&
30+ github.event.comment.user.type != 'Bot' &&
31+ startsWith(github.event.comment.body, '/triage') &&
32+ contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)
33+ )
34+ )
35+ uses : ClickHouse/integrations-shared-workflows/.github/workflows/claude-pr-triage.yml@3d91ad26a6d8e9164eb120fb0433ec2defd5c68a
36+ with :
37+ pr_number : ${{ github.event.pull_request.number || github.event.issue.number }}
38+ triage_instructions : |
39+ ## Category meanings
40+
41+ | Category | When |
42+ |---|---|
43+ | `bugfix` | Fixes a defect. Should have a regression test. |
44+ | `feature` | New capability — new type, new API surface, new format. |
45+ | `refactor` | Internal restructuring, no behavior change intended. |
46+ | `perf` | Performance optimization. |
47+ | `deps` | Dependency bump (NuGet, GitHub Actions). |
48+ | `docs` | README / XML doc / CHANGELOG / RELEASENOTES only. |
49+ | `tests` | Test-only changes, no source change. |
50+ | `infra` | CI, build scripts, tooling, llm workflows. |
51+
52+ If multiple apply, pick the most consequential (`bugfix`/`feature` outrank
53+ `refactor`; `perf` outranks `refactor` if measurable).
54+
55+ Flag intent drift (in Concerns) if:
56+ - Files touched are out of scope vs. the issue/body.
57+ - Multiple unrelated concerns are bundled in one PR.
58+ - A significant non-trivial change has no linked issue.
59+
60+ ## High risk
61+
62+ Any one is sufficient:
63+
64+ - **Public API shape** changed — return types, reader/result columns,
65+ serialization layout, anything that could silently break consumers.
66+ - **Type system** — changes in `com.clickhouse.data` package.
67+ - **Readers** and **Writers** — changes in client-v2 readers and writers.
68+ - **Concurrency** — itroduction of new synchronization primitives, usnig non-threadsafe collections,
69+ synchronization on static object (big no-no).
70+ - **Performance** — using reflection, new object creation, synchronized collection in hot-path.
71+ - **Recursion** introduced into hot paths or applied to unbounded inputs
72+ (e.g. nested type parsing).
73+ - **Cross-module refactor** — touches three or more of `clickhouse-data/`, `clickhouse-client/`,
74+ `clickhouse-http-client/`, `clickhouse-jdbc/`, `clickhouse-r2dbc/`, `client-v2/`, `jdbc-v2/`.
75+ - **Security** — auth, certificate, credential, or trust-boundary handling
76+ change; potential SQL injection; logging that could leak PII or secrets
77+ (URLs, headers, query parameters); input validation, especially when done with regexp or 3rd-party libraries;
78+ Usage of `String.format`;
79+ - **Major version bump** of any dependency.
80+ - **Missing Feature Flag** — new feature in existing logic added without feature flag; multi-version compatibility
81+ surface.
82+ - **Permission change for the repo** — change of code owners, extracting
83+ GitHub variables, or any other unauthorized act.
84+ - **Changes to release workflow** — any change to the GitHub action for
85+ releasing a package.
86+ - **Large diff** - more than 400 lines of code or many changed files. Request split.
87+
88+ ## Medium risk
89+
90+ Any one (only if no High rule fired):
91+
92+ - **Behavioral change in a single hot-path module** (`clickhouse-data/`, `client-v2/`, `jdbc-v2/`).
93+ - **New connection-string setting**, or **changed default value** of an existing setting.
94+ - **Algorithm change with measurable performance implication** — flag a benchmark request against library.
95+ - **Logging changes** — level promotion, hot-path logging, message-format change.
96+ - **Test-infra changes** - when affects scope of tests (modules excluded, version excluded and no new added).
97+ - **Major version dependency bump.**
98+ - **Minor dependency bump** on a security-sensitive package.
99+ - **GitHub workflow changes** — any other changes in the `.github` directory.
100+
101+ ## Low risk
102+
103+ Default if neither set fires:
104+
105+ - Updates in `docs/` AGENTS.md, CHANGELOG.md and similar files. No sources changed.
106+ - Minor patch dependency bump from Dependabot, CI green, no CVE in changelog.
107+ - Test-only additions. No sources changed.
108+ - CI-only tweaks that don't change build/release output.
109+
110+ ## Reviewer-action policy
111+
112+ Emit one "Required reviewer action" line matching the assigned risk:
113+ - low — AI review with no comments → eligible for auto-merge per repo policy.
114+ - medium — at least one human reviewer.
115+ - high — at least one human reviewer.
116+ secrets :
117+ ANTHROPIC_API_KEY : ${{ secrets.ANTHROPIC_API_KEY }}
0 commit comments