flowey: add hint if dotnet restore fails#3139
flowey: add hint if dotnet restore fails#3139benhillis wants to merge 1 commit intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
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 restoreexecution to emit an additional hint on failure for the Local backend. - Return the original restore error after emitting the hint.
| 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."); |
There was a problem hiding this comment.
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.
| 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." | |
| ); | |
| } |
2e4bdc6 to
b44c0e9
Compare
This change adds some more actionable steps on how to resolve dotnet restore issues.