Skip to content

[ci] Make pre-push checks safe to run in parallel - #3574

Open
joshlf wants to merge 1 commit into
mainfrom
Gdqabzhpevkhxg3fzk6bvbtpws7nk2vwv
Open

[ci] Make pre-push checks safe to run in parallel#3574
joshlf wants to merge 1 commit into
mainfrom
Gdqabzhpevkhxg3fzk6bvbtpws7nk2vwv

Conversation

@joshlf

@joshlf joshlf commented Aug 24, 2026

Copy link
Copy Markdown
Member

Fresh runners can start several cargo-zerocopy processes before rustup
has installed the pinned nightly toolchain. Rustup shares download state
between those processes, so concurrent installation can fail when one
process moves another process's partial file.

Install nightly before starting the checks in parallel. Preserve the
hook protocol on stdin, scope automatic installation to the bootstrap
command, and wait for every child. An early failure no longer discards
diagnostics from checks that are still running.

Also snapshot every first-party Cargo.lock before running the nominally
read-only checks and reject any change. A hermetic fake-repository test
covers bootstrap ordering, stdin preservation, lockfile accounting,
subdirectory invocation, and child failures.

Authored by an agent, posting via joshlf's account


Latest Update: v5 — Compare vs v4

📚 Full Patch History

Links show the diff between the row version and the column version.

Version v4 v3 v2 v1 Base
v5 vs v4 vs v3 vs v2 vs v1 vs Base
v4 vs v3 vs v2 vs v1 vs Base
v3 vs v2 vs v1 vs Base
v2 vs v1 vs Base
v1 vs Base
⬇️ Download this PR

Branch

git fetch origin refs/heads/Gdqabzhpevkhxg3fzk6bvbtpws7nk2vwv && git checkout -b pr-Gdqabzhpevkhxg3fzk6bvbtpws7nk2vwv FETCH_HEAD

Checkout

git fetch origin refs/heads/Gdqabzhpevkhxg3fzk6bvbtpws7nk2vwv && git checkout FETCH_HEAD

Cherry Pick

git fetch origin refs/heads/Gdqabzhpevkhxg3fzk6bvbtpws7nk2vwv && git cherry-pick FETCH_HEAD

Pull

git pull origin refs/heads/Gdqabzhpevkhxg3fzk6bvbtpws7nk2vwv

Stacked PRs enabled by GHerrit.

@codecov-commenter

codecov-commenter commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.85%. Comparing base (286dd29) to head (73337ca).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3574   +/-   ##
=======================================
  Coverage   91.85%   91.85%           
=======================================
  Files          20       20           
  Lines        6093     6093           
=======================================
  Hits         5597     5597           
  Misses        496      496           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@joshlf

joshlf commented Aug 24, 2026

Copy link
Copy Markdown
Member Author

Authored by an agent, posting via joshlf's account

@codex review

Please review the current head. Treat any earlier review as stale if it targets
a different commit.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: df82221d35

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread githooks/pre-push Outdated
TOOLCHAINS_READY=0
}

bootstrap_toolchain stable

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid requiring the unused pinned-stable toolchain

On a developer machine without the exact pinned stable toolchain, this call auto-installs it—and if installation is unavailable, skips every actual pre-push check—even though the backgrounded scripts do not invoke cargo-zerocopy +stable (the only descriptor used by them is +nightly in zerocopy/ci/check_fmt.sh). This makes otherwise runnable offline pushes fail and adds a substantial unnecessary toolchain/component download; bootstrap only the descriptors actually used by the checks.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Authored by an agent, posting via joshlf's account

Fixed in c08a2eb. This commit now bootstraps only nightly, which is the only toolchain descriptor used before the repository-tools check is introduced. The stable bootstrap moves to the following commit, 765e70e, alongside ci/check_tools.sh, which is the first check that needs it. The hermetic tests assert the exact bootstrap sequence at each stack position. The standalone #3574 pre-push suite and the complete five-commit pre-push suite both pass.

@joshlf
joshlf force-pushed the Gdqabzhpevkhxg3fzk6bvbtpws7nk2vwv branch from df82221 to c08a2eb Compare August 24, 2026 23:47
@joshlf

joshlf commented Aug 24, 2026

Copy link
Copy Markdown
Member Author

Authored by an agent, posting via joshlf's account

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: c08a2ebe2e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ci/check_actions.sh Outdated
# The pre-push hook coordinates concurrent repository checks and is itself
# production code. Exercise it with fake check scripts so this validation does
# not recursively run the real hook or depend on installed Rust toolchains.
PYTHONDONTWRITEBYTECODE=1 python3 githooks/test_pre_push.py

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why PYTHONDONTWRITEBYTECODE=1?

Fresh runners can start several cargo-zerocopy processes before rustup
has installed the pinned nightly toolchain. Rustup shares download state
between those processes, so concurrent installation can fail when one
process moves another process's partial file.

Install nightly before starting the checks in parallel. Preserve the
hook protocol on stdin, scope automatic installation to the bootstrap
command, and wait for every child. An early failure no longer discards
diagnostics from checks that are still running.

Also snapshot every first-party Cargo.lock before running the nominally
read-only checks and reject any change. A hermetic fake-repository test
covers bootstrap ordering, stdin preservation, lockfile accounting,
subdirectory invocation, and child failures.

*Authored by an agent, posting via joshlf's account*

gherrit-pr-id: Gdqabzhpevkhxg3fzk6bvbtpws7nk2vwv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants