Skip to content

Commit f71a1cf

Browse files
Update common Docker engineering infrastructure with latest
1 parent 70ddcbf commit f71a1cf

4 files changed

Lines changed: 36 additions & 13 deletions

File tree

eng/docker-tools/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,23 @@ Service connections are now referenced per-job via
2626

2727
## 2026-03-04: Pre-build validation gated by `preBuildTestScriptPath` variable
2828

29+
- Pull request: [#1997](https://github.com/dotnet/docker-tools/pull/1997)
30+
2931
The `PreBuildValidation` job condition now checks the new `preBuildTestScriptPath` variable instead of `testScriptPath`.
3032
This allows repos to independently control whether pre-build validation runs, without affecting functional tests.
3133

3234
The new variable defaults to `$(testScriptPath)`, so existing repos that have pre-build tests are not affected.
3335
Repos that do not have pre-build tests can set `preBuildTestScriptPath` to `""` to skip the job entirely.
3436

37+
### Update (2026-03-11): Use `preBuildTestScriptPath` for test execution
38+
39+
- Pull request: [#2011](https://github.com/dotnet/docker-tools/pull/2011)
40+
41+
The `PreBuildValidation` job now uses `preBuildTestScriptPath` for test execution instead of `testScriptPath`.
42+
Previously, the job condition was gated on `preBuildTestScriptPath` but the test execution step still used `testScriptPath`,
43+
which meant PreBuildValidation could not be enabled independently when `testScriptPath` was empty.
44+
Repos that do not have pre-build tests can set `preBuildTestScriptPath` to `""` to skip the job entirely.
45+
3546
---
3647

3748
## 2026-02-19: Separate Registry Endpoints from Authentication

eng/docker-tools/templates/jobs/build-images.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ jobs:
4848
dockerClientOS: ${{ parameters.dockerClientOS }}
4949
usesRegistries:
5050
- ${{ parameters.publishConfig.BuildRegistry.server }}
51-
${{ if parameters.storageAccountServiceConnection }}:
51+
# Check .name instead of the whole object - null parameters can become
52+
# empty objects through template layers, making ${{ if }} truthy.
53+
${{ if parameters.storageAccountServiceConnection.name }}:
5254
serviceConnections:
5355
- name: ${{ parameters.storageAccountServiceConnection.name }}
5456
- template: /eng/docker-tools/templates/steps/set-image-info-path-var.yml@self

eng/docker-tools/templates/steps/reference-service-connections.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,23 @@ parameters:
4343

4444
steps:
4545
- ${{ if and(eq(variables['System.TeamProject'], parameters.internalProjectName), ne(variables['Build.Reason'], 'PullRequest')) }}:
46+
# Guard on .name: null parameters passed through template layers can become
47+
# empty objects that are truthy, so check the concrete property instead.
4648
- ${{ each serviceConnection in parameters.serviceConnections }}:
47-
- task: AzureCLI@2
48-
displayName: Reference ${{ serviceConnection.name }}
49-
inputs:
50-
azureSubscription: ${{ serviceConnection.name }}
51-
${{ if eq(parameters.dockerClientOS, 'windows') }}:
52-
scriptType: ps
53-
${{ else }}:
54-
scriptType: pscore
55-
scriptLocation: inlineScript
56-
inlineScript: Write-Host "Service connection referenced for OIDC"
49+
- ${{ if serviceConnection.name }}:
50+
- task: AzureCLI@2
51+
displayName: Reference ${{ serviceConnection.name }}
52+
inputs:
53+
azureSubscription: ${{ serviceConnection.name }}
54+
${{ if eq(parameters.dockerClientOS, 'windows') }}:
55+
scriptType: ps
56+
${{ else }}:
57+
scriptType: pscore
58+
scriptLocation: inlineScript
59+
inlineScript: Write-Host "Service connection referenced for OIDC"
5760
- ${{ each auth in parameters.publishConfig.RegistryAuthentication }}:
58-
- ${{ if containsValue(parameters.usesRegistries, auth.server) }}:
61+
# Also guard on .name here for the same reason as the serviceConnections loop above.
62+
- ${{ if and(containsValue(parameters.usesRegistries, auth.server), auth.serviceConnection.name) }}:
5963
- task: AzureCLI@2
6064
displayName: Reference ${{ auth.serviceConnection.name }}
6165
inputs:

eng/docker-tools/templates/steps/test-images-linux-client.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ steps:
2525
- script: |
2626
echo "##vso[task.setvariable variable=testRunner.container]testrunner-$(Build.BuildId)-$(System.JobId)"
2727
28+
if [ "${{ parameters.preBuildValidation }}" == "true" ]; then
29+
echo "##vso[task.setvariable variable=effectiveTestScriptPath]$(preBuildTestScriptPath)"
30+
else
31+
echo "##vso[task.setvariable variable=effectiveTestScriptPath]$(testScriptPath)"
32+
fi
33+
2834
additionalTestArgs="$ADDITIONALTESTARGS"
2935
if [ "${{ parameters.preBuildValidation }}" == "true" ]; then
3036
additionalTestArgs="$additionalTestArgs -TestCategories pre-build"
@@ -74,7 +80,7 @@ steps:
7480
$(testRunner.options)
7581
$(testRunner.container)
7682
pwsh
77-
-Command "$(testScriptPath)
83+
-Command "$(effectiveTestScriptPath)
7884
-Paths $(imageBuilderPathsArrayInitStr)
7985
-OSVersions $(osVersionsArrayInitStr)
8086
-Architecture '$(architecture)'

0 commit comments

Comments
 (0)