Skip to content

Allow submodule changes when reseting submodules - #7940

Merged
dkurepa merged 1 commit into
dotnet:mainfrom
dkurepa:dkurepa/AllowSubmoduleResets
Aug 10, 2026
Merged

dkurepa merged 1 commit into
dotnet:mainfrom
dkurepa:dkurepa/AllowSubmoduleResets

Conversation

@dkurepa

@dkurepa dkurepa commented Jul 24, 2026

Copy link
Copy Markdown
Member

@dkurepa
dkurepa requested review from a team as code owners July 24, 2026 10:18
Copilot AI review requested due to automatic review settings July 24, 2026 10:18
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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

Updates the ChangeValidation tool so submodule-directory edits are permitted when they correspond to an actual submodule “reset” (i.e., the relevant entry in src/source-manifest.json changed compared to the PR merge-base), while still blocking submodule additions/removals and other unsupported edits.

Changes:

  • Compute and carry the PR merge-base commit through PrInfo so validations can compare “base vs HEAD” reliably.
  • Stop treating src/source-manifest.json as a blanket-protected tooling file so it can change as part of submodule resets.
  • Rework SubmoduleValidation to allow submodule file changes only when the corresponding manifest entry changed, and to reject adding/removing submodules.

Reviewed changes

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

File Description
eng/tools/ChangeValidation/Validation.cs Computes merge-base and includes it in PrInfo for downstream validation.
eng/tools/ChangeValidation/ToolingFilesValidation.cs Removes src/source-manifest.json from “always disallowed” tooling file patterns.
eng/tools/ChangeValidation/SubmoduleValidation.cs Implements merge-base vs HEAD manifest comparison to allow reset-associated submodule changes and disallow submodule add/remove.
eng/tools/ChangeValidation/PrInfo.cs Extends PrInfo to include the merge-base commit SHA.
Comments suppressed due to low confidence (1)

eng/tools/ChangeValidation/SubmoduleValidation.cs:8

  • Several using directives here appear unused after the refactor (e.g., System.Text, Microsoft.Extensions.Logging*, Microsoft.DotNet.DarcLib*). Unused usings can generate warnings and make the file harder to maintain; please remove the ones that are no longer needed.
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Extensions.FileSystemGlobbing;
using Microsoft.Extensions.FileSystemGlobbing.Abstractions;

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

@dkurepa
dkurepa requested a review from premun July 31, 2026 12:59
@dkurepa

dkurepa commented Aug 10, 2026

Copy link
Copy Markdown
Member Author

@dotnet/source-build could I get an approval please?

@dkurepa
dkurepa merged commit c95ca63 into dotnet:main Aug 10, 2026
11 checks passed
@premun

premun commented Aug 10, 2026

Copy link
Copy Markdown
Member

@dkurepa this needs to get backported

@dkurepa

dkurepa commented Aug 10, 2026

Copy link
Copy Markdown
Member Author

@dkurepa this needs to get backported

yup, was doing it locally, but the bot should work too, gonna try it

@dkurepa

dkurepa commented Aug 10, 2026

Copy link
Copy Markdown
Member Author

/backport to release/10.0.1xx

@github-actions

Copy link
Copy Markdown
Contributor

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

@dkurepa

dkurepa commented Aug 11, 2026

Copy link
Copy Markdown
Member Author

/backport to release/10.0.3xx

@github-actions

Copy link
Copy Markdown
Contributor

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

@dkurepa

dkurepa commented Aug 11, 2026

Copy link
Copy Markdown
Member Author

/backport to release/10.0.4xx

@github-actions

Copy link
Copy Markdown
Contributor

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

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.

4 participants