dotnet / dotnet/arcade-services
Darc commands fail with UriFormatException unless I specify `--bar-uri`
- Dominant language
- C#
- Stars
- 86
- Forks
- 86
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 35
Description
- [ ] This issue is blocking
- [ ] This issue is causing unreasonable pain
This repro is on `Microsoft.DotNet.Darc 1.1.0-beta.26374.1+ea4c017203f17b7bbad86bfd19f61e4d34284dc2` but I have tried older versions back to `Microsoft.DotNet.Darc 1.1.0-beta.26359.1` and it repros there as well.
` darc get-channels`
> Unhandled exception. System.UriFormatException: Invalid URI: The URI is empty.
> at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
> at System.Uri..ctor(String uriString)
> at Microsoft.DotNet.ProductConstructionService.Client.PcsApiFactory.GetAnonymous() in /_/src/ProductConstructionService/Microsoft.DotNet.ProductConstructionService.Client/PcsApiFactory.cs:line 43
> at Microsoft.DotNet.Darc.DarcVersionValidator.ValidateAsync(String baseUri, ILogger logger) in /_/src/Microsoft.DotNet.Darc/Darc/DarcVersionValidator.cs:line 29
> at Microsoft.DotNet.Darc.Program.<>c.<b__0_1>d.MoveNext() in /_/src/Microsoft.DotNet.Darc/Darc/Program.cs:line 58
> --- End of stack trace from previous location ---
> at Microsoft.DotNet.Darc.Program.Main(String[] args) in /_/src/Microsoft.DotNet.Darc/Darc/Program.cs:line 48
> at Microsoft.DotNet.Darc.Program.(String[] args)
Providing `--bar-uri` resolves the issue. (eg, `darc get-channels --bar-uri https://maestro.dot.net/`)
I have to provide this on all commands, even `darc authenticate`.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with Microsoft.DotNet.Darc/Darc/Program.cs and Microsoft.DotNet.ProductConstructionService.Client/PcsApiFactory.cs, following the validation path shown in the stack trace. Reproduce `darc get-channels` and `darc authenticate` without `--bar-uri`; done means these commands no longer throw UriFormatException when the option is omitted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100