microsoft / microsoft/CmdPalAzureExtension
Saving a pipeline search fails silently for legacy visualstudio.com URLs (AzureUri.IsDefinition rejects non-dev.azure.com host)
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6
- Forks
- 6
- Avg merge
- 40m
- Merged PRs (30d)
- 1
Description
Summary
Saving a pipeline search fails silently when the pipeline URL uses the legacy *.visualstudio.com host format. The equivalent dev.azure.com URL works. The UI gives no clear error, so it looks like the save succeeded when nothing was persisted.
Impact — silent failure with a misleading "success" ⚠️
This currently fails silently: the UI looks like the save succeeded, but it saves nothing. After clicking Save pipeline, the command bar shows a generic "Successful" indication, the form closes as if it worked, yet:
- the pipeline does not appear in the Saved Pipeline Searches list, and
- nothing is written to the datastore (the
DefinitionSearchtable stays empty).
Because there is no visible error, the user reasonably believes the save worked and only later notices the entry was never created. This misleading feedback is arguably worse than the validation restriction itself.
Repro
- Command Palette → Azure Extension → Saved Pipeline Searches → Add pipeline.
- Enter a legacy-host pipeline URL, e.g.
https://microsoft.visualstudio.com/Dart/_build?definitionId=76541, give it a name, and click Save pipeline. - The command bar shows a generic "Successful", but the pipeline is not added to the list and nothing is written to the datastore.
Using the dev.azure.com form of the same pipeline saves correctly:
https://dev.azure.com/microsoft/Dart/_build?definitionId=76541
Root cause
AzureUri.IsDefinition requires the host to be exactly dev.azure.com:
// AzureExtension/Client/AzureUri.cs — InitializeIsDefinition()
if (!Uri.Host.Equals("dev.azure.com", StringComparison.OrdinalIgnoreCase))
{
return false;
}
For a legacy *.visualstudio.com URL, IsValid is true but IsDefinition returns false, so AzureClientHelpers.GetInfo returns InvalidDefinitionUri and SaveSearchForm.SubmitForm rejects the save before persisting anything.
The reason the failure is silent (looks successful): on validation failure SaveSearchForm.SubmitForm returns CommandResult.KeepOpen() — a normal result — so the Command Palette host still shows its generic "Successful" instead of an error.
This is inconsistent with the query and repository validators (IsQuery, IsRepository, IsTempQuery), which do not restrict the host and therefore accept both dev.azure.com and legacy *.visualstudio.com formats. There is also an existing unit test that intentionally asserts the legacy host is rejected for definitions (AzureUri_IsDefinition_Validation), so this is current-by-design behavior rather than an accidental regression.
Empirically confirmed:
| URL | IsValid |
IsDefinition |
|---|---|---|
https://microsoft.visualstudio.com/Dart/_build?definitionId=76541 |
true |
false |
https://dev.azure.com/microsoft/Dart/_build?definitionId=76541 |
true |
true |
Suggested fix
- Allow legacy
*.visualstudio.comhosts inAzureUri.IsDefinition, consistent withIsQuery/IsRepository(host validity is already enforced byIsValid). Practically, this means removing thedev.azure.com-only host check inInitializeIsDefinition()and updating theAzureUri_IsDefinition_Validationunit test to expect the legacy host to be accepted. - Fix the silent failure: surface a clear inline/error message when a save is rejected by validation, so the user is not shown a generic "Successful" after nothing was saved.
Notes
- Not caused by the .NET 10 migration — this is pre-existing behavior in
AzureUri. - A candidate change for (1) was prototyped and reverted to keep the .NET 10 PR scoped to the version update; filing this to track the fix on its own merits.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with AzureExtension/Client/AzureUri.cs and InitializeIsDefinition(), then inspect the AzureUri_IsDefinition_Validation unit test. Trace AzureClientHelpers.GetInfo and SaveSearchForm.SubmitForm to understand the rejected-save path. Done means legacy visualstudio.com definitions are handled consistently with other Azure URLs and rejected saves show a clear error instead of a generic success.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 70/100