Skip to content

Commit 7d3c0a1

Browse files
Merge remote-tracking branch 'eclipse/main'
2 parents a456cf4 + f42c6a8 commit 7d3c0a1

3,933 files changed

Lines changed: 224474 additions & 150998 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
name: add-rebase-rules
3+
description: Generates .rebase add/override/replace rules from a commit that changes code/ files, updates rebase.sh conflict routing, and appends .rebase/CHANGELOG.md. Use when asked to add rebasing rules for a commit or PR.
4+
argument-hint: [commit-sha]
5+
disable-model-invocation: true
6+
---
7+
8+
# Add Rebase Rules
9+
10+
Create or update rebasing rules for Che-specific changes that touch VS Code subtree files under `code/`.
11+
12+
Use this skill when the user gives a commit SHA (or PR/commit URL) and asks to add rebasing rules.
13+
14+
## Required input
15+
16+
- A commit SHA is expected in `$ARGUMENTS`.
17+
- If `$ARGUMENTS` is empty, ask the user for a commit SHA before proceeding.
18+
19+
## Scope and exclusions
20+
21+
Only consider changed files under `code/`.
22+
23+
Never create rebasing rules for:
24+
- `code/extensions/che-*/**`
25+
- any `**/package-lock.json`
26+
27+
Important:
28+
- 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.
29+
- Still create rules for the upstream file(s) that import/use those Che-only helpers.
30+
31+
## Workflow
32+
33+
1. Resolve the target commit and collect changed files
34+
- If input is a URL, extract the SHA.
35+
- Get changed files:
36+
- `git show --name-only --pretty='' <sha> | sort -u`
37+
- Filter to the rule candidate set:
38+
- include: files starting with `code/`
39+
- exclude: `code/extensions/che-*/**`
40+
- exclude: `**/package-lock.json`
41+
42+
2. Classify each candidate file
43+
- `*/package.json` -> JSON merge rule (`.rebase/add/` and/or `.rebase/override/`)
44+
- Other modified upstream files -> replace rule (`.rebase/replace/<path>.json`)
45+
- Newly added Che-only files with no upstream counterpart -> skip (no rule needed)
46+
47+
3. Create or update JSON merge rules for `package.json`
48+
- Preserve only minimal changed subtree (do not copy entire package.json).
49+
- Use:
50+
- `.rebase/add/<path>` for new keys or additive nested values
51+
- `.rebase/override/<path>` when overriding existing values must be explicit
52+
- It is valid to use both for one file.
53+
- Keep file formatting consistent with existing `.rebase` JSON style (2-space indentation).
54+
55+
4. Create or update replace rules for non-JSON files
56+
- File path: `.rebase/replace/<original-path>.json`
57+
- Format: JSON array of objects with `from` and `by`.
58+
- Add one rule per changed hunk, using stable and unique snippets.
59+
- Prefer the smallest safe snippet that is unlikely to change accidentally.
60+
- If replacement is multiline, encode using escaped newlines/tabs in JSON consistently with existing files.
61+
- For multiline `from` snippets, start at the first non-whitespace token (avoid anchoring on leading indentation only).
62+
- Prefer replacing the whole logical block (`if (...) { ... }`) rather than only an inner line fragment, so closing braces remain structurally correct.
63+
64+
5. Update `rebase.sh` conflict routing
65+
- Ensure each file that now has a new rebasing rule is routable in `resolve_conflicts`.
66+
- For `package.json` files:
67+
- add `elif` branch calling `apply_package_changes_by_path "$conflictingFile"` (or equivalent existing pattern).
68+
- For non-JSON replace rules:
69+
- use `apply_changes "$conflictingFile"` for line-based replacements.
70+
- For multiline replacements, `rebase.sh` has **two** handlers — do not always default to one:
71+
- `apply_changes_multi_line "$conflictingFile"` — higher-level wrapper that resets the file (`git checkout --theirs`), calls `apply_multi_line_replace`, then stages the result (`git add`).
72+
- `apply_multi_line_replace "$conflictingFile"` — low-level function that performs the Perl multiline replacement directly, without git checkout/add.
73+
- Before adding a routing branch, inspect the existing `resolve_conflicts` block in `rebase.sh` and look at how other files in the same area are routed. Match the handler already used for similar files. For example, if neighboring entries call `apply_multi_line_replace` directly, use that; if they use `apply_changes_multi_line`, use that instead.
74+
- Do not add duplicate branches.
75+
76+
6. Update `.rebase/CHANGELOG.md`
77+
- Append a new entry in existing format:
78+
- `#### @<author>`
79+
- commit/PR link (or commit SHA if no link is available)
80+
- list only files for which rebasing rules were added/updated
81+
- separator `---`
82+
83+
7. Validate before finishing
84+
- Determine the upstream ref from `rebase.sh` and use that exact ref for validation (do not hardcode a release branch in the skill output).
85+
- Example source of truth in `rebase.sh`: `UPSTREAM_VERSION=$(git rev-parse upstream-code/release/1.108)`
86+
- If the script later points to `upstream-code/main` or another release branch, use that new ref instead.
87+
- `bash -n rebase.sh`
88+
- JSON validation for changed `.rebase/**/*.json` files (`jq empty <file>`)
89+
- For each changed `.rebase/replace/**/*.json`, verify every `from` exists in the upstream file content before finishing.
90+
- Example: `git show <upstream-ref>:<path-without-code-prefix>` and compare with the `from` snippet.
91+
- `path-without-code-prefix` means the same file path but without the leading `code/` (because `upstream-code` stores VS Code sources at repo root).
92+
- Dry-run the generated rule using the same replacement path as `rebase.sh` (Perl-based multiline replace), not a language-native `.replace(...)`.
93+
- Include at least one test case where `from`/`by` contains `$` (for example template literals like `${key}`) and confirm replacement still succeeds.
94+
- Re-check exclusions:
95+
- no rules for `code/extensions/che-*`
96+
- no rules for `package-lock.json`
97+
- Ensure every changed rule file is actually referenced by logic in `rebase.sh` when required.
98+
99+
## Decision notes
100+
101+
- Goal is to protect Che-specific behavior during upstream subtree rebases while keeping deltas in upstream files minimal.
102+
- Prefer moving larger Che logic into Che-owned files and keeping upstream file edits small; then create replace rules only for the upstream file edits.
103+
- When unsure between `add` vs `override` for JSON, follow existing `.rebase` conventions in neighboring files and keep the smallest rule payload that reproduces the required result.
104+
105+
## Examples
106+
107+
- Dependency override updates across many `code/**/package.json` files:
108+
- Example commit: `04b7984047fec31dd6993bd299f6698750c63d08`
109+
- Matching rule-update style: `eec9cd1e9e199ce9a0eb2f6e3bd1dad6fc258413`
110+
111+
- Source-level VS Code file changes protected by replace rules:
112+
- Example PR changes: `https://github.com/che-incubator/che-code/pull/617/changes`
113+
- Matching rule commit: `https://github.com/che-incubator/che-code/pull/617/changes/e794c63f01d116b0b92d5ecd220247e13a5ba946`

.coderabbit.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
2+
3+
tone_instructions: |
4+
You are a concise code reviewer. Focus only on critical logic, security, and performance issues.
5+
Avoid trivial style issues or minor formatting suggestions.
6+
7+
reviews:
8+
path_instructions:
9+
- path: ".rebase/CHANGELOG.md"
10+
instructions: "Ignore markdownlint rule MD001 (heading-increment). The `####` heading style is intentional and consistent throughout this file."
11+
# 'chill' is less verbose, 'assertive' is more verbose
12+
profile: chill
13+
# disable poem generation in comments
14+
poem: false
15+
# only post comments when there are actual findings
16+
review_status: false
17+
# suppress walkthrough/summary comment when no findings
18+
collapse_walkthrough: true
19+
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)

.rebase/CHANGELOG.md

Lines changed: 48 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,39 @@
22

33
The file to keep a list of changed files which will potentionaly help to resolve rebase conflicts.
44

5+
#### @RomanNikitenko
6+
https://github.com/che-incubator/che-code/pull/689
7+
8+
- code/resources/server/bin/helpers/browser-linux.sh
9+
- code/resources/server/bin/remote-cli/code-linux.sh
10+
---
11+
12+
#### @vitaliy-guliy
13+
https://github.com/che-incubator/che-code/commit/a26b43847e5afd707ebffbddef712893fb77a379
14+
15+
- code/product.json
16+
---
17+
18+
#### @RomanNikitenko
19+
https://github.com/RomanNikitenko/che-code/commit/199009d7def5f11925978911f4a1715797d3144e
20+
21+
- code/product.json
22+
- code/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.ts
23+
---
24+
25+
#### @RomanNikitenko
26+
https://github.com/che-incubator/che-code/commit/8409a0167c3cd4ca3555c9c6fc32f2fce87923e9
27+
28+
- code/src/vs/workbench/services/extensions/common/extensionsProposedApi.ts
29+
---
30+
31+
#### @sbouchet
32+
https://github.com/che-incubator/che-code/pull/677
33+
34+
- code/package.json
35+
- code/test/mcp/package.json
36+
---
37+
538
#### @sbouchet
639
https://github.com/che-incubator/che-code/pull/659
740

@@ -13,10 +46,16 @@ https://github.com/che-incubator/che-code/pull/659
1346
- code/extensions/json-language-features/package.json
1447
- code/extensions/markdown-language-features/package.json
1548
- code/extensions/npm/package.json
16-
- code/test/mcp/package.json
1749
- code/test/automation/package.json
1850
- code/test/integration/browser/package.json
19-
- code/test/smoke/package.json
51+
---
52+
53+
#### @sbouchet @RomanNikitenko
54+
https://github.com/che-incubator/che-code/pull/668 \
55+
https://github.com/che-incubator/che-code/commit/c1cb30760472ea262b0c59cacae32bb398a40cdd
56+
57+
- code/package.json
58+
- code/remote/package.json
2059
---
2160

2261
#### @sbouchet
@@ -61,15 +100,18 @@ https://github.com/che-incubator/che-code/pull/655
61100
- code/src/vs/server/node/extensionHostConnection.ts
62101
---
63102

64-
#### @sbouchet
65-
https://github.com/che-incubator/che-code/pull/654
103+
#### @sbouchet @RomanNikitenko
104+
https://github.com/che-incubator/che-code/pull/654 \
105+
https://github.com/che-incubator/che-code/pull/646/changes/eebf4d4db208a1fc9c1ac056f613a5385471c892
66106

67107
- code/test/mcp/package.json
68108
- code/package.json
109+
- code/build/package.json
69110
---
70111

71-
#### @sbouchet
72-
https://github.com/che-incubator/che-code/pull/648
112+
#### @sbouchet @RomanNikitenko
113+
https://github.com/che-incubator/che-code/pull/648 \
114+
https://github.com/che-incubator/che-code/pull/646/changes/c22ae74ef707862afdb29f9a9f343be912cb05f8
73115

74116
- code/package.json
75117
- code/build/npm/gyp/package.json
@@ -124,12 +166,6 @@ https://github.com/che-incubator/che-code/pull/611
124166
- code/build/npm/gyp/package.json
125167
---
126168

127-
#### @sbouchet
128-
https://github.com/che-incubator/che-code/pull/607
129-
130-
- code/extensions/vscode-api-tests/package.json
131-
---
132-
133169
#### @sbouchet
134170
https://github.com/che-incubator/che-code/pull/604
135171

@@ -208,12 +244,6 @@ https://github.com/che-incubator/che-code/pull/557
208244
- code/remote/package.json
209245
---
210246

