Skip to content

Parallelize Patch Build sequence test#2203

Open
dagood wants to merge 5 commits intomicrosoft/mainfrom
dev/dagood/parallel-patch-seq
Open

Parallelize Patch Build sequence test#2203
dagood wants to merge 5 commits intomicrosoft/mainfrom
dev/dagood/parallel-patch-seq

Conversation

@dagood
Copy link
Member

@dagood dagood commented Mar 20, 2026

This workflow tests that Go is buildable after applying each patch. This takes a while, and scales O(N) per patch. This creates an artificial limit to how many patch files we add.

This PR parallelizes this workflow to O(1) per patch, as long as we're able to freely reserve agents.

Addresses #2202 (comment)

@dagood dagood marked this pull request as ready for review March 20, 2026 17:42
@dagood dagood requested a review from a team as a code owner March 20, 2026 17:42
Copilot AI review requested due to automatic review settings March 20, 2026 17:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a GitHub Actions matrix-based patch build workflow by enumerating patches and enabling applying only the first N patches during submodule refresh, allowing patch-build steps to run in parallel up to each patch.

Changes:

  • Introduce a write-patch-matrix utility to emit a JSON matrix of patches for GitHub Actions.
  • Add -take to submodule-refresh to apply only the first N patches by staging them into a temporary directory.
  • Update patch-build.yml to generate a matrix and run builds for each “apply patches up to N” entry.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
eng/_util/cmd/write-patch-matrix/write-patch-matrix.go New CLI that lists patches and writes a JSON matrix (stdout or $GITHUB_OUTPUT).
eng/_util/cmd/submodule-refresh/submodule-refresh.go Adds -take support via temp patch dir + file copy helper.
.github/workflows/patch-build.yml Switches from sequential loop to matrix-driven parallel builds.

@microsoft microsoft deleted a comment from Copilot AI Mar 20, 2026
@dagood
Copy link
Member Author

dagood commented Mar 20, 2026

(Delete was a misclick, seems like I misinterpreted review UI.)

Use eng/artifacts.
Rely on WalkGoPatches.
Explicitly don't support zero patch files.
@dagood
Copy link
Member Author

dagood commented Mar 20, 2026

Interesting. Switching to pwsh eng/run.ps1 build (automatically get the same Microsoft-built bootstrap Go we use in other builds) also resulted in the race install running, getting us this in Patch Build / Build up to 0003-Implement-crypto-internal-backend.patch (pull_request):

We might not actually care if this part of buildability matters, or only the "core" part of the build.

For now, skipping the race build. (This was the old behavior.)

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