Skip to content

Fix reproducibility pipeline creating a single shared PR for both jobs - #7632

Merged
mthalman merged 1 commit into
dotnet:mainfrom
mthalman:dev/mthalman/reproducibility-pr-uniqueness
Jul 9, 2026
Merged

mthalman merged 1 commit into
dotnet:mainfrom
mthalman:dev/mthalman/reproducibility-pr-uniqueness

Conversation

@mthalman

@mthalman mthalman commented Jul 9, 2026

Copy link
Copy Markdown
Member

The reproducibility Compare stage runs two PR-publishing jobs (SourceBuilt and Msft). Both invoked CreateBaselineUpdatePR with the same target branch, so it produced an identical head branch and the jobs collided on one PR instead of two.

Add an optional --identifier discriminator that is folded into the generated head branch name so each job gets a distinct branch and PR. When no identifier is supplied the branch name is unchanged, so the sdk and license pipelines' existing PRs are unaffected.

The reproducibility Compare stage runs two PR-publishing jobs (SourceBuilt and
Msft). Both invoked CreateBaselineUpdatePR with pipeline=reproducibility and the
same target branch, so BuildHeadBranchName produced an identical head branch and
the jobs collided on one PR instead of two.

Add an optional --identifier discriminator that is folded into the generated head
branch name (and its hash) and thread it through the pipeline templates, passing
the build type (SourceBuilt/Msft) so each job gets a distinct branch and PR. When
no identifier is supplied the branch name and hash input are unchanged, so the
sdk and license pipelines' existing PRs are unaffected.

Co-authored-by: Copilot App <[email protected]>
Copilot AI review requested due to automatic review settings July 9, 2026 14:49
@mthalman
mthalman requested review from a team as code owners July 9, 2026 14:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the VMR’s baseline-update PR publishing tool and pipeline templates to prevent collisions when multiple jobs in the same pipeline target the same branch (specifically in the reproducibility Compare stage). It introduces an optional identifier that’s incorporated into the deterministic head-branch naming, ensuring each job publishes to a distinct PR.

Changes:

  • Add a --identifier CLI option to CreateBaselineUpdatePR and plumb it through to PR creation.
  • Include the identifier in the generated PR head branch name (while preserving the historical branch name when no identifier is provided).
  • Extend the baseline-update pipeline templates to pass an optional identifier, and set it for reproducibility jobs using buildType.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
eng/tools/CreateBaselineUpdatePR/Program.cs Adds the --identifier option and passes it into PRCreator.
eng/tools/CreateBaselineUpdatePR/PRCreator.cs Incorporates the identifier into deterministic head branch naming for distinct PRs per job.
eng/pipelines/templates/steps/run-baseline-update-pr-tool.yml Adds an optional identifier parameter and conditionally forwards --identifier to the tool.
eng/pipelines/templates/steps/create-baseline-update-pr.yml Adds and forwards the identifier parameter to the runner template for both GH and AzDO paths.
eng/pipelines/templates/jobs/reproducibility-test.yml Supplies identifier: ${{ parameters.buildType }} so SourceBuilt/Msft jobs publish distinct PRs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mthalman
mthalman enabled auto-merge (squash) July 9, 2026 17:31
@mthalman
mthalman merged commit 13b8b75 into dotnet:main Jul 9, 2026
11 checks passed
@mthalman
mthalman deleted the dev/mthalman/reproducibility-pr-uniqueness branch July 9, 2026 19:16
@mthalman

mthalman commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

/backport to release/10.0.1xx

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Started backporting to release/10.0.1xx (link to workflow run)

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@mthalman backporting to release/10.0.1xx failed, the patch most likely resulted in conflicts. Please backport manually!

git am output
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Fix reproducibility pipeline creating a single shared PR for both jobs
Using index info to reconstruct a base tree...
A	eng/pipelines/templates/jobs/reproducibility-test.yml
M	eng/pipelines/templates/steps/create-baseline-update-pr.yml
M	eng/tools/CreateBaselineUpdatePR/PRCreator.cs
M	eng/tools/CreateBaselineUpdatePR/Program.cs
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): eng/pipelines/templates/jobs/reproducibility-test.yml deleted in HEAD and modified in Fix reproducibility pipeline creating a single shared PR for both jobs.  Version Fix reproducibility pipeline creating a single shared PR for both jobs of eng/pipelines/templates/jobs/reproducibility-test.yml left in tree.
Auto-merging eng/pipelines/templates/steps/create-baseline-update-pr.yml
Auto-merging eng/tools/CreateBaselineUpdatePR/PRCreator.cs
Auto-merging eng/tools/CreateBaselineUpdatePR/Program.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Fix reproducibility pipeline creating a single shared PR for both jobs
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

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.

3 participants