Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 59 additions & 3 deletions eng/pipelines/arcade/stage-helix-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,65 @@ stages:
DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token)
PRIVATE_BUILD: $(PrivateBuild)

- script: $(_msbuildCommand) "${{ parameters.helixProject }}" -warnAsError 0 -restore /p:Configuration=${{ BuildConfiguration }} /p:HelixInternal="${{ parameters.helixInternal }}" /p:TestRunNameSuffix="_${{ BuildConfiguration }}" /p:SkipInitInternalTooling=true /bl:$(Build.Arcade.LogsPath)${{ BuildConfiguration }}/helix_tests.binlog ${{ parameters.extraHelixArguments }}
- script: $(_msbuildCommand) "${{ parameters.helixProject }}" -warnAsError 0 -restore /p:Configuration=${{ BuildConfiguration }} /p:EnableHelixJobMonitor=true /p:HelixInternal="${{ parameters.helixInternal }}" /p:TestRunNameSuffix="_${{ BuildConfiguration }}" /p:SkipInitInternalTooling=true /bl:$(Build.Arcade.LogsPath)${{ BuildConfiguration }}/helix_tests.binlog ${{ parameters.extraHelixArguments }}
displayName: Run Helix Tests
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken) # We need to set this env var to publish helix results to Azure Dev Ops
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
HelixAccessToken: ${{ parameters.HelixAccessToken }}


- job: HelixJobMonitor
displayName: Monitor Helix Jobs
timeoutInMinutes: 360
pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals build.azurelinux.3.amd64.open
${{ else }}:
name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals build.azurelinux.3.amd64
steps:
- checkout: self
fetchDepth: 1

- bash: |
set -euo pipefail

toolPath="$AGENT_TEMPDIRECTORY/helix-job-monitor"
bash ./eng/common/dotnet.sh
toolVersion=$(bash ./eng/common/dotnet.sh msbuild eng/Versions.props -getProperty:MicrosoftDotNetHelixSdkPackageVersion -nologo | tail -n 1)
if [[ -z "$toolVersion" || "$toolVersion" =~ [[:space:]] ]]; then
echo "Could not read the Helix SDK package version from eng/Versions.props." >&2
exit 1
fi

bash ./eng/common/dotnet.sh tool install \
--tool-path "$toolPath" \
Microsoft.DotNet.Helix.JobMonitor \
--version "$toolVersion"

toolDll=$(find "$toolPath/.store" -path '*/tools/*/any/Microsoft.DotNet.Helix.JobMonitor.dll' -type f -print -quit)
if [ ! -f "$toolDll" ]; then
echo "Could not find the Helix Job Monitor DLL in '$toolPath/.store'." >&2
exit 1
fi

echo "##vso[task.setvariable variable=HelixJobMonitorDll]$toolDll"
displayName: Install Helix Job Monitor

- bash: |
set -euo pipefail

bash ./eng/common/dotnet.sh exec "$(HelixJobMonitorDll)" \
Comment on lines +133 to +145

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The DLL invocation is intentional and matches the canonical Arcade template’s isolated-package path: it runs the net11-targeted tool through MAUI’s pinned repo-local SDK. Invoking the shim directly would delegate runtime selection to the host environment, which is exactly what this job must avoid before/around SDK bootstrapping. The exact pinned package layout was also exercised successfully in builds 1568946 and 1569038.

--helix-base-uri 'https://helix.dot.net/' \
--polling-interval-seconds 30 \
--fail-on-failed-tests true \
--max-wait-minutes 355 \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

💡 Config Impact — Keep the monitor outer and inner timeouts coupled.
Flagged by: 2/3 reviewers after dispute

This inline copy hard-codes timeoutInMinutes: 360 separately from --max-wait-minutes 355, while the canonical Arcade template derives the latter as timeoutInMinutes - 5 specifically so the tool exits gracefully before Azure Pipelines terminates the job. If a later pipeline edit changes only one literal, the job can be killed before the monitor publishes its final summary. Please derive both from one value, or otherwise enforce the five-minute invariant at this call site.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed in b03c30e. helixJobMonitorTimeoutInMinutes now supplies the Azure job timeout, and --max-wait-minutes is derived from that parameter minus five minutes, preserving the graceful shutdown invariant from the canonical Arcade template.

--stage-name '$(System.StageName)' \
--organization dotnet \
--repository maui \
--build-reason '$(Build.Reason)' \
--source-branch '$(Build.SourceBranch)'
displayName: Monitor Helix Jobs
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The pinned Job Monitor reads HELIX_ACCESSTOKEN; this is also the environment variable set by Arcade’s canonical helix-job-monitor.yml template. The submission job uses a different client contract (HelixAccessToken), so aligning these names would break the monitor rather than improve compatibility.

HELIX_ACCESSTOKEN: ${{ parameters.HelixAccessToken }}
Loading