JobMonitor: emit failed work item errors as Azure DevOps task.logissue entries#16879
JobMonitor: emit failed work item errors as Azure DevOps task.logissue entries#16879Copilot wants to merge 4 commits into
Conversation
Agent-Logs-Url: https://github.com/dotnet/arcade/sessions/bfd5dce1-f05b-456b-a8f2-c54b074bd9ba Co-authored-by: mmitche <8725170+mmitche@users.noreply.github.com>
|
@copilot the timeline still doesn't have the error about the failed work item. Maybe you need to use the |
There was a problem hiding this comment.
Pull request overview
This PR improves Helix JobMonitor diagnostics in Azure DevOps by emitting failed work item console-link details at error level so they surface in timeline error reporting, rather than being easy-to-miss informational output.
Changes:
- Promoted per-failed-work-item console-link logging from
LogInformationtoLogError. - Updated the test logger to capture error-level messages and added an assertion verifying the failed work item message is logged as an error.
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/JobMonitorRunner.cs | Logs failed work item console links via LogError to improve visibility in Azure DevOps timeline error surfacing. |
| src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/JobMonitorRunnerTests.cs | Extends the recording logger to track error messages and asserts the failure console-link output is emitted at error level. |
Addressed in 8ab2acf. Failed work items now emit explicit Azure DevOps error lines using |
| Assert.Contains(logger.Messages, message => | ||
| message.Contains($"Work item 'wi-fail' in job 'helix-linux' failed (Finished, exit code 1).{Environment.NewLine}Console: https://helix.example/wi-fail/console", StringComparison.Ordinal)); | ||
| Assert.Contains(logger.ErrorMessages, message => | ||
| message.Contains($"Work item 'wi-fail' in job 'helix-linux' failed (Finished, exit code 1).{Environment.NewLine}Console: https://helix.example/wi-fail/console", StringComparison.Ordinal)); |
There was a problem hiding this comment.
@copilot Validate that the error messages contain: '##vso[task.logissue type=error]'
|
When writing the error, you need to put in '##vso[task.logissue type=error]'. to get it to show in the timeline. |
Failed Helix work item details were previously easy to miss in Azure DevOps timeline issue surfacing. This change now emits explicit Azure DevOps error issue commands (
##vso[task.logissue type=error]) for failed work items (including console links), while preserving error-level logging.To double check:
Problem addressed
Code changes
/src/Microsoft.DotNet.Helix/JobMonitor/JobMonitorRunner.csLogFailedWorkItemConsoleLinks(...)now writes failed work item messages tostderrusing:##vso[task.logissue type=error]❌ Work item ...##vso[task.logissue type=error]Console: ...LogError(...)output aligned with the same format./src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/JobMonitorRunnerTests.csCompletedHelixJob_LogsFailedWorkItemConsoleLinksto validate error messages contain##vso[task.logissue type=error].Example
The right tests are in and the right validation has happened. Guidance: https://github.com/dotnet/arcade/blob/main/Documentation/Validation.md