Repository navigation
Conversation
|
@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. |
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
|
So looks like we were using the job name only as a key in the dictionary, while if you sent work to two queues from one job, it would share the same dictionary key |
…write each other in a state dictionary
|
I pushed too many fixes in this unrelated PR. I will ask AI to split them into their own smaller PRs, this is getting out of hand, apologies |
| _logger.LogError("##vso[task.logissue type=error]❌ Helix Job: {JobName} Work Item: '{WorkItemName}' Failed: {State} Console: {ConsoleOutputUri}", | ||
| helixJob.DisplayName, | ||
| FormatWorkItemState(workItem), | ||
| Environment.NewLine, | ||
| GetConsoleOutputText(workItem.ConsoleOutputUri)); | ||
| workItem.Name, | ||
| state, | ||
| consoleOutputText); |
| 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)); | ||
| message.Contains("##vso[task.logissue type=error]❌ Helix Job: helix-linux Work Item: 'wi-fail' Failed: Finished, exit code 1 Console: https://helix.example/wi-fail/console", StringComparison.Ordinal)); | ||
| Assert.Contains(logger.ErrorMessages, message => | ||
| message.Contains("##vso[task.logissue type=error]", StringComparison.Ordinal) | ||
| && message.Contains("❌ Helix Job: helix-linux Work Item: 'wi-fail' Failed: Finished, exit code 1 Console: https://helix.example/wi-fail/console", StringComparison.Ordinal)); |
| // and are already unwinding. We only observe them best-effort: if this is the | ||
| // self-timeout case the monitor is relaunched and re-uploads any results that | ||
| // didn't make it, so we must not block shutdown waiting on them, nor let their | ||
| // cancellation/faults escape and skip the cleanup above. | ||
| await ObservePendingTestResultUploadsAsync(); |

Failed Helix work item details were previously easy to miss in Azure DevOps timeline issue surfacing. This change 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
LogFailedWorkItemConsoleLinks(...)where the method was left in a broken/non-compiling state._logger.LogError(...)emission in the sametask.logissueformat expected by timeline surfacing.Code changes
/src/Microsoft.DotNet.Helix/JobMonitor/JobMonitorRunner.csLogFailedWorkItemConsoleLinks(...)writes failed work item messages tostderrusing:##vso[task.logissue type=error]❌ Work item ...##vso[task.logissue type=error]Console: ..._logger.LogError(...)with an explicit##vso[task.logissue type=error]...{nl}##vso[task.logissue type=error]Console: ...template and structured arguments (WorkItemName,JobName,State,ConsoleOutputUri)./src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/JobMonitorRunnerTests.csCompletedHelixJob_LogsFailedWorkItemConsoleLinksvalidates 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