From 349227ff466211b06cb22b49dbada87a1c51e828 Mon Sep 17 00:00:00 2001 From: lawrencecchen <54008264+lawrencecchen@users.noreply.github.com> Date: Sun, 1 Nov 2026 15:35:55 +0000 Subject: [PATCH 1/2] test(nightly): the resolver refuses a published commit whose nightly step scripts differ from the tip's (red) Since #30912 the nightly runs step scripts from scripts/ci/nightly-steps/ in the resolved commit's checkout, under the tip's workflow. A published commit behind the tip whose step scripts differ would run older copies of steps the tip's workflow names. The case runs nightly.yml's own CMUX_TUI_TREE_SAME_PATHS policy. Red here: bash scripts/cmux-next/tests/pin-cmux-tui-resolve-newest.test.sh FAIL: nightly must not resolve a published revision with an older nightly step script --- .../tests/pin-cmux-tui-resolve-newest.test.sh | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/scripts/cmux-next/tests/pin-cmux-tui-resolve-newest.test.sh b/scripts/cmux-next/tests/pin-cmux-tui-resolve-newest.test.sh index b9b9a708a92a..27e6b2835feb 100755 --- a/scripts/cmux-next/tests/pin-cmux-tui-resolve-newest.test.sh +++ b/scripts/cmux-next/tests/pin-cmux-tui-resolve-newest.test.sh @@ -179,6 +179,27 @@ resolve CMUX_TUI_TREE_MAX_AGE_HOURS=48 "CMUX_TUI_TREE_SAME_PATHS=$nightly_same_p [[ "$status" == 0 ]] && grep -qx "source_commit=$repaired" <<<"$out" \ || fail "nightly must resolve the published revision with the repaired Chief lockfile (exit $status):" "$out" "$err" +# The nightly's step scripts (#30912, #31013) run from the resolved commit's checkout under the +# tip's workflow: a published commit whose scripts/ci/nightly-steps differ from the tip's would run +# an older copy of a step the tip's workflow names. The workflow's own policy refuses it. +step=scripts/ci/nightly-steps/example-step.sh +mkdir -p "$src/$(dirname "$step")" +echo "echo old step" > "$src/$step" +git_q -C "$src" add -A; GIT_COMMITTER_DATE="@$future +0000" git_q -C "$src" commit -m "old step script" +publish "$(git -C "$src" rev-parse HEAD)" "" +echo "echo new step" > "$src/$step" +echo five-b > "$src/cmux-tui/a" +git_q -C "$src" add -A; GIT_COMMITTER_DATE="@$future +0000" git_q -C "$src" commit -m "new step script and tui" +new_step=$(git -C "$src" rev-parse HEAD) +resolve CMUX_TUI_TREE_MAX_AGE_HOURS=48 "CMUX_TUI_TREE_SAME_PATHS=$nightly_same_paths" +[[ "$status" != 0 ]] || fail "nightly must not resolve a published revision with an older nightly step script, got:" "$out" +grep -q "scripts/ci/nightly-steps differs from the tip" <<<"$err" \ + || fail "the stale step script refusal needs a clear message:" "$err" +publish "$new_step" "" +resolve CMUX_TUI_TREE_MAX_AGE_HOURS=48 "CMUX_TUI_TREE_SAME_PATHS=$nightly_same_paths" +[[ "$status" == 0 ]] && grep -qx "source_commit=$new_step" <<<"$out" \ + || fail "nightly must resolve the published revision with the tip's step scripts (exit $status):" "$out" "$err" + # No Mac Release compile is required (#25786): nightly-next run 40427307041 # failed here because fb384d011b85, the only commit in its window with a # published tree, had no green "cmux-next Release compile (Xcode 26)". With From 24a7029fc3b080736f5045c1d60ff0435f56b7e2 Mon Sep 17 00:00:00 2001 From: lawrencecchen <54008264+lawrencecchen@users.noreply.github.com> Date: Sun, 1 Nov 2026 15:35:56 +0000 Subject: [PATCH 2/2] fix(nightly): the resolved build commit carries the tip's scripts/ci/nightly-steps resolve-nightly-cmux-tui-client's CMUX_TUI_TREE_SAME_PATHS gains scripts/ci/nightly-steps. pin-cmux-tui.sh compares `git rev-parse :`, which for a directory is its tree, so a candidate whose step scripts differ in any file from the tip's is skipped with "scripts/ci/nightly-steps differs from the tip", as for nightly.yml and the Chief lockfile. Follow-up from the #31013 review. Cost: a nightly no longer builds a published commit behind the tip when the tip changed a step script after it; it takes a newer published commit, or builds the tip while its tree publishes (resolve-tree-pending.sh), as for a nightly.yml change today. Green here: bash scripts/cmux-next/tests/pin-cmux-tui-resolve-newest.test.sh PASS --- .github/workflows/nightly.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 05e97a75a150..47f996327348 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -3024,8 +3024,9 @@ jobs: # commit, so the resolved commit must carry the same file: run # 37568319518 called a dSYM script its older build commit lacked. # Preserve Chief lockfile repairs too: run 37724899486 selected an - # older published revision and failed cargo build --locked. - CMUX_TUI_TREE_SAME_PATHS: .github/workflows/nightly.yml Native/OptChat/optchat-chief/Cargo.lock + # older published revision and failed cargo build --locked. The step + # scripts the workflow calls from that checkout must be the tip's (#30912). + CMUX_TUI_TREE_SAME_PATHS: .github/workflows/nightly.yml Native/OptChat/optchat-chief/Cargo.lock scripts/ci/nightly-steps GH_TOKEN: ${{ github.token }} run: bash scripts/ci/nightly-steps/resolve-cmux-tui-client-commit.sh