You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--body "$(echo -e "See [merge-train-readme.md](https://github.com/${{ github.repository }}/blob/next/.github/workflows/merge-train-readme.md).\nThis is a merge-train.")" \
37
+
--label "ci-no-squash"
38
+
39
+
echo "Created PR for $branch"
40
+
else
41
+
echo "PR #$existing_pr already exists for $branch"
Copy file name to clipboardExpand all lines: .github/workflows/merge-train-readme.md
+4-32Lines changed: 4 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,10 +29,10 @@ Inspired by [rust rollups](https://forge.rust-lang.org/release/rollups.html), bu
29
29
30
30
### Merge Train Lifecycle
31
31
32
-
1.**Creation**: A merge train PR is created with an empty commit. All existing PRs are updated to prevent issues due to the squash merge.
33
-
2.**Accumulation**: Feature PRs are merged into the merge train branch
34
-
3.**Auto-merge**: After 4 hours of inactivity (with meaningful commits), the train is automatically merged
35
-
4.**Recreation**: The cycle starts again with a new empty merge train
32
+
1.**Creation**: A merge train PR is created automatically when changes are pushed to the branch and labeled with `ci-no-squash`.
33
+
2.**Accumulation**: Feature PRs are merged into the merge train branch, squashed
34
+
3.**Auto-merge**: After 4 hours of inactivity (with meaningful commits), the train is automatically merged with a merge-commit (not a squash)
35
+
4.**Recreation**: The cycle starts again with a new merge train
36
36
37
37
## Handling Merge Failures
38
38
@@ -47,31 +47,3 @@ When a merge-train fails due to issues from `next`:
47
47
- Merge a revert or workaround into `next`
48
48
- The fix will auto-propagate to merge-train via automation
49
49
- Best when key assumptions are broken or multiple trains affected
50
-
51
-
## Resolving Merge Conflicts
52
-
53
-
When merge conflicts arise in the merge-train branch:
54
-
55
-
1. Pull the latest merge-train branch locally
56
-
2. Resolve conflicts in your editor
57
-
3. Push the merge commit directly to the merge-train branch
58
-
59
-
**Note**: Keep the merge commit when resolving conflicts - squashing won't help with the history divergence issues that occur after merge-train recreation.
60
-
61
-
## RECOVERING FROM MERGE TRAIN RECREATION
62
-
63
-
When a merge-train is recreated after squashing, PRs with commits from the old merge-train need rebasing.
64
-
65
-
### Three Recovery Options:
66
-
67
-
1.**Automatic (Recommended)**: Add the `auto-rebase` label to your PR
68
-
2.**Script**: Run `./scripts/auto_rebase_pr.sh` locally
69
-
3.**Manual**: Follow the git instructions posted as a comment on your PR
70
-
71
-
The automation will detect if your PR contains commits from the old merge-train and post specific rebase instructions as a comment. These instructions use `git rebase --onto` to cleanly move your commits to the new base, preserving your work while avoiding the squashed history.
72
-
73
-
**Important**:
74
-
- PRs without commits from the old merge-train need no action
75
-
- The recreation process automatically checks each PR and only comments on affected ones
76
-
- The posted git commands help you merge the old PR head and then rebase onto the new base
77
-
- Always check your diff afterwards for unexpected changes
Copy file name to clipboardExpand all lines: CI.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -256,6 +256,43 @@ ci rlog
256
256
257
257
This will also show the last completed log if the run has already completed. You can provide a GA run id (output by `ci trigger`) to see a historical run.
258
258
259
+
## CI Labels and Automation
260
+
261
+
### Pull Request Labels
262
+
263
+
The following labels can be used to control CI behavior on pull requests:
264
+
265
+
-**`ci-squash-and-merge`**: Automatically squashes all commits in your PR into a single commit. Add this label to trigger squashing. The label is automatically removed after squashing. Thanks to content-based caching (see below), subsequent CI runs will be skipped if the content hasn't changed.
266
+
267
+
-**`ci-no-squash`**: Exempts the PR from the single-commit requirement. Use when multiple commits are intentional (e.g., merge-train PRs).
268
+
269
+
-**`ci-merge-queue`**: Simulates merge queue behavior on your PR, running the full test suite.
270
+
271
+
-**`ci-full`**: Forces a full CI run instead of the default fast run.
272
+
273
+
-**`ci-docs`**: Runs only documentation-related CI checks.
274
+
275
+
-**`ci-barretenberg`**: Runs only Barretenberg-related CI checks.
276
+
277
+
-**`ci-no-cache`**: Disables build caching for this CI run.
278
+
279
+
-**`ci-no-fail-fast`**: Continues running all tests even if some fail.
280
+
281
+
### Squash Enforcement
282
+
283
+
PRs targeting `next` must be squashed to a single commit unless labeled with `ci-no-squash`. PRs targeting other branches (like `merge-train/*`) are automatically exempt from this requirement.
284
+
285
+
### Top-level Content-Based CI Caching
286
+
287
+
CI3 has granular caching, but as well it includes an additional layer of caching based on git content. When CI completes successfully, it stores a success marker keyed by the hash of the repository's file tree. On subsequent runs, if the exact same content is detected (same tree hash), CI will skip execution entirely.
288
+
289
+
This is particularly useful when:
290
+
- You squash commits using `ci-squash-and-merge` - the resulting single commit has the same content, so CI won't re-run
291
+
- You rebase without changes - if the final content is identical, CI is skipped
292
+
- Multiple PRs have identical changes - only the first needs to run CI
293
+
294
+
The content hash is computed using `git rev-parse HEAD^{tree}`, which provides a unique identifier for the entire file tree state, regardless of commit history.
295
+
259
296
## Denoise Logs
260
297
261
298
When a CI run is taking place and it has a redis cache available, you will see logs like this:
0 commit comments