211-
#### @RomanNikitenko
212-
https://github.com/che-incubator/che-code/pull/549
213-
214-
- code/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts
215-
---
216-
217247
#### @RomanNikitenko
218248
https://github.com/che-incubator/che-code/pull/540 \
219249
https://github.com/RomanNikitenko/che-code/commit/724c0a97f73e070f80818091a8d19b7ed186b394 \
@@ -277,12 +307,6 @@ https://github.com/che-incubator/che-code/pull/476
277307
- code/extensions/package.json
278308
---
279309

280-
#### @RomanNikitenko
281-
https://github.com/che-incubator/che-code/pull/478
282-
283-
- code/package.json
284-
---
285-
286310
#### @RomanNikitenko
287311
https://github.com/che-incubator/che-code/pull/463
288312

.rebase/add/code/build/package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@
88
},
99
"qs": "6.14.1",
1010
"lodash": "^4.17.23",
11+
"fast-xml-parser": "^4.5.4",
12+
"ajv": "^8.18.0",
1113
"@vscode/vsce": {
12-
"minimatch": "^3.1.5"
14+
"minimatch": "^3.1.5",
15+
"glob": {
16+
"minimatch": "^10.2.4"
17+
}
1318
},
1419
"vscode-universal-bundler": {
1520
"minimatch": "^9.0.9"
16-
},
17-
"fast-xml-parser": "^4.5.4"
21+
}
1822
}
1923
}

.rebase/add/code/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,8 @@
1212
"@gulp-sourcemaps/identity-map": {
1313
"postcss": "8.4.33"
1414
},
15-
"npm-run-all": {
16-
"cross-spawn": "7.0.6"
17-
},
18-
"postcss": {
19-
"nanoid": "3.3.8"
20-
},
2115
"@vscode/test-web": {
22-
"tar-fs": "3.1.1"
16+
"path-to-regexp": "8.4.0"
2317
},
2418
"prebuild-install": {
2519
"tar-fs": "2.1.4"
@@ -37,8 +31,14 @@
3731
"ajv-formats": {
3832
"ajv": "^8.18.0"
3933
},
40-
"schema-utils": {
41-
"ajv": "^8.18.0"
34+
"schema-utils@3": {
35+
"ajv": "6.14.0"
36+
},
37+
"schema-utils@4": {
38+
"ajv": "^8.18.0"
39+
},
40+
"ajv-keywords@3": {
41+
"ajv": "6.14.0"
4242
},
4343
"tar": "^7.5.11",
4444
"undici": "^7.24.0",

.rebase/add/code/product.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
{
2+
"builtInExtensions": [
3+
{
4+
"name": "devfile.vscode-devfile",
5+
"version": "0.0.4",
6+
"sha256": "c55a6c1d087e7715bfacb01c0c2b52ef0f935d85f0707265d9068cd64143744c",
7+
"repo": "https://github.com/devfile/vscode-walkthrough-extension"
8+
}
9+
],
210
"sendASmile": {
311
"reportIssueUrl": "https://github.com/eclipse/che/issues/new?assignees=&labels=kind%2Fbug&template=bug_report.yml",
412
"requestFeatureUrl": "https://github.com/eclipse/che/issues/new?assignees=&labels=kind%2Fenhancement&template=enhancement.yaml"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"overrides": {
33
"qs": "6.14.1",
4-
"ajv": "6.14.0",
5-
"minimatch": "^3.1.5"
4+
"ajv": "8.18.0",
5+
"path-to-regexp": "8.4.0"
66
}
77
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"overrides": {
3-
"form-data": "^3.0.4",
4-
"minimatch": "^3.1.5"
3+
"form-data": "^3.0.4"
54
}
65
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"devDependencies": {
3-
"@types/minimatch": "^3.0.5",
4-
"jws": "^4.0.1"
3+
"@types/minimatch": "^3.0.5"
54
}
65
}

.rebase/override/code/extensions/vscode-api-tests/package.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)