Skip to content

Add SkipRuntimesInstall property to InstallDotNetCore task and target - #17158

Merged
ViktorHofer merged 4 commits into
mainfrom
ViktorHofer-patch-2
Jul 21, 2026
Merged

ViktorHofer merged 4 commits into
mainfrom
ViktorHofer-patch-2

Conversation

@ViktorHofer

Copy link
Copy Markdown
Member

Copilot AI review requested due to automatic review settings July 21, 2026 06:20
@ViktorHofer
ViktorHofer requested a review from mmitche July 21, 2026 06:22

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

Adds an opt-out switch to the Arcade SDK’s InstallDotNetCore MSBuild task so repos can avoid installing runtimes listed under tools.runtimes in global.json (intended to replace the referenced downstream “hack” usage).

Changes:

  • Introduces a new SkipRuntimesInstall boolean parameter on the InstallDotNetCore task.
  • Gates global.json tools.runtimes processing behind !SkipRuntimesInstall.
Show a summary per file
File Description
src/Microsoft.DotNet.Arcade.Sdk/src/InstallDotNetCore.cs Adds SkipRuntimesInstall and uses it to skip runtime installation based on global.json.

Copilot's findings

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Copilot AI review requested due to automatic review settings July 21, 2026 06:22

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.

Copilot's findings

Comments suppressed due to low confidence (1)

src/Microsoft.DotNet.Arcade.Sdk/src/InstallDotNetCore.cs:66

  • SkipRuntimesInstall changes Execute() behavior, but there is no unit test covering that setting this flag prevents processing/installing tools.runtimes from global.json. Adding a test would help prevent regressions (e.g., ensure runtimes are skipped and VersionsPropsPath isn't required when the flag is true).
                    if (!SkipRuntimesInstall && toolsElement.TryGetProperty("runtimes", out JsonElement dotnetLocalElement))
  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Copilot AI review requested due to automatic review settings July 21, 2026 06:25

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.

Copilot's findings

Comments suppressed due to low confidence (1)

src/Microsoft.DotNet.Arcade.Sdk/src/InstallDotNetCore.cs:67

  • The new SkipRuntimesInstall behavior changes Execute() control flow but isn’t covered by unit tests. There are existing unit tests for this task (InstallDotNetCoreTests.cs), so please add a test that sets SkipRuntimesInstall=true and verifies runtimes in global.json do not trigger dotnet-install invocation (e.g., by using a failing stub script that would cause Execute() to log an error if it were run).
            using (JsonDocument jsonDocument = JsonDocument.Parse(bytes))
            {
                if (jsonDocument.RootElement.TryGetProperty("tools", out JsonElement toolsElement))
                {
                    if (!SkipRuntimesInstall && toolsElement.TryGetProperty("runtimes", out JsonElement dotnetLocalElement))
                    {
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new

Copilot AI review requested due to automatic review settings July 21, 2026 06:28

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.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new

@akoeplinger akoeplinger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM but #14283 was closed/fixes so we should be able to just remove the workaround right?

@ViktorHofer

Copy link
Copy Markdown
Member Author

If you remove the workaround as-is without consuming this change, the VMR would start downloading runtimes in each repo build and the overall build would become significantly slower.

@akoeplinger

Copy link
Copy Markdown
Member

ok so I hear that we actually want to keep removing this, since it's general goodness

@ViktorHofer

ViktorHofer commented Jul 21, 2026 •

Copy link
Copy Markdown
Member Author

Yes, we haven't seen a reason so far to download the extra runtimes inside the VMR. They are only used for repo tests which we don't execute. But by making this conditional someone could if they would want to.

@ViktorHofer
ViktorHofer merged commit 8de33a8 into main Jul 21, 2026
11 checks passed
@ViktorHofer
ViktorHofer deleted the ViktorHofer-patch-2 branch July 21, 2026 08:44
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Jul 23, 2026
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