|
| 1 | +# CodeRabbit Configuration for Crossplane Function SDK for Go |
| 2 | +# This configuration is optimized for the Crossplane Function SDK Go library |
| 3 | + |
| 4 | +# ============================================================================= |
| 5 | +# GLOBAL SETTINGS |
| 6 | +# ============================================================================= |
| 7 | + |
| 8 | +# Language for CodeRabbit reviews and comments (default: en-US, keeping explicit) |
| 9 | +language: "en-US" |
| 10 | + |
| 11 | +# Instructions for CodeRabbit's tone and style in reviews (max 250 chars) |
| 12 | +tone_instructions: | |
| 13 | + Be collaborative and supportive. Ask clarifying questions rather than making |
| 14 | + assumptions. Focus on the 'why' behind decisions. Frame concerns |
| 15 | + constructively and thank contributors. |
| 16 | +
|
| 17 | +# Disable early-access features for stability |
| 18 | +early_access: false |
| 19 | + |
| 20 | +# ============================================================================= |
| 21 | +# REVIEWS |
| 22 | +# ============================================================================= |
| 23 | + |
| 24 | +reviews: |
| 25 | + # We tested assertive and found it too verbose, e.g. approxing 200 comments on |
| 26 | + # https://github.com/crossplane/crossplane/pull/6777. Some of the nitpicks do |
| 27 | + # look valuable to me, but the signal to noise ratio isn't good enough. |
| 28 | + profile: "chill" |
| 29 | + |
| 30 | + # Don't generate summary in PR description - let authors write their own |
| 31 | + high_level_summary: false |
| 32 | + |
| 33 | + # Include the high-level summary in the walkthrough comment instead |
| 34 | + high_level_summary_in_walkthrough: true |
| 35 | + |
| 36 | + # Collapse walkthrough comment to reduce visual clutter in PRs |
| 37 | + collapse_walkthrough: true |
| 38 | + |
| 39 | + # Enable automatic label application |
| 40 | + auto_apply_labels: true |
| 41 | + |
| 42 | + # Automatically assign suggested reviewers (disabled - let maintainers control) |
| 43 | + auto_assign_reviewers: false |
| 44 | + |
| 45 | + # Disable poem generation in walkthrough comments |
| 46 | + poem: false |
| 47 | + |
| 48 | + # Disable review status messages to reduce comment noise |
| 49 | + review_status: false |
| 50 | + |
| 51 | + # Focus reviews on source code, exclude generated and vendor files |
| 52 | + path_filters: |
| 53 | + # Include source code |
| 54 | + - "**/*.go" |
| 55 | + - "**/*.yaml" |
| 56 | + - "**/*.yml" |
| 57 | + - "**/*.md" |
| 58 | + - "**/*.proto" |
| 59 | + - "**/Dockerfile*" |
| 60 | + - "**/Earthfile" |
| 61 | + - "**/*.sh" |
| 62 | + |
| 63 | + # Exclude generated and vendor files |
| 64 | + - "!**/zz_generated*.go" |
| 65 | + - "!**/vendor/**" |
| 66 | + - "!**/node_modules/**" |
| 67 | + - "!**/*.pb.go" |
| 68 | + - "!**/*.pb.gw.go" |
| 69 | + - "!**/mock_*.go" |
| 70 | + - "!**/fake/**" |
| 71 | + - "!**/testdata/**" |
| 72 | + - "!**/dist/**" |
| 73 | + - "!**/build/**" |
| 74 | + - "!**/.tmp-earthly-out/**" |
| 75 | + |
| 76 | + # Path-specific instructions for different areas of the codebase |
| 77 | + path_instructions: |
| 78 | + - path: "**/*.go" |
| 79 | + instructions: | |
| 80 | + Enforce Crossplane-specific patterns: Use function-sdk-go/errors |
| 81 | + for wrapping. Check variable naming (short for local scope, descriptive |
| 82 | + for wider scope). Ensure 'return early' pattern. Verify error scoping |
| 83 | + (declare in conditionals when possible). For nolint directives, require |
| 84 | + specific linter names and explanations. CRITICAL: Ensure all error |
| 85 | + messages are meaningful to end users, not just developers - avoid |
| 86 | + technical jargon, include context about what the user was trying to do, |
| 87 | + and suggest next steps when possible. |
| 88 | + |
| 89 | + - path: "**/*_test.go" |
| 90 | + instructions: | |
| 91 | + Enforce table-driven test structure: PascalCase test names (no |
| 92 | + underscores), args/want pattern, use cmp.Diff with |
| 93 | + cmpopts.EquateErrors() for error testing. Check for proper test case |
| 94 | + naming and reason fields. Ensure no third-party test frameworks (no |
| 95 | + Ginkgo, Gomega, Testify). |
| 96 | + |
| 97 | + - path: "**/*.md" |
| 98 | + instructions: | |
| 99 | + Ensure Markdown files are wrapped at 100 columns for consistency and |
| 100 | + readability. Lines can be longer if it makes links more readable, but |
| 101 | + otherwise should wrap at 100 characters. Check for proper heading |
| 102 | + structure, clear language, and that documentation is helpful for users. |
| 103 | + |
| 104 | + - path: "**/test/**" |
| 105 | + instructions: | |
| 106 | + Focus on test coverage, test clarity, and proper use of testing |
| 107 | + utilities. Ask about testing scenarios and edge cases. Ensure tests are |
| 108 | + maintainable and cover the happy path and error conditions. Verify |
| 109 | + error testing uses proper patterns (cmpopts.EquateErrors, sentinel |
| 110 | + errors for complex cases). |
| 111 | + |
| 112 | + # Automatic review settings |
| 113 | + auto_review: |
| 114 | + # Skip reviewing draft PRs until they're ready for review (default: false, keeping explicit) |
| 115 | + drafts: false |
| 116 | + |
| 117 | + # Skip reviews if PR title contains these keywords (case-insensitive) |
| 118 | + ignore_title_keywords: |
| 119 | + - "wip" |
| 120 | + - "draft" |
| 121 | + - "do not merge" |
| 122 | + - "dnm" |
| 123 | + |
| 124 | + # Skip reviews from these automated bot accounts |
| 125 | + ignore_usernames: |
| 126 | + - "dependabot[bot]" |
| 127 | + - "renovate[bot]" |
| 128 | + - "github-actions[bot]" |
| 129 | + |
| 130 | + # Quality gates that run during CodeRabbit's review to check PR readiness |
| 131 | + pre_merge_checks: |
| 132 | + # Check PR title for length and descriptiveness |
| 133 | + title: |
| 134 | + requirements: "Keep under 72 characters and be descriptive about what the change does." |
| 135 | + |
| 136 | + # Disable docstring coverage check (too noisy for Go projects) |
| 137 | + docstrings: |
| 138 | + mode: "off" |
| 139 | + |
| 140 | + # Custom checks specific to Crossplane Function SDK development practices |
| 141 | + custom_checks: |
| 142 | + - name: "Breaking Changes" |
| 143 | + mode: "error" |
| 144 | + instructions: | |
| 145 | + Fails if any public Go code (exported functions, types, methods, or |
| 146 | + fields) in '**/*.go' (excluding *_test.go and generated files) is |
| 147 | + removed, renamed, has signature changes, or has behavior changes that |
| 148 | + could break existing users, without the 'breaking-change' label. This |
| 149 | + is a library repo - all exported APIs are public. |
| 150 | + |
| 151 | + # Disable automatic code generation features |
| 152 | + finishing_touches: |
| 153 | + # Disable automatic docstring generation |
| 154 | + docstrings: |
| 155 | + enabled: false |
| 156 | + |
| 157 | + # Disable automatic unit test generation |
| 158 | + unit_tests: |
| 159 | + enabled: false |
| 160 | + |
| 161 | + # Tools - DISABLED: We prefer to run linting tools directly in CI |
| 162 | + # Our comprehensive golangci-lint setup with "default: all" already covers |
| 163 | + # most static analysis. Additional tools can be added to CI as needed. |
| 164 | + tools: |
| 165 | + # Go linting - disabled (we run golangci-lint with comprehensive config) |
| 166 | + golangci-lint: |
| 167 | + enabled: false |
| 168 | + |
| 169 | + # Security and vulnerability scanning - disabled (prefer direct CI integration) |
| 170 | + gitleaks: |
| 171 | + enabled: false |
| 172 | + |
| 173 | + semgrep: |
| 174 | + enabled: false |
| 175 | + |
| 176 | + osvScanner: |
| 177 | + enabled: false |
| 178 | + |
| 179 | + # File format linting - disabled (prefer direct CI integration) |
| 180 | + yamllint: |
| 181 | + enabled: false |
| 182 | + |
| 183 | + markdownlint: |
| 184 | + enabled: false |
| 185 | + |
| 186 | + shellcheck: |
| 187 | + enabled: false |
| 188 | + |
| 189 | + hadolint: |
| 190 | + enabled: false |
| 191 | + |
| 192 | + actionlint: |
| 193 | + enabled: false |
| 194 | + |
| 195 | + buf: |
| 196 | + enabled: false |
| 197 | + |
| 198 | + # GitHub integration - disabled for now |
| 199 | + github-checks: |
| 200 | + enabled: false |
| 201 | + |
| 202 | +# ============================================================================= |
| 203 | +# CHAT |
| 204 | +# Interactive chat with CodeRabbit in PR comments. You can ask questions like: |
| 205 | +# - @coderabbitai explain this error handling approach |
| 206 | +# - @coderabbitai what are the edge cases for this function? |
| 207 | +# - @coderabbitai how does this affect backward compatibility? |
| 208 | +# - @coderabbitai generate unit tests for this function |
| 209 | +# ============================================================================= |
| 210 | + |
| 211 | +chat: |
| 212 | + # Disable ASCII/emoji art in responses |
| 213 | + art: false |
| 214 | + |
| 215 | +# ============================================================================= |
| 216 | +# KNOWLEDGE BASE |
| 217 | +# ============================================================================= |
| 218 | + |
| 219 | +knowledge_base: |
| 220 | + # Enable MCP integration to provide context about external libraries and APIs |
| 221 | + mcp: |
| 222 | + usage: "enabled" |
0 commit comments