Skip to content

fast gates: deepen a pull request's checkout so a head that brings the base in is not read as adding the whole tree - #24539

Merged
teamleaderleo merged 1 commit into
feat-cmux-nextfrom
sidebar-look-merge-base
Oct 23, 2026
Merged

teamleaderleo merged 1 commit into
feat-cmux-nextfrom
sidebar-look-merge-base

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

The prepush "Sidebar-Look:" check in Fast gates on the merge fails a PR whose head commit brings the base in, even when the PR doesn't touch the sidebar.
Leo: "The fast-gates sidebar-look-owner false red that fails every PR must diff against the real merge base."

Why it happens: on #24526 at 3a47dc1 it reported 162 sidebar files. The pull_request checkout holds the merge ref at depth 2, which is the merge and its two parents. The PR head's own parents are cut off, so git treats the head as a root commit that adds the whole tree, and rev-list --no-merges keeps it even when it is a merge, because a cut merge shows no parents. Any per-commit gate reads it the same way. transcript-parity got past it by rebasing #24526 to an identical tree (a7e8cfe), but every lane that updates from base would hit it.

Fix: prepare deepens the pull_request checkout using the rule the dispatch path already uses, now shared as deep_enough and deepen: keep deepening until the base meets the head at its true merge base, with no cut between them. A full clone is left alone, as before.

Tests

  • New: test_pull_request_deepens_so_a_head_that_brings_the_base_in_is_not_a_cut. It sets up a depth-2 merge-ref checkout, the same thing actions/checkout fetches, whose head brings the base in. After prepare, rev-list --no-merges base..merge is only the PR's own commit, and that commit's diff lists only its own file. On the old script the test fails, listing the cut merge commit instead.
  • New: test_pull_request_in_a_full_clone_fetches_nothing_more.
  • tests/test_cmux_next_fast_gates.py: 59 tests, OK. tests/test_ci_no_shallow_dev_fetch.py: OK.

Observed / Not run

  • Observed: both test files above, run locally (Python only, no build).
  • Not run: this workflow on a real PR; this PR's own Fast gates run is the first.

Changelog

none

Agent session: huge-blue

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes the "Sidebar-Look:" prepush check failing a PR whose head commit brings the base in, even when the PR doesn't touch the sidebar — on #24526 it reported 162 sidebar files.

The pull_request checkout holds the merge ref at depth 2, cutting the PR head's own parents, so git reads the head as a root commit that adds the whole tree (rev-list --no-merges keeps it because a cut merge shows no parents). prepare now deepens pull_request checkouts with the rule the dispatch path already used, extracted into shared deep_enough/deepen: keep deepening until the base meets the head at its true merge base, with no cut between them. A full clone is left alone, as before.

Tests

  • New test sets up a depth-2 merge-ref checkout whose head brings the base in; after prepare, rev-list --no-merges base..merge lists only the PR's own commit. Fails on the old script.
  • New test confirms a full-clone pull_request fetches nothing more.

Written for commit 094e44f. Summary will update on new commits.

View guided diff Turn on auto-fix

The pull_request checkout holds the merge ref at depth 2: the merge and its two parents. The PR head's own
parents are cut, so a cut head reads as a root commit that adds the whole tree. On #24526 at 3a47dc1 the head
was a commit bringing the base in; `rev-list --no-merges` listed it (a cut merge shows no parents) and the
Sidebar-Look check saw it add 162 sidebar files.

prepare now deepens the pull_request checkout with the same rule the dispatch path already used (shared as
deep_enough/deepen): until the base meets the head at its true merge base with no cut between them. A full
clone is left alone, as before.

Tests: a depth-2 merge-ref checkout whose head brings the base in. After prepare, rev-list base..merge
--no-merges is only the PR's own commit, and that commit's diff is only its own file. This fails on the old
script with the cut merge listed instead. A full-clone pull_request fetches nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a1603a-6462-72f0-a4b0-6937eb58e4c3&host=cosmic-gray
@teamleaderleo teamleaderleo added the risk:low Risk tier (docs/ci/risk-tiers.md) label Oct 23, 2026
@cursor

cursor Bot commented Oct 23, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 094e44f: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr24539 -f ref=sidebar-look-merge-base -f platform=macos -f backend_mode=local

red: cmux-next checks (god files, concurrency, crash safety, l10n); NEW: red check: Checks job structure (+2 more) is not red on the base 3aa1340; do not merge until green; see lane-rules

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-uq3ig created for this PR by the cmux coordinator.

@github-actions github-actions Bot added risk:normal Risk tier (docs/ci/risk-tiers.md) and removed risk:low Risk tier (docs/ci/risk-tiers.md) labels Oct 23, 2026
@blacksmith-sh

blacksmith-sh Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Found 8 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmpjqwi4qxh/summary-fail.json (live):/summary-fail.json (live): View Logs
/tmp/tmpxs7ywuiz/summary-missing.json (live):/summary-missing.json (live): View Logs
[tabs] debug.tab_switch timed 0 of 40 switches/
[tabs] debug.tab_switch timed 0 of 40 switches
View Logs
[tabs] debug.tab_switch timed 0 of 40 switches/
[tabs] debug.tab_switch timed 0 of 40 switches
View Logs
[tabs] the window draws no frames/[tabs] the window draws no frames View Logs
[tabs] the window draws no frames/[tabs] the window draws no frames View Logs
test_base_passes (main.NoticesPairTests.test_base_passes)/
test_base_passes (main.NoticesPairTests.test_base_passes)
View Logs
test_targets_outside_the_app_go_to_the_mac_canary (main.SwiftCanaryFleetCoverage.te
st_targets_outside_the_app_go_to_the_mac_canary)/
test_targets_outside_the_app_go_to_the_mac_canary (main.SwiftCanaryFleetCoverage.te
st_targets_outside_the_app_go_to_the_mac_canary)
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next / cmux-next checks (god files, concurrency, crash safety, l10n) › Checks job structure is red on 13 of 14 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by cx4-land24539 on huge-blue

teamleaderleo added a commit to teamleaderleo/glaeda that referenced this pull request Oct 23, 2026
… while checks run (#1601)

* glaeda-gh: over 100 checks, a superseded cancel does not end the wait while checks run

GitHub's rollup still counts a superseded attempt that was cancelled, so with more than one page of
checks a FAILURE rollup and no shown failure was read as a failure past the first page, and the wait
exited 1 after 5s while 7 checks still ran (manaflow-ai/cmux#24539).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a1603a-6462-72f0-a4b0-6937eb58e4c3&host=cosmic-gray

* glaeda-gh: a shown failure still ends a --until required wait over a superseded cancel

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a1603a-6462-72f0-a4b0-6937eb58e4c3&host=cosmic-gray

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex xhigh, correctness first): SHIP at 094e44f

The exact head preserves the dispatch path's merge-base/deepen loop and shares it with pull_request preparation. Raw SHAs work with rev, merge-base, rev-list, and reachable-SHA fetches; full clones return before fetching. The depth-2 regression is covered by test_pull_request_deepens_so_a_head_that_brings_the_base_in_is_not_a_cut, and the full-clone no-fetch case is covered as well.

No blocking findings. Nits: an unavailable or unauthenticated remote would fail while deepening (the CI checkout has its public origin), and histories over 5,000 commits fall through to --unshallow, the existing dispatch-path tradeoff. No fork or HTTPS fetch test is included.

Verification: python3 -m unittest tests.test_cmux_next_fast_gates (59 tests, OK); python3 -m unittest tests.test_ci_no_shallow_dev_fetch (4 tests, OK); cmux-next/fast-gates passed on this exact head. The remaining red reported on the PR is the documented base-red Checks job structure check.

@teamleaderleo teamleaderleo added the ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds label Oct 23, 2026
@teamleaderleo
teamleaderleo merged commit 2507e62 into feat-cmux-next Oct 23, 2026
154 of 169 checks passed
@teamleaderleo
teamleaderleo deleted the sidebar-look-merge-base branch October 23, 2026 20:16
@github-actions

Copy link
Copy Markdown
Contributor

Shipped in:

@github-actions

Copy link
Copy Markdown
Contributor

Shipped in:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant