From f65492f6d61011bba4698dd5abfecf74e621443a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Mon, 18 Mar 2024 12:57:33 +0100 Subject: [PATCH] Fix ComponentGovernance running on public PR/CI jobs This seems to be a side-effect of https://github.com/dotnet/runtime/pull/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. --- eng/pipelines/common/global-build-job.yml | 2 +- eng/pipelines/common/templates/runtimes/xplat-job.yml | 8 +++++--- eng/pipelines/libraries/run-test-job.yml | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/eng/pipelines/common/global-build-job.yml b/eng/pipelines/common/global-build-job.yml index cdcadcbc048029..3cd921160b4d1c 100644 --- a/eng/pipelines/common/global-build-job.yml +++ b/eng/pipelines/common/global-build-job.yml @@ -32,7 +32,7 @@ parameters: preBuildSteps: [] enableRichCodeNavigation: false richCodeNavigationLanguage: 'csharp' - disableComponentGovernance: false + disableComponentGovernance: '' jobs: - template: /eng/common/templates/job/job.yml diff --git a/eng/pipelines/common/templates/runtimes/xplat-job.yml b/eng/pipelines/common/templates/runtimes/xplat-job.yml index f97ca08e5162e8..33fefeb43e9239 100644 --- a/eng/pipelines/common/templates/runtimes/xplat-job.yml +++ b/eng/pipelines/common/templates/runtimes/xplat-job.yml @@ -19,7 +19,7 @@ parameters: timeoutInMinutes: '' enableMicrobuild: '' gatherAssetManifests: false - disableComponentGovernance: false + disableComponentGovernance: '' variables: {} ## any extra variables to add to the defaults defined below @@ -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 diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml index 78dd68907c7d65..008e57b40fae41 100644 --- a/eng/pipelines/libraries/run-test-job.yml +++ b/eng/pipelines/libraries/run-test-job.yml @@ -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: