forked from NVIDIA/cuopt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.coderabbit.yaml
More file actions
245 lines (217 loc) · 11.1 KB
/
.coderabbit.yaml
File metadata and controls
245 lines (217 loc) · 11.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
reviews:
profile: chill
high_level_summary: false
poem: false
auto_review:
enabled: true
drafts: false
base_branches:
- "^main$"
- "^release/.*"
- "^hotfix/.*"
ignore_usernames: ["rapids-bot", "GPUtester", "nv-automation-bot", "copy-pr-bot"]
tools:
markdownlint:
enabled: true
shellcheck:
enabled: true
gitleaks:
enabled: true
sequence_diagrams: false
collapse_walkthrough: true
# Reduce noise from status messages
request_changes_workflow: false
review_status: false
# Exclude paths CodeRabbit should not review.
# Formatting/lint/style for these is already handled (or not applicable).
# datasets/ is NOT fully excluded — shell scripts there download test data
# and are worth reviewing; only the bulk data files are filtered out.
path_filters:
- "!thirdparty/**"
- "!notebooks/**"
- "!docs/**/_build/**"
- "!**/*.mps"
- "!**/*.qps"
- "!**/*.lp"
- "!datasets/**/*.json"
- "!datasets/**/*.yaml"
- "!datasets/**/*.yml"
- "!datasets/**/*.txt"
- "!regression/**/*.json"
- "!regression/**/*.csv"
- "!regression/**/*.html"
# Path-specific review instructions.
# Keep each block narrow — the main review guide is in
# .github/.coderabbit_review_guide.md (see knowledge_base below).
path_instructions:
- path: "docs/**/*"
instructions: |
For documentation changes, focus on:
- Accuracy: verify code examples compile and run correctly
- Completeness: check if API changes (parameters, return values, errors) are documented
- Clarity: flag confusing explanations, missing prerequisites, unclear examples
- Consistency: version numbers, parameter types, and terminology match code
- Missing docs: if the PR changes public APIs without updating docs, flag as HIGH
When code changes affect docs, suggest specific files (e.g. docs/cuopt/source/*.rst)
and recommend documenting performance characteristics, GPU requirements, or tolerances.
- path: "cpp/include/cuopt/**/*"
instructions: |
Public C++ headers:
- New public functions/classes need Doxygen-style documentation
- Flag API changes that may need corresponding docs/ updates
- Verify parameter descriptions match actual types/behavior
- Suggest documenting thread-safety, GPU requirements, numerical behavior
- For breaking changes, recommend migration notes
- path: "cpp/include/cuopt/linear_programming/cuopt_c.h"
instructions: |
This is the C ABI surface. Flag ANY change to struct layout, function
signatures, enum values, or typedef shape as potentially ABI-breaking.
Ask the author to confirm the change is intentional and documented,
since there is no formal ABI-versioning macro today. Do not suggest
adding one unless the PR is specifically about API stability.
- path: "cpp/src/**/*.{cu,cuh}"
instructions: |
CUDA source files. Apply "CUDA / GPU — cuOpt idioms" from
.github/.coderabbit_review_guide.md. Do NOT comment on formatting
(clang-format handles it) or exception use (cuOpt uses exceptions
as its canonical error mechanism).
- path: "cpp/src/**/*.{cpp,hpp,h}"
instructions: |
C++ host code. Follow "C++ — cuOpt conventions" and "C++ —
language-level practices we follow from Google C++" in
.github/.coderabbit_review_guide.md. Match nearby code; cuOpt's
naming, exception use, and column limit override Google where they
disagree. Do not flag formatting.
- path: "cpp/src/grpc/**"
instructions: |
gRPC server C++ code. In addition to cpp/src rules:
- Input validation on all request fields reaching the solver
- Size limits on problem data to prevent resource exhaustion
- No credential/internal-path leakage in error messages or logs
- Safe deserialization of problem payloads
- Thread-safety on shared state across RPCs
- path: "cpp/tests/**"
instructions: |
C++ tests (gtest). Focus on:
- Numerical correctness validation (not just "runs without error")
- Edge cases: empty, infeasible, unbounded, degenerate, singleton problems
- Test isolation — no leaked GPU state or global mutation across tests
- Flakiness: GPU timing races, uninitialized memory, non-deterministic order
- When a bug fix lands, a regression test should cover the specific case
Do not require benchmarks here — benchmarks live in benchmarks/ and regression/.
IMPORTANT — dataset references: tests resolve problem data via
RAPIDS_DATASET_ROOT_DIR (see cpp/tests/utilities/common_utils.hpp,
`get_rdrd_or_default()`). Most datasets are downloaded at test time
by datasets/get_test_data.sh, datasets/linear_programming/download_pdlp_test_dataset.sh,
or datasets/mip/download_miplib_test_dataset.sh — they are NOT committed.
Do NOT flag a test for referencing a dataset path that isn't in the tree
UNLESS the filename does not appear in any download script (in which
case the download script likely needs updating too). See Common Bug
Patterns §7 "When NOT to flag" in the review guide.
- path: "python/**/*.py"
instructions: |
Python code. ruff (E,F,W ignoring E501), ruff-format, and pydocstyle
handle formatting, imports, and docstring format. Focus on what they
do NOT cover:
- Type hints on NEW public functions/classes (do not require them on existing code;
there is no mypy config and the codebase is mixed)
- Signature changes on public APIs must emit DeprecationWarning with a
removal version before breaking (see the pattern in
python/cuopt/cuopt/linear_programming/problem.py around the deprecated helpers)
- Docstring CONTENT on new public APIs — params, returns, raises — even
when pydocstyle format rules pass
- Error messages that expose internals vs. user-actionable messages
Do not re-raise ruff/pydocstyle-covered issues.
- path: "python/**/*.pyx"
instructions: |
Cython implementation files:
- C++ calls that may throw must use `except +` on the cdef declaration
- Use `nogil` on blocking C calls unless the GIL is needed
- Memoryview lifetimes: the Python object owning the buffer must outlive the view
- Prefer cpdef only when the function should be callable from Python
- path: "python/**/*.pxd"
instructions: |
Cython declaration files. Check that C++ signatures match their .hpp
counterparts (argument types, const-qualification, throw-specification).
- path: "python/cuopt_server/**"
instructions: |
Python server code. In addition to python/**/*.py rules:
- Input validation on all fields from the REST payload
- Size/shape limits on problem data
- No credential or internal-path leakage in error responses or logs
- Safe deserialization (no pickle on untrusted input)
- Rate limiting considerations on expensive endpoints
- path: "python/**/tests/**"
instructions: |
Python tests (pytest). Focus on:
- Numerical correctness validation
- Edge cases: empty, infeasible, unbounded, degenerate problems
- No leaked GPU state across tests
- Regression coverage for fixed bugs
IMPORTANT — dataset references: tests resolve problem data via
os.getenv("RAPIDS_DATASET_ROOT_DIR"). Most datasets are downloaded at
test time by scripts under datasets/ (get_test_data.sh,
linear_programming/download_pdlp_test_dataset.sh,
mip/download_miplib_test_dataset.sh) — they are NOT committed.
Do NOT flag a test for referencing a dataset path that isn't in the tree
UNLESS the filename does not appear in any download script. See Common
Bug Patterns §7 "When NOT to flag" in the review guide.
- path: "**/CMakeLists.txt"
instructions: |
Flag any new entry in add_library / add_executable / target_sources /
add_subdirectory / install(FILES ...) that references a source, header,
or directory not present in this PR or in the base branch — this is the
most common place a forgotten `git add` surfaces. See Common Bug
Patterns §7 in the review guide. The right ask is "did you mean to
include `<path>` in this PR?" rather than a generic style comment.
- path: "**/*.cmake"
instructions: |
Same as CMakeLists.txt: cross-check any added file-list entries against
the PR contents (Common Bug Patterns §7).
- path: ".github/workflows/**"
instructions: |
GitHub Actions workflows. Primary concern is Common Bug Patterns §7:
any `run:` step invoking `ci/*.sh`, `python ci/*.py`, or a repo-local
binary must reference a file present in the PR or the base branch.
Also check for:
- Referenced composite actions (`uses: ./.github/actions/<name>`) that don't exist
- `needs:` dependencies on jobs that were renamed or removed
- Secrets / environment variables newly referenced without being documented
Do not flag style of YAML formatting.
- path: "ci/**/*.sh"
instructions: |
CI shell scripts. Primary concern is Common Bug Patterns §7:
- `source` / `.` lines pointing at helper scripts not in the PR or tree
- `bash path/to/foo.sh` / direct script invocations referencing missing files
- `RAPIDS_DATASET_ROOT_DIR`-relative paths not produced by an in-tree script
Also: `set -euo pipefail` hygiene for new scripts, proper quoting on
interpolated paths. Do not re-raise shellcheck warnings (pre-commit
runs shellcheck at --severity=warning).
- path: "datasets/**/*.sh"
instructions: |
Dataset download/setup scripts. Same as ci/**/*.sh, with emphasis on:
- URLs reachable and versioned (not pinned to `latest`)
- Referenced helper scripts exist in the PR or tree (Common Bug Patterns §7)
- Exit on failure; no silent download errors
- path: "**/Dockerfile*"
instructions: |
Dockerfiles. Primary concern is Common Bug Patterns §7: `COPY` / `ADD`
paths must exist in the build context at the referenced location.
Also check for:
- Pinned base image tags (not `:latest`)
- Multi-stage builds don't leak secrets
- No credentials baked into layers
- path: "helmchart/**"
instructions: |
Helm charts. Same as CMakeLists.txt philosophy: new references to
ConfigMaps, Secrets, values keys, or template files must exist in
this PR (Common Bug Patterns §7). Do not flag chart style nits.
knowledge_base:
opt_out: false
code_guidelines:
filePatterns:
- ".github/.coderabbit_review_guide.md"
- "CONTRIBUTING.md"
- "CONVENTIONS.md"