Repository navigation
JobMonitor: Fetch test run tags from a different API - #17054
Merged
Merged
Conversation
The previous one does not work, the new one does.
Before we had this:
```
##[error]Helix Job Monitor terminated with an unhandled exception.
System.Net.Http.HttpRequestException: Request to https://vstmr.dev.azure.com/dnceng-public/public/_apis/testresults/runs/40914222/tags?api-version=7.1-preview.1 failed with 405 Method Not Allowed. {"count":1,"value":{"Message":"The requested resource does not support http method 'GET'."}}
at Microsoft.DotNet.Helix.JobMonitor.AzureDevOpsService.<>c__DisplayClass24_0.<<SendForStringAsync>b__0>d.MoveNext() in /_/src/Microsoft.DotNet.Helix/JobMonitor/Services/AzureDevOpsService.cs:line 465
--- End of stack trace from previous location ---
at Microsoft.DotNet.Helix.AzureDevOpsTestPublisher.RetryHelper.RetryAsync[T](Func`1 action, CancellationToken cancellationToken) in /_/src/Microsoft.DotNet.Helix/AzureDevOpsTestPublisher/RetryHelper.cs:line 17
at Microsoft.DotNet.Helix.JobMonitor.AzureDevOpsService.SendForStringAsync(HttpMethod method, String requestUri, JToken body, CancellationToken cancellationToken) in /_/src/Microsoft.DotNet.Helix/JobMonitor/Services/AzureDevOpsService.cs:line 452
at Microsoft.DotNet.Helix.JobMonitor.AzureDevOpsService.SendAsync(HttpMethod method, String requestUri, JToken body, CancellationToken cancellationToken) in /_/src/Microsoft.DotNet.Helix/JobMonitor/Services/AzureDevOpsService.cs:line 443
at Microsoft.DotNet.Helix.JobMonitor.AzureDevOpsService.GetHelixJobNameFromRunTagsAsync(Int32 runId, CancellationToken cancellationToken) in /_/src/Microsoft.DotNet.Helix/JobMonitor/Services/AzureDevOpsService.cs:line 187
at Microsoft.DotNet.Helix.JobMonitor.AzureDevOpsService.GetFailedTestWorkItemsAsync(CancellationToken cancellationToken) in /_/src/Microsoft.DotNet.Helix/JobMonitor/Services/AzureDevOpsService.cs:line 132
at Microsoft.DotNet.Helix.JobMonitor.JobMonitorRunner.ExecuteRetryPassAsync(CancellationToken cancellationToken) in /_/src/Microsoft.DotNet.Helix/JobMonitor/JobMonitorRunner.cs:line 145
at Microsoft.DotNet.Helix.JobMonitor.JobMonitorRunner.RunAsync(CancellationToken cancellationToken) in /_/src/Microsoft.DotNet.Helix/JobMonitor/JobMonitorRunner.cs:line 94
at Microsoft.DotNet.Helix.JobMonitor.Program.Main(String[] args) in /_/src/Microsoft.DotNet.Helix/JobMonitor/Program.cs:line 86
```
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Helix JobMonitor’s Azure DevOps integration to fetch per-test-run tags via the Get Test Run endpoint with includeTags=true, avoiding the /tags sub-resource that returns 405 Method Not Allowed for GET. This aligns the JobMonitor behavior with the working API shape described in the PR.
Changes:
- Switched per-run tag retrieval from
.../testresults/runs/{id}/tagsto.../testresults/runs/{id}?includeTags=true. - Updated JSON parsing to read tags from the
tagsproperty on the TestRun payload. - Adjusted unit tests to mock the new endpoint and response schema.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Microsoft.DotNet.Helix/JobMonitor/Services/AzureDevOpsService.cs | Uses Get-Run (includeTags=true) and parses tags[] inline to recover the Helix job tag without hitting the unsupported /tags GET endpoint. |
| src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/AzureDevOpsServiceTests.cs | Updates request routing and mocked responses to validate the new per-run Get-Run tags flow end-to-end. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
oleksandr-didyk
approved these changes
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous one does not work, the new one does.
New api example: https://vstmr.dev.azure.com/dnceng-public/public/_apis/testresults/runs/40914222?includeTags=true&api-version=7.1-preview.1
Before we had this: