Skip to content

Enable Helix queue stats logging for Arcade unit tests - #17018

Merged
chcosta merged 10 commits into
dotnet:mainfrom
chcosta:dev/chcosta/enable-helix-queue-stats
Jul 7, 2026
Merged

Enable Helix queue stats logging for Arcade unit tests#17018
chcosta merged 10 commits into
dotnet:mainfrom
chcosta:dev/chcosta/enable-helix-queue-stats

Conversation

@chcosta

@chcosta chcosta commented Jun 17, 2026

Copy link
Copy Markdown
Member

Enables the new opt-in Helix queue health summary (added in #16922) for Arcade's own tests/UnitTests.proj.

Adds <EnableShowHelixQueueStats>true</EnableShowHelixQueueStats> so that every Helix job submitted by the Arcade unit-test pipeline logs the queue health summary at submit time. This dogfoods the feature and gives FRs immediate signal on Helix queue conditions when Arcade's own CI submits work.

Depends on #16922 having shipped through Arcade.

Copilot AI review requested due to automatic review settings June 17, 2026 16:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables Helix queue health summary logging for Arcade’s own Helix-submitted unit test jobs by opting in via MSBuild property, so Arcade CI “dogfoods” the feature and emits queue condition signal at job submission time.

Changes:

  • Set EnableShowHelixQueueStats to true in tests/UnitTests.proj so Helix submissions from Arcade unit tests log the queue health summary.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Default CI verbosity is Minimal, which filters out MessageImportance.Normal
messages. When EnableShowHelixQueueStats is opted in, route SendAsync log
output (including the queue-health summary) at High importance so it
survives the default verbosity.
@chcosta

chcosta commented Jun 17, 2026

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@chcosta

chcosta commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@chcosta

chcosta commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Comment thread src/Microsoft.DotNet.Helix/Sdk/SendHelixJob.cs Outdated
chcosta added 2 commits June 22, 2026 18:22
Add WithAzureDevOpsOrganization() and WithAzureDevOpsProject() fluent builder
methods to JobDefinition to allow callers (especially public pipelines) to
specify which Azure DevOps organization/project is requesting queue stats.
These parameters are passed through JobCreationRequest to Helix API.

Fixes: Arcade PR for enabling queue stats support with org/project scoping
Queue names are globally unique across all organizations and projects, so
the Helix API does not need org/project context to return stats. These
parameters only serve as optional audit context on the public Helix Observer
endpoint for external callers to declare their scope.

Reverts the org/project fluent builder methods since:
1. They are unused in the codebase
2. Queue stats are queried and returned by queue name globally
3. Org/project scoping is only relevant on the public HTTP endpoint
@chcosta

chcosta commented Jun 23, 2026

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@chcosta

chcosta commented Jun 23, 2026

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@chcosta

chcosta commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Copilot AI review requested due to automatic review settings June 24, 2026 18:23
@chcosta

chcosta commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

The service issues seem to be resolved now and this is ready for review. queue wait time estimates / stats are being shown in the Test SubmitHelixTests steps.

@chcosta
chcosta marked this pull request as ready for review June 24, 2026 18:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread src/Microsoft.DotNet.Helix/Sdk/SendHelixJob.cs Outdated
@chcosta

chcosta commented Jun 30, 2026

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 2, 2026 20:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread src/Microsoft.DotNet.Helix/Sdk/SendHelixJob.cs Outdated
chcosta and others added 3 commits July 2, 2026 13:29
…Request

Queue stats are queried globally by queue name, so these request fields
are not needed. Removing the leftover model properties that were added
intentionally but ultimately unused.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Instead of elevating every SendAsync progress message to High importance
(which floods the build at 'Minimal' verbosity) or fragile string matching,
add a SendAsync overload with a separate queueStatsLog callback. The SDK
routes routine progress at Normal importance and the opt-in queue health
summary at High importance, so only the queue-stats lines survive the
default 'Minimal' verbosity.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 2, 2026 20:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread src/Microsoft.DotNet.Helix/JobSender/IJobDefinition.cs Outdated
Comment thread src/Microsoft.DotNet.Helix/Sdk/SendHelixJob.cs Outdated
- Add default interface implementation for the new SendAsync(log, queueStatsLog)
  overload so external IJobDefinition implementers keep compiling (delegates to the
  single-callback overload and ignores queueStatsLog; documented on the interface).
- Extract SendHelixJob.CreateSubmissionLoggers, a pure factory that builds the routine
  and queue-stats log callbacks, so the enabled/disabled -> High/Normal routing is
  behaviorally unit-testable; expose Sdk internals to Sdk.Tests.
- Add tests: DIM delegation via a concrete legacy IJobDefinition stub (JobSender.Tests,
  asserts log + cancellation token are forwarded) and queue-stats importance routing for
  both flag states (Sdk.Tests).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@chcosta

chcosta commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

Ok, this is ready for review, @mmitche @premun

@chcosta
chcosta requested a review from premun July 3, 2026 15:57
@chcosta

chcosta commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

Here's an example of the change to pipeline behavior

https://dev.azure.com/dnceng-public/public/_build/results?buildId=1492794&view=logs&j=21143b0a-ace1-5058-215e-b11404388d17&t=68957cf3-3aa0-5af2-df5a-5bb40d4d0ecf&l=564

  note : Helix queue health reporting is a preview feature; data and format may change.
  Helix queue 'ubuntu.2204.amd64.open' health:
    Estimated wait : 0s   (queue depth: 9, avg run: 3m 55s)
    Snapshot taken : 2026-07-03 06:15 Coordinated Universal Time
    Questions about Helix queue health? Reach the dnceng First Responders channel: https://teams.microsoft.com/l/channel/19%3Aafba3d1545dd45d7b79f34c1821f6055%40thread.skype/First%20Responders?groupId=4d73664c-9f2f-450d-82a5-c2f02756606d&tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47
  Sent Helix Job 'Arcade Job Name'; see work items at https://helix.dot.net/api/jobs/2d9a30f2-3a04-4b60-9fd2-ebdec71b4b5a/workitems?api-version=2019-06-17
  Sending Job to Windows.11.Amd64.Client.Open...
  note : Helix queue health reporting is a preview feature; data and format may change.
  Helix queue 'windows.11.amd64.client.open' health:
    Estimated wait : 0s   (queue depth: 6, avg run: 11m 40s)
    Snapshot taken : 2026-07-03 06:15 Coordinated Universal Time
    Questions about Helix queue health? Reach the dnceng First Responders channel: https://teams.microsoft.com/l/channel/19%3Aafba3d1545dd45d7b79f34c1821f6055%40thread.skype/First%20Responders?groupId=4d73664c-9f2f-450d-82a5-c2f02756606d&tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47
  Sent Helix Job 'Arcade Job Name'; see work items at https://helix.dot.net/api/jobs/2b291e69-2b31-4ea3-a16d-f863c22a41a7/workitems?api-version=2019-06-17
  Sending Job to (Debian.13.Amd64.Open)ubuntu.2204.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-13-helix-amd64...
  note : Helix queue health reporting is a preview feature; data and format may change.
  Helix queue 'ubuntu.2204.amd64.open' health:
    Estimated wait : 0s   (queue depth: 9, avg run: 3m 55s)
    Snapshot taken : 2026-07-03 06:15 Coordinated Universal Time
    Questions about Helix queue health? Reach the dnceng First Responders channel: https://teams.microsoft.com/l/channel/19%3Aafba3d1545dd45d7b79f34c1821f6055%40thread.skype/First%20Responders?groupId=4d73664c-9f2f-450d-82a5-c2f02756606d&tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47
  Sent Helix Job 'Arcade Job Name'; see work items at https://helix.dot.net/api/jobs/3ffb9616-5b40-4564-9ea8-caa7bf34da1f/workitems?api-version=2019-06-17
  Sending Job to OSX.26.Arm64.Open...
  note : Helix queue health reporting is a preview feature; data and format may change.
  Helix queue 'osx.26.arm64.open' health:
    Estimated wait : 0s   (queue depth: 37, avg run: 47s)
    Snapshot taken : 2026-07-03 06:15 Coordinated Universal Time
    Questions about Helix queue health? Reach the dnceng First Responders channel: https://teams.microsoft.com/l/channel/19%3Aafba3d1545dd45d7b79f34c1821f6055%40thread.skype/First%20Responders?groupId=4d73664c-9f2f-450d-82a5-c2f02756606d&tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47
  Sent Helix Job 'Arcade Job Name'; see work items at https://helix.dot.net/api/jobs/c61763f6-6d79-43ea-9687-cc09f62ae275/workitems?api-version=2019-06-17

The estimated wait time may or may not be accurate. This PR is about enabling the functionality. i have separate efforts to track and ensure accuracy of the wait time estimation.

@chcosta
chcosta requested review from epananth and missymessa July 6, 2026 17:11
@missymessa

Copy link
Copy Markdown
Member

Are the tests in here enough? Did you want to add any to Arcade Validation?

@chcosta
chcosta merged commit 1690e7d into dotnet:main Jul 7, 2026
15 checks passed
@chcosta
chcosta deleted the dev/chcosta/enable-helix-queue-stats branch July 7, 2026 20:28
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants