forked from crossplane/crossplane
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.coderabbit.yaml
More file actions
295 lines (243 loc) · 10.9 KB
/
.coderabbit.yaml
File metadata and controls
295 lines (243 loc) · 10.9 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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# CodeRabbit Configuration for Crossplane
# This configuration is optimized for the Crossplane Go project
# =============================================================================
# GLOBAL SETTINGS
# =============================================================================
# Language for CodeRabbit reviews and comments (default: en-US, keeping explicit)
language: "en-US"
# Instructions for CodeRabbit's tone and style in reviews (max 250 chars)
tone_instructions: |
Be collaborative and supportive. Ask clarifying questions rather than making
assumptions. Focus on the 'why' behind decisions. Frame concerns
constructively and thank contributors.
# Disable early-access features for stability
early_access: false
# =============================================================================
# REVIEWS
# =============================================================================
reviews:
# We tested assertive and found it too verbose, e.g. approxing 200 comments on
# https://github.com/crossplane/crossplane/pull/6777. Some of the nitpicks do
# look valuable to me, but the signal to noise ratio isn't good enough.
profile: "chill"
# Don't generate summary in PR description - let authors write their own
high_level_summary: false
# Include the high-level summary in the walkthrough comment instead
high_level_summary_in_walkthrough: true
# Collapse walkthrough comment to reduce visual clutter in PRs
collapse_walkthrough: true
# Enable automatic label application
auto_apply_labels: true
# Automatically assign suggested reviewers (disabled - let maintainers control)
auto_assign_reviewers: false
# Disable poem generation in walkthrough comments
poem: false
# Disable review status messages to reduce comment noise
review_status: false
# Focus reviews on source code, exclude generated and vendor files
path_filters:
# Include source code
- "**/*.go"
- "**/*.yaml"
- "**/*.yml"
- "**/*.md"
- "**/*.proto"
- "**/Dockerfile*"
- "**/flake.nix"
- "**/*.sh"
# Exclude generated and vendor files
- "!**/zz_generated*.go"
- "!**/vendor/**"
- "!**/node_modules/**"
- "!**/*.pb.go"
- "!**/*.pb.gw.go"
- "!**/mock_*.go"
- "!**/fake/**"
- "!**/testdata/**"
- "!**/dist/**"
- "!**/build/**"
# Path-specific instructions for different areas of the codebase
path_instructions:
- path: "**/*.go"
instructions: |
Enforce Crossplane-specific patterns: Use crossplane-runtime/pkg/errors
for wrapping. Check variable naming (short for local scope, descriptive
for wider scope). Ensure 'return early' pattern. Verify error scoping
(declare in conditionals when possible). For nolint directives, require
specific linter names and explanations. CRITICAL: Ensure all error
messages are meaningful to end users, not just developers - avoid
technical jargon, include context about what the user was trying to do,
and suggest next steps when possible.
- path: "**/*_test.go"
instructions: |
Enforce table-driven test structure: PascalCase test names (no
underscores), args/want pattern, use cmp.Diff with
cmpopts.EquateErrors() for error testing. Check for proper test case
naming and reason fields. Ensure no third-party test frameworks (no
Ginkgo, Gomega, Testify).
- path: "**/*.md"
instructions: |
Ensure Markdown files are wrapped at 100 columns for consistency and
readability. Lines can be longer if it makes links more readable, but
otherwise should wrap at 100 characters. Check for proper heading
structure, clear language, and that documentation is helpful for users.
- path: "**/apis/**"
instructions: |
Focus on API design following Kubernetes API conventions from
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md.
Check for proper field naming (camelCase), appropriate types, validation
tags, and documentation. Ask about backward compatibility and the impact
on existing users and upgrade paths. Consider if changes need feature
gates or alpha/beta graduation. Ensure error messages in validation are
user-friendly. Pay attention to API consistency, proper use of optional
vs required fields, and following established Kubernetes patterns.
- path: "**/internal/controller/**"
instructions: |
Review controller logic for proper reconciliation patterns, error
handling, and resource management. Pay special attention to conditions
and events: Conditions must be actionable for users (not developers),
stable/deterministic, with proper Type/Reason/Message format. Events
only when something actually happens, with specific details about what
changed. No transient errors in conditions/events. All error messages
must be meaningful to end users - include context about what
resource/operation failed and why.
- path: "**/cmd/**"
instructions: |
Review CLI commands for proper flag handling, help text, and error
messages. Ensure commands follow Crossplane CLI conventions. Ask about
backward compatibility and user experience. CLI error messages must be
especially user-friendly - avoid internal error details, provide
actionable guidance.
- path: "**/test/**"
instructions: |
Focus on test coverage, test clarity, and proper use of testing
utilities. Ask about testing scenarios and edge cases. Ensure tests are
maintainable and cover the happy path and error conditions. Verify
error testing uses proper patterns (cmpopts.EquateErrors, sentinel
errors for complex cases).
- path: "**/test/e2e/**"
instructions: |
Review E2E tests for proper structure following Crossplane patterns:
Use features.NewWithDescription() with CamelCase names, not sentences.
Ensure proper Setup/Assess/Teardown phases with descriptive names.
Check that tests have appropriate labels (area, size, test suite).
Verify tests use YAML manifests in test/e2e/manifests/<area>/<test>
structure. Ensure tests avoid complex logic in e2e package and use
funcs package for reusable logic. Check that tests don't assume
ordering and can run independently. Verify proper cleanup in teardown
phases.
- path: "**/cluster/**"
instructions: |
Review Kubernetes manifests for security, resource limits, and proper
RBAC. Ensure Helm chart follows best practices. Consider upgrade and
rollback scenarios.
- path: "**/design/**"
instructions: |
Focus on architectural decisions, user experience, and long-term
maintainability. Ask clarifying questions about design choices and
consider alternative approaches. Ensure the design aligns with
Crossplane's principles and provides good user experience.
# Automatic review settings
auto_review:
# Skip reviewing draft PRs until they're ready for review (default: false, keeping explicit)
drafts: false
# Skip reviews if PR title contains these keywords (case-insensitive)
ignore_title_keywords:
- "wip"
- "draft"
- "do not merge"
- "dnm"
# Skip reviews from these automated bot accounts
ignore_usernames:
- "dependabot[bot]"
- "renovate[bot]"
- "github-actions[bot]"
# Quality gates that run during CodeRabbit's review to check PR readiness
pre_merge_checks:
# Check PR title for length and descriptiveness
title:
requirements: "Keep under 72 characters and be descriptive about what the change does."
# Disable docstring coverage check (too noisy for Go projects)
docstrings:
mode: "off"
# Custom checks specific to Crossplane development practices
custom_checks:
- name: "Breaking Changes"
mode: "error"
instructions: |
"Fails if files under 'apis/**' or 'cmd/**' remove or rename public
fields/flags, add new required public fields/flags, or remove behavior
without label 'breaking-change'.
- name: "Feature Gate Requirement"
mode: "error"
instructions: |
Fails if new experimental features that affect apis/**, or
significantly affect behavior, are added without a feature flag
implementation.
# Disable automatic code generation features
finishing_touches:
# Disable automatic docstring generation
docstrings:
enabled: false
# Disable automatic unit test generation
unit_tests:
enabled: false
# Tools - DISABLED: We prefer to run linting tools directly in CI
# Our comprehensive golangci-lint setup with "default: all" already covers
# most static analysis. Additional tools can be added to CI as needed.
tools:
# Go linting - disabled (we run golangci-lint with comprehensive config)
golangci-lint:
enabled: false
# Security and vulnerability scanning - disabled (prefer direct CI integration)
gitleaks:
enabled: false
semgrep:
enabled: false
osvScanner:
enabled: false
# File format linting - disabled (prefer direct CI integration)
yamllint:
enabled: false
markdownlint:
enabled: false
shellcheck:
enabled: false
hadolint:
enabled: false
actionlint:
enabled: false
buf:
enabled: false
# GitHub integration - disabled for now
github-checks:
enabled: false
# =============================================================================
# ISSUE ENRICHMENT
# Disable automatic issue enrichment (beta feature) - we only want PR reviews
# =============================================================================
issue_enrichment:
auto_enrich:
enabled: false
# =============================================================================
# CHAT
# Interactive chat with CodeRabbit in PR comments. You can ask questions like:
# - @coderabbitai explain this error handling approach
# - @coderabbitai what are the edge cases for this function?
# - @coderabbitai how does this affect backward compatibility?
# - @coderabbitai generate unit tests for this function
# =============================================================================
chat:
# Disable ASCII/emoji art in responses
art: false
# =============================================================================
# KNOWLEDGE BASE
# =============================================================================
knowledge_base:
# Learn from Crossplane's coding guidelines and apply them during reviews
code_guidelines:
filePatterns:
- "**/contributing/README.md"
# Enable MCP integration to provide context about external libraries and APIs
mcp:
usage: "enabled"