Repository navigation
[release/10.0] Backport Helix Job Monitor - #17454
Conversation
- Add Helix job cancellation support via IHelixService - Fix work item failure detection (handle null ExitCode in WorkItemSummary) - Improve AzureDevOps rate limit handling to apply delays correctly - Fix test result file collection and post command directory handling - Enhance logging: collection URI/team project details, running queue info, and improved test result upload messages - Update documentation to clarify AzDO test run name markers vs tags - Remove unused toolSource parameter from helix-job-monitor template - Properly dispose HttpClient - Tweak Arcade PR pipeline step names and timeouts
…RL+C / SIGTERM) (#16877) Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: mmitche <[email protected]> Co-authored-by: Přemek Vysoký <[email protected]>
Co-authored-by: Copilot <[email protected]>
…k-item outcomes don't overwrite each other (#16938)
…ut/cancellation (#16878) Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: mmitche <[email protected]> Co-authored-by: Alexander Köplinger <[email protected]> Co-authored-by: Matt Mitchell <[email protected]>
… and remove log emojis (#16952) Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Premek Vysoky <[email protected]>
#16963) Co-authored-by: Copilot <[email protected]> Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
…ain refactor merge (#16973) Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Michael Simons <[email protected]>
Co-authored-by: Copilot <[email protected]>
…t for upload drain (#17019) Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot <[email protected]> Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]> Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…to Helix 404) (#17130) Co-authored-by: Copilot <[email protected]> Co-authored-by: Copilot Autofix powered by AI <[email protected]>
|
@copilot fix the proble mdescribed in #17454 (comment) |
…ide in RemoteExecutor Co-authored-by: premun <[email protected]>
…r consistency Co-authored-by: premun <[email protected]>
Fixed in 583d5ac: added |
There was a problem hiding this comment.
🟡 Changes recommended
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (2)
src/Microsoft.DotNet.Helix/JobMonitor/Services/HelixService.cs:240
- Job.DetailsAsync is invoked without the provided cancellationToken, preventing prompt cancellation during shutdown/timeout while resubmitting work items.
src/Microsoft.DotNet.Helix/JobMonitor/Services/HelixService.cs:195 - ListWorkItemsAsync accepts a cancellationToken but doesn't pass it to Helix WorkItem.ListAsync, so the request won't be cancelable during monitor shutdown/timeout.
- Files reviewed: 102/105 changed files
- Comments generated: 1
- Review effort level: Lite
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
Review details
Suppressed comments (3)
Previously missed (3) — in code that hasn't changed since the last review.
src/Microsoft.DotNet.Helix/JobMonitor/WorkItemExtensions.cs:18
IsFaileduses the lifted nullable comparisonworkItem.ExitCode != 0. WhenExitCodeis null this evaluates to true, so a work item with no exit code can be treated as failed even if itsStateisFinished. This can skew pass/fail counts and retry selection.
Consider explicitly checking HasValue/Value for the non-zero-exit-code case and using a case-insensitive state comparison.
src/Microsoft.DotNet.Helix/JobSender/JobDefinition.cs:263
- This hardcoded Teams URL includes tenant/group identifiers and points to an internal channel that most repo consumers cannot access. Embedding this in build output can also unintentionally disclose internal routing details.
Consider removing the URL from the product or making it opt-in/configurable (e.g., empty by default on public builds).
src/Microsoft.DotNet.Helix/JobSender/JobDefinition.cs:312
- Even if the link is retained, logging it unconditionally can be noisy and (if the URL is internal) unhelpful for most users. Gate this log line on the URL being set and avoid referencing an internal-only channel name in the message.
- Files reviewed: 102/105 changed files
- Comments generated: 0 new
- Review effort level: Lite
There was a problem hiding this comment.
🟡 Changes recommended
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (4)
Previously missed (1) — in code that hasn't changed since the last review.
src/Microsoft.DotNet.Helix/JobSender/HelixApiExtensions.cs:33
- The new two-callback
SendAsyncextension drops logging entirely for non-JobDefinitionimplementations whenlogis null butqueueStatsLogis provided, because it always delegates using onlylog. This can unintentionally suppress all logs for legacy/customIJobDefinitionimplementations.
src/Microsoft.DotNet.Helix/Client/CSharp/generated-code/Aggregate.cs:639
- This endpoint appends
PropertiesusingClient.Serialize(properties), which does not match the dictionary-style query encoding required for Helix property filters (Properties[key]=value). As a result, property-based filtering will not work correctly here.
if (properties != default(IImmutableDictionary<string, string>))
{
_url.AppendQuery("Properties", Client.Serialize(properties));
}
src/Microsoft.DotNet.Helix/Client/CSharp/generated-code/Aggregate.cs:887
propertiesis being appended viaClient.Serialize(properties)instead of the dictionary-based query encoding (Properties[key]=value). This likely results in an unusable filter on the service side.
if (properties != default(IImmutableDictionary<string, string>))
{
_url.AppendQuery("Properties", Client.Serialize(properties));
}
src/Microsoft.DotNet.Helix/Client/CSharp/generated-code/Aggregate.cs:1069
- The
Propertiesquery parameter is being added as a serialized blob (Client.Serialize(properties)) instead of the expected dictionary query format (Properties[key]=value). This will prevent property filtering from working for this call.
if (properties != default(IImmutableDictionary<string, string>))
{
_url.AppendQuery("Properties", Client.Serialize(properties));
}
- Files reviewed: 102/105 changed files
- Comments generated: 3
- Review effort level: Lite
| if (properties != default(IImmutableDictionary<string, string>)) | ||
| { | ||
| _url.AppendQuery("Properties", Client.Serialize(properties)); | ||
| } |
| <!-- Use the standalone Helix Job Monitor pipeline job to publish test results, | ||
| instead of the in-build Python reporter. The corresponding monitor job is | ||
| configured in the Arcade pipeline YAML. --> | ||
| <EnableHelixJobMonitor>true</EnableHelixJobMonitor> | ||
|
|
||
| <EnableShowHelixQueueStats>true</EnableShowHelixQueueStats> |
| <PropertyGroup> | ||
| <HelixType>test/product/</HelixType> | ||
| <TestRunNamePrefix>$(AGENT_JOBNAME)</TestRunNamePrefix> | ||
| <IncludeXHarnessCli>true</IncludeXHarnessCli> | ||
| <EnableAzurePipelinesReporter>true</EnableAzurePipelinesReporter> | ||
| <HelixBaseUri>https://helix.dot.net</HelixBaseUri> | ||
| <EnableHelixJobMonitor>true</EnableHelixJobMonitor> | ||
| </PropertyGroup> |
There was a problem hiding this comment.
🟡 Changes recommended
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (6)
Previously missed (2) — in code that hasn't changed since the last review.
tests/XHarness.Tests.Common.props:20
EnableHelixJobMonitoris set unconditionally, but this props file explicitly supports non-CI local runs (see theAGENT_JOBNAMEcondition below). With the monitor enabled, Helix SDK overridesWaitForWorkItemCompletionto false, so local runs will submit Helix jobs and exit without waiting or publishing results.
Consider enabling the monitor only when running under Azure Pipelines (e.g., when $(AGENT_JOBNAME) is set) so local runs preserve the legacy inline behavior.
src/Microsoft.DotNet.Helix/Sdk/Readme.md:193
- The documentation references the tool package id as
microsoft.dotnet.helix.jobmonitor, but the pipeline template defaults toMicrosoft.DotNet.Helix.JobMonitorand the project name (and thus default NuGet package id) isMicrosoft.DotNet.Helix.JobMonitor. For clarity and copy/paste correctness, align the doc's package id with the shipped id used by the templates.
This issue also appears in the following locations of the same file:
- line 195
- line 203
- line 212
tests/UnitTests.proj:24
EnableHelixJobMonitoris set totrueunconditionally. For local runs (whereAGENT_JOBNAMEis typically empty), this causes Helix submission to stop waiting for completion (viaWaitForWorkItemCompletion=false), which makestests/UnitTests.projbehave like a submit-only target when run locally.
If the intent is to use the monitor only in CI, gate this property on $(AGENT_JOBNAME) (or another CI-specific signal) so local runs still wait/publish inline.
src/Microsoft.DotNet.Helix/Sdk/Readme.md:200
- The
darc get-assetexample uses the lower-cased package id. If users copy/paste this alongside the pipeline templates (which default toMicrosoft.DotNet.Helix.JobMonitor), it’s confusing. Consider using the same id consistently throughout this section.
src/Microsoft.DotNet.Helix/Sdk/Readme.md:210 - The
darc add-dependencyexample should use the same package/tool name as the previous steps (Microsoft.DotNet.Helix.JobMonitor) to stay consistent with the shipped package id and pipeline defaults.
src/Microsoft.DotNet.Helix/Sdk/Readme.md:220 - The
.config/dotnet-tools.jsonsnippet should use the same package id key as the rest of the section (Microsoft.DotNet.Helix.JobMonitor) so consumers can copy/paste it without having to reconcile casing/naming differences.
- Files reviewed: 102/105 changed files
- Comments generated: 1
- Review effort level: Lite
| internal static class WorkItemExtensions | ||
| { | ||
| extension(WorkItemSummary workItem) | ||
| { | ||
| /// <summary> | ||
| /// A Helix work item is considered failed if its exit code is non-zero | ||
| /// or its state is not the terminal success state ("Finished"). |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Backports the complete Helix Job Monitor feature from main to release/10.0, including the C# monitor implementation, Helix SDK integration, generated client support, Azure Pipelines templates, documentation, and tests. Release-branch adaptations preserve existing public APIs and .NET Framework support. Validated with the targeted Helix SDK test suite and a net472 JobSender build.