Skip to content

Default restore to true in sdk-task scripts - #14354

Merged
ViktorHofer merged 1 commit into
dotnet:mainfrom
ViktorHofer:viktorhofer/sdk-task-default-restore
Jul 14, 2026
Merged

ViktorHofer merged 1 commit into
dotnet:mainfrom
ViktorHofer:viktorhofer/sdk-task-default-restore

Conversation

@ViktorHofer

@ViktorHofer ViktorHofer commented Jul 14, 2026 •

Copy link
Copy Markdown
Member

Upstreamed: This change is already submitted upstream to Arcade in dotnet/arcade#17116. Since eng/common is mirrored from dotnet/arcade, this PR applies the same fix directly to msbuild so we don't have to wait for the Arcade flow.

Summary

sdk-task.ps1/sdk-task.sh defaulted restore to false, diverging from tools.ps1's default of true (the .ps1 shadowed the tools.ps1 default via its own [switch] $restore, which is always false unless passed).

This regressed upstream in dotnet/arcade@ea5fa16, which flipped the default from restoring-by-default to not restoring. That same commit reworked the SDK tasks to use PackageReference items, which means the tasks now need a restore in certain cases - so defaulting restore to false leaves those consumers broken.

This changes both scripts to default restore to true and adds a -norestore/--norestore opt-out.

Behavior

  • restore now defaults to true in both scripts.
  • New -norestore / --norestore flag skips the restore step.
  • -restore / --restore is retained as a legacy no-op so existing consumers that pass it don't break.

sdk-task.ps1/.sh previously defaulted restore to false, diverging from tools.ps1's default of true (which the .ps1 shadowed via its own [switch]). Default restore to true in both scripts and add a -norestore/--norestore opt-out. The -restore/--restore flag is retained as a legacy no-op so existing consumers that pass it don't break.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 9e366d06-83fa-487b-898d-dec74a8bea17
Copilot AI review requested due to automatic review settings July 14, 2026 12:39
@ViktorHofer
ViktorHofer requested a review from a team as a code owner July 14, 2026 12:39
@ViktorHofer
ViktorHofer temporarily deployed to copilot-pat-pool July 14, 2026 12:39 — with GitHub Actions Inactive
@ViktorHofer
ViktorHofer temporarily deployed to copilot-pat-pool July 14, 2026 12:39 — with GitHub Actions Inactive
@ViktorHofer
ViktorHofer temporarily deployed to copilot-pat-pool July 14, 2026 12:42 — with GitHub Actions Inactive

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 aligns eng/common/sdk-task.ps1 and eng/common/sdk-task.sh with Arcade’s typical behavior by defaulting restore to on, while providing a -norestore/--norestore opt-out and keeping -restore/--restore as a legacy no-op for compatibility.

Changes:

  • Default restore behavior changed to true in both scripts.
  • Added -norestore / --norestore to skip the restore step.
  • Retained -restore / --restore as a backward-compatible no-op.
Show a summary per file
File Description
eng/common/sdk-task.sh Default restore to true; add --norestore; update usage text.
eng/common/sdk-task.ps1 Default restore behavior to run unless -norestore; update usage text and parameter set.

Copilot's findings

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

Comment thread eng/common/sdk-task.sh Resolved
Comment thread eng/common/sdk-task.sh Resolved
Comment thread eng/common/sdk-task.sh Resolved
Comment thread eng/common/sdk-task.ps1 Resolved
Comment thread eng/common/sdk-task.ps1 Resolved

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — da71928b Deployed Jul 14, 2026 by ViktorHofer via conclusion #452
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