Skip to content

Skip VMR user change validation for dotnet-bot PRs#4538

Merged
ellahathaway merged 2 commits intomainfrom
copilot/update-vmr-validation-script
Jan 30, 2026
Merged

Skip VMR user change validation for dotnet-bot PRs#4538
ellahathaway merged 2 commits intomainfrom
copilot/update-vmr-validation-script

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 29, 2026

The ValidateUserChanges pipeline stage was blocking automated PRs from dotnet-bot, treating them as user changes requiring validation.

Changes

  • Added Build.RequestedFor check to exclude dotnet-bot from the ValidateUserChanges stage condition in eng/pipelines/pr.yml
condition: and(
    eq(variables['isPRTrigger'], 'true'),
    and(
        not(startsWith(variables['System.PullRequest.SourceBranch'], 'refs/heads/darc-')),
        not(startsWith(variables['System.PullRequest.SourceBranch'], 'darc-')),
        not(eq(variables['Build.RequestedFor'], 'dotnet-bot'))
    )
)

This follows the existing pattern where DARC branches skip validation, extending it to all dotnet-bot automated changes.

Original prompt

This section details on the original issue you should resolve

<issue_title>Update VMR Run Validation Script to allow changes from dotnet-bot</issue_title>
<issue_description>See #4515

The "Validate user changes in VMR Run Validation Script" job currently does not allow changes from the dotnet-bot account. This update is needed to accept and validate changes pushed or submitted by dotnet-bot, so automation and bot-driven infrastructure can run as expected.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: ellahathaway <67609881+ellahathaway@users.noreply.github.com>
Copilot AI changed the title [WIP] Update VMR Run Validation Script to accept dotnet-bot changes Skip VMR user change validation for dotnet-bot PRs Jan 29, 2026
Copilot AI requested a review from ellahathaway January 29, 2026 22:26
@ellahathaway ellahathaway marked this pull request as ready for review January 30, 2026 17:39
@ellahathaway ellahathaway requested review from a team as code owners January 30, 2026 17:39
Copy link
Copy Markdown
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

This PR modifies the ValidateUserChanges pipeline stage to skip validation for pull requests created by dotnet-bot, preventing automated PRs from being incorrectly blocked as user changes requiring validation.

Changes:

  • Added Build.RequestedFor check to exclude dotnet-bot from ValidateUserChanges stage validation in the PR pipeline
  • Follows the existing pattern of skipping validation for DARC automated branches

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

not(startsWith(variables['System.PullRequest.SourceBranch'], 'refs/heads/darc-')),
not(startsWith(variables['System.PullRequest.SourceBranch'], 'darc-'))
not(startsWith(variables['System.PullRequest.SourceBranch'], 'darc-')),
not(eq(variables['Build.RequestedFor'], 'dotnet-bot'))
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

Consider adding a pipeline run with logging to verify that Build.RequestedFor equals exactly "dotnet-bot" for bot-created PRs. Azure Pipelines populates this variable with the GitHub user's display name, which should be "dotnet-bot" for the bot account, but it's worth confirming. If this check doesn't work as expected, alternative options include: checking Build.RequestedForEmail (e.g., ends with @users.noreply.github.com), or combining this with additional branch name patterns that dotnet-bot uses.

Copilot uses AI. Check for mistakes.
@ellahathaway ellahathaway merged commit ed34c37 into main Jan 30, 2026
17 checks passed
@ellahathaway ellahathaway deleted the copilot/update-vmr-validation-script branch January 30, 2026 21:07
@ellahathaway
Copy link
Copy Markdown
Member

/backport to release/10.0.1xx

@github-actions
Copy link
Copy Markdown
Contributor

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

@github-actions
Copy link
Copy Markdown
Contributor

@ellahathaway 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

Patch format detection failed.
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

@ellahathaway
Copy link
Copy Markdown
Member

/backport to release/10.0.1xx

@ellahathaway
Copy link
Copy Markdown
Member

/backport to release/10.0.2xx

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 4, 2026

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

@ellahathaway
Copy link
Copy Markdown
Member

/backport to release/10.0.3xx

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 4, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 4, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 4, 2026

@ellahathaway 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

Creating an empty commit: Initial plan
Applying: Update ValidateUserChanges stage to skip dotnet-bot PRs
Using index info to reconstruct a base tree...
M	eng/pipelines/pr.yml
Falling back to patching base and 3-way merge...
Auto-merging eng/pipelines/pr.yml
CONFLICT (content): Merge conflict in eng/pipelines/pr.yml
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 0002 Update ValidateUserChanges stage to skip dotnet-bot PRs
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 4, 2026

@ellahathaway backporting to release/10.0.3xx 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

Creating an empty commit: Initial plan
Applying: Update ValidateUserChanges stage to skip dotnet-bot PRs
Using index info to reconstruct a base tree...
M	eng/pipelines/pr.yml
Falling back to patching base and 3-way merge...
Auto-merging eng/pipelines/pr.yml
CONFLICT (content): Merge conflict in eng/pipelines/pr.yml
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 0002 Update ValidateUserChanges stage to skip dotnet-bot PRs
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 4, 2026

@ellahathaway backporting to release/10.0.2xx 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

Creating an empty commit: Initial plan
Applying: Update ValidateUserChanges stage to skip dotnet-bot PRs
Using index info to reconstruct a base tree...
M	eng/pipelines/pr.yml
Falling back to patching base and 3-way merge...
Auto-merging eng/pipelines/pr.yml
CONFLICT (content): Merge conflict in eng/pipelines/pr.yml
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 0002 Update ValidateUserChanges stage to skip dotnet-bot PRs
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.

Update VMR Run Validation Script to allow changes from dotnet-bot

5 participants