-
Notifications
You must be signed in to change notification settings - Fork 166
Expand file tree
/
Copy path.coderabbit.yaml
More file actions
155 lines (136 loc) · 6.16 KB
/
Copy path.coderabbit.yaml
File metadata and controls
155 lines (136 loc) · 6.16 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
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
# CodeRabbit configuration for console-operator
# This config integrates Claude Code skills for operator-specific reviews.
# Skills are triggered based on CODE PATTERNS (function signatures, types, YAML kinds)
# rather than file paths alone.
#
# Available skills (defined in .claude/skills/):
# /controller-review - When code has Controller types, factory.New() patterns
# /sync-handler-review - When code has sequential sync logic with early returns
# /manifest-review - When YAML has RBAC kinds or missing annotations
# /unit-test-review - When pkg/**/*_test.go has table-driven tests, go-test/deep
# /e2e-test-review - When test/e2e/ tests use framework, wait.Poll, retry patterns
# /go-quality-review - Always applied; checks deprecated APIs, code smells
language: en-US
inheritance: true
early_access: false
reviews:
profile: chill
request_changes_workflow: false
high_level_summary: true
poem: false
review_status: true
collapse_walkthrough: false
review_details: true
path_filters:
- '!vendor/**'
path_instructions:
- path: '**/*.go'
instructions: |
Review Go code following OpenShift operator patterns.
See CONVENTIONS.md for coding standards and patterns.
Refer to the following skills based on CODE PATTERNS, not just file paths:
**Refer to /controller-review when code contains:**
- Controller struct types (e.g., `type *Controller struct`)
- `func New*Controller(` factory functions
- `factory.New().WithFilteredEventsInformers(` pattern
- `.ToController(` method calls
- `Sync(ctx context.Context, controllerContext factory.SyncContext)` methods
- `operatorConfig.Spec.ManagementState` checks
- `status.NewStatusHandler` or `status.Handle*` functions
**Refer to /sync-handler-review when code contains:**
- Main operator sync functions (e.g., `sync_v400.go` content)
- Sequential resource syncing with early returns
- Incremental reconciliation loops
- Multiple `resourceapply.Apply*()` calls in sequence
- Dependency ordering of ConfigMaps → Secrets → Service Accounts → RBAC → Services → Deployments → Routes
- Feature gate conditional logic
**Refer to /go-quality-review for all Go code to check:**
- Deprecated imports: `ioutil.ReadFile`, `ioutil.WriteFile`, `ioutil.ReadAll`
- Deprecated patterns: `Dial` without `DialContext`
- Error handling: missing `%w` in fmt.Errorf
- Code smells: deep nesting (4+ levels), functions >100 lines
- Magic values: unexplained numbers/strings
- Context propagation: `context.Background()` instead of passed ctx
- Missing godoc on exported functions
- path: '**/*_test.go'
instructions: |
Review test code for quality and patterns.
**Refer to /unit-test-review when test is in pkg/**/*_test.go:**
- Table-driven test structure with test cases
- Use of `go-test/deep` for struct comparisons
- Test naming conventions (TestFunctionName)
- Error handling with `wantErr` pattern
- Edge case coverage (nil, empty, boundary values)
- Proper assertions with helpful error messages
- Test isolation (no shared mutable state)
**Refer to /e2e-test-review when test contains:**
- `framework.MustNewClientset(t, nil)` or similar e2e framework usage
- `wait.Poll` or `wait.PollImmediate` patterns
- `retry.RetryOnConflict` for updates
- Cleanup via `defer` functions
- Console/operator CR manipulations
- Test assertions on cluster state
**Suggest to use /e2e-test-review when:**
- PR adds new feature requiring e2e coverage
- Test file is empty or skeleton
- Comments indicate "TODO: add test"
**Review for common issues:**
- Missing cleanup (defer statements)
- Using `time.Sleep` instead of `wait.Poll`
- Missing context timeouts
- Vague error messages in assertions
- Tests without table-driven structure when testing multiple cases
- Ignoring errors with `_`
- Tests without assertions
- path: '**/*.yaml'
instructions: |
Review YAML manifests based on content and kind.
**Refer to /manifest-review when YAML contains:**
- `kind: Role` or `kind: ClusterRole` (RBAC review)
- `kind: RoleBinding` or `kind: ClusterRoleBinding`
- `annotations:` section (check for cluster profiles)
- `verbs: ["*"]` or wildcard permissions
- `apiGroups: ["*"]` or overly broad permissions
- ServiceAccount references in subjects
**Check for required annotations in manifests/:**
- `include.release.openshift.io/hypershift`
- `include.release.openshift.io/ibm-cloud-managed`
- `include.release.openshift.io/self-managed-high-availability`
- `include.release.openshift.io/single-node-developer`
- `capability.openshift.io/name: Console`
**For quickstarts/, additionally check:**
- QuickStart spec structure
- Task descriptions and prerequisites
- See quickstarts/README.md for guidelines
chat:
auto_reply: true
knowledge_base:
learnings:
scope: local
code_guidelines:
enabled: true
filePatterns:
- 'AGENTS.md'
- 'CLAUDE.md'
- 'ARCHITECTURE.md'
- 'CONVENTIONS.md'
- 'TESTING.md'
- '.claude/skills/*.md'
linked_repositories:
- repository: 'openshift/console'
instructions: >-
Console is the downstream UI that consumes this operator's configuration.
pkg/console/subresource/consoleserver/types.go is the canonical source
for config structs - console copies these to pkg/serverconfig/types.go
and they MUST remain in sync. Flag changes that affect: console startup
config, feature gate toggles, ConsolePlugin CRD lifecycle, plugin
enablement, or route/ingress configuration that console reads at runtime.
issues:
scope: auto
jira:
project_keys: []
linear:
team_keys: []
pull_requests:
scope: auto