Skip to content

Commit

Permalink
Fix ComponentGovernance running on public PR/CI jobs
Browse files Browse the repository at this point in the history
This seems to be a side-effect of dotnet#99179

Arcade checks whether `disableComponentGovernance` is the empty string to apply the default skipping logic: https://github.com/dotnet/arcade/blob/ace00d8719b8d1fdfd0cc05f71bb9af216338d27/eng/common/templates/job/job.yml#L168-L174

Changed our templates to make sure we pass that correctly.
  • Loading branch information
akoeplinger committed Mar 18, 2024
1 parent 78fa5b8 commit f65492f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion eng/pipelines/common/global-build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ parameters:
preBuildSteps: []
enableRichCodeNavigation: false
richCodeNavigationLanguage: 'csharp'
disableComponentGovernance: false
disableComponentGovernance: ''

jobs:
- template: /eng/common/templates/job/job.yml
Expand Down
8 changes: 5 additions & 3 deletions eng/pipelines/common/templates/runtimes/xplat-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ parameters:
timeoutInMinutes: ''
enableMicrobuild: ''
gatherAssetManifests: false
disableComponentGovernance: false
disableComponentGovernance: ''

variables: {} ## any extra variables to add to the defaults defined below

Expand Down Expand Up @@ -64,9 +64,11 @@ jobs:
${{ if eq(parameters.osGroup, 'windows') }}:
agentOs: windows

# Disable component governance if requested or on musl machines where it does not work well
${{ if or(eq(parameters.disableComponentGovernance, true), eq(parameters.osSubGroup, '_musl')) }}:
# Component governance does not work on musl machines
${{ if eq(parameters.osSubGroup, '_musl') }}:
disableComponentGovernance: true
${{ else }}:
disableComponentGovernance: ${{ parameters.disableComponentGovernance }}

# Setting this results in the arcade job template including a step
# that gathers asset manifests and publishes them to pipeline
Expand Down
4 changes: 2 additions & 2 deletions eng/pipelines/libraries/run-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ jobs:
# To run the tests we just send to helix and wait, use ubuntu hosted pools for faster providing and to not back up our build pools
pool: ${{ parameters.pool }}

# Disable component governance if requested or on musl machines where it does not work well
${{ if or(eq(parameters.disableComponentGovernance, true), eq(parameters.osSubGroup, '_musl')) }}:
# Component governance does not work on musl machines
${{ if eq(parameters.osSubGroup, '_musl') }}:
disableComponentGovernance: true

dependsOn:
Expand Down

0 comments on commit f65492f

Please sign in to comment.