Skip to content

flowey: add hint if dotnet restore fails#3139

Open
benhillis wants to merge 1 commit intomicrosoft:mainfrom
benhillis:nuget_restore_hint
Open

flowey: add hint if dotnet restore fails#3139
benhillis wants to merge 1 commit intomicrosoft:mainfrom
benhillis:nuget_restore_hint

Conversation

@benhillis
Copy link
Copy Markdown
Member

This change adds some more actionable steps on how to resolve dotnet restore issues.

@benhillis benhillis requested a review from a team as a code owner March 26, 2026 16:22
Copilot AI review requested due to automatic review settings March 26, 2026 16:22
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

Adds a more actionable local-only hint when dotnet restore fails during Flowey’s NuGet package installation, aiming to reduce friction when restoring from authenticated feeds.

Changes:

  • Wrap dotnet restore execution to emit an additional hint on failure for the Local backend.
  • Return the original restore error after emitting the hint.

Comment on lines +208 to +211
log::error!("HINT: NuGet restore failed. You may need to install \
the Azure Artifacts Credential Provider and/or log in with \
`az login`. See the repo's getting started guide for setup \
instructions.");
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

This hint is shown for any dotnet restore failure on the Local backend, but the suggested actions (Azure Artifacts Credential Provider / az login / “see the repo’s getting started guide”) won’t apply in some cases (e.g., no Azure DevOps feeds were detected so get_feed_endpoints_json returned None, or az login failures would have already surfaced earlier). Consider gating this hint on whether the nuget.config actually contains Azure DevOps feeds (or whether feed_endpoints_json is Some), and either update Guide/src/ to include the referenced setup steps or change the message to point to a specific doc/location that actually contains these instructions.

Suggested change
log::error!("HINT: NuGet restore failed. You may need to install \
the Azure Artifacts Credential Provider and/or log in with \
`az login`. See the repo's getting started guide for setup \
instructions.");
if feed_endpoints_json.is_some() {
log::error!(
"HINT: NuGet restore failed while using Azure DevOps feeds. \
You may need to install the Azure Artifacts Credential \
Provider and/or log in with `az login` to refresh your \
credentials."
);
} else {
log::error!(
"HINT: NuGet restore failed. Check the restore output above \
for details and ensure your NuGet feeds are accessible from \
this environment."
);
}

Copilot uses AI. Check for mistakes.
@benhillis benhillis force-pushed the nuget_restore_hint branch from 2e4bdc6 to b44c0e9 Compare March 26, 2026 21:33
@github-actions
Copy link
Copy Markdown

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.

2 participants