Skip to content

Commit 66e552f

Browse files
sbouchetclaude
andauthored
Add CodeRabbit pre-merge checks for upstream change validation (#678)
* Add CodeRabbit pre-merge checks for upstream change validation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e76fa85 commit 66e552f

1 file changed

Lines changed: 39 additions & 1 deletion

File tree

.coderabbit.yaml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
22

33
tone_instructions: |
4-
You are a concise code reviewer. Focus only on critical logic, security, and performance issues.
4+
You are a concise code reviewer. Focus only on critical logic, security, and performance issues.
55
Avoid trivial style issues or minor formatting suggestions.
66
77
reviews:
@@ -17,3 +17,41 @@ reviews:
1717
# suppress walkthrough/summary comment when no findings
1818
collapse_walkthrough: true
1919
changed_files_summary: false
20+
21+
# Pre-merge checks
22+
pre_merge_checks:
23+
title:
24+
mode: error
25+
requirements: >
26+
Title must be concise (under 72 characters) and clearly describe the change.
27+
Use imperative mood (e.g. "Fix", "Add", "Update", not "Fixed", "Added", "Updated").
28+
description:
29+
mode: warning
30+
docstrings:
31+
mode: off
32+
custom_checks:
33+
- name: Rebase rules for upstream changes
34+
mode: error
35+
instructions: >
36+
If the PR modifies files under `code/` (excluding `code/extensions/che-*/**`
37+
and `**/package-lock.json`), then the PR MUST also include corresponding
38+
rebase rules in the `.rebase/` directory AND an entry in `.rebase/CHANGELOG.md`.
39+
40+
Important:
41+
- A file can be under `code/` and still be Che-only (for example `code/src/.../che/...` newly created by Che). Do not create a rule for such files if they are not upstream VS Code files.
42+
- Still create rules for the upstream file(s) that import/use those Che-only helpers.
43+
44+
The PR template has a checklist section "Does this PR contain changes that
45+
override default upstream Code-OSS behavior?" with three checkboxes. If the
46+
PR touches files under `code/`, all three checkboxes should be checked.
47+
48+
PASS if:
49+
- No files under `code/` are changed (excluding che extensions and lock files), OR
50+
- Newly added Che-only files with no upstream counterpart, OR
51+
- Files under `code/` are changed AND `.rebase/` rules, `.rebase/CHANGELOG.md`,
52+
and `rebase.sh` conflict routing are also updated in the same PR.
53+
54+
FAIL if files under `code/` are changed but any of the following are missing:
55+
- `.rebase/` rule files (add/override/replace as appropriate)
56+
- `.rebase/CHANGELOG.md` entry
57+
- `rebase.sh` routing for the new rule files (e.g. elif branch in resolve_conflicts)

0 commit comments

Comments
 (0)