From 25b334a8be1ad6dc3fadcb5ae456917390a23984 Mon Sep 17 00:00:00 2001 From: Scott Beddall Date: Tue, 15 Oct 2024 16:23:52 -0700 Subject: [PATCH 1/3] add the ability to pass a servicedirectoryFilter. This will allow us to pass in a service directory for which this logic will invoke, will just do default service specific package props otherwise --- .../pipelines/templates/steps/save-package-properties.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eng/common/pipelines/templates/steps/save-package-properties.yml b/eng/common/pipelines/templates/steps/save-package-properties.yml index 1808dc2a00f..7e2bfa2445a 100644 --- a/eng/common/pipelines/templates/steps/save-package-properties.yml +++ b/eng/common/pipelines/templates/steps/save-package-properties.yml @@ -14,9 +14,12 @@ parameters: - name: ScriptDirectory type: string default: eng/common/scripts + - name: ServiceDirectoryFilter + type: string + default: "" steps: - - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: + - ${{ if and(eq(variables['Build.Reason'], 'PullRequest'), or(eq(parameters.ServiceDirectoryFilter, ''), eq(parameters.ServiceDirectory, parameters.ServiceDirectoryFilter))) }}: - task: Powershell@2 displayName: Generate PR Diff inputs: From fd52fc20e0d797baec08d7a403668f5ab84a3c4b Mon Sep 17 00:00:00 2001 From: Scott Beddall Date: Thu, 17 Oct 2024 11:52:34 -0700 Subject: [PATCH 2/3] hardcode this logic to only activate the new pr logic for service directory auto --- .../pipelines/templates/steps/save-package-properties.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/eng/common/pipelines/templates/steps/save-package-properties.yml b/eng/common/pipelines/templates/steps/save-package-properties.yml index 7e2bfa2445a..0ebc196826a 100644 --- a/eng/common/pipelines/templates/steps/save-package-properties.yml +++ b/eng/common/pipelines/templates/steps/save-package-properties.yml @@ -14,12 +14,9 @@ parameters: - name: ScriptDirectory type: string default: eng/common/scripts - - name: ServiceDirectoryFilter - type: string - default: "" steps: - - ${{ if and(eq(variables['Build.Reason'], 'PullRequest'), or(eq(parameters.ServiceDirectoryFilter, ''), eq(parameters.ServiceDirectory, parameters.ServiceDirectoryFilter))) }}: + - ${{ if and(eq(variables['Build.Reason'], 'PullRequest'), eq(parameters.ServiceDirectory, 'auto')) }}: - task: Powershell@2 displayName: Generate PR Diff inputs: From c2e0bd87a8a628ade6fac81c148318eb17e1c14e Mon Sep 17 00:00:00 2001 From: Scott Beddall Date: Thu, 17 Oct 2024 12:18:36 -0700 Subject: [PATCH 3/3] update the comment --- .../pipelines/templates/steps/save-package-properties.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eng/common/pipelines/templates/steps/save-package-properties.yml b/eng/common/pipelines/templates/steps/save-package-properties.yml index 0ebc196826a..3714c026438 100644 --- a/eng/common/pipelines/templates/steps/save-package-properties.yml +++ b/eng/common/pipelines/templates/steps/save-package-properties.yml @@ -16,6 +16,12 @@ parameters: default: eng/common/scripts steps: + # There will be transitory period for every language repo where the - pullrequest build definition will run + # alongside the - - ci definitions. These pullrequest build definitions will have the ServiceDirectory parameter + # set to 'auto', which will allow the expanding and contracting based on PR Diff. + + # The other public CI builds will pass a real service directory, which will not activate the PR diff logic and as such will operate + # as before this change. - ${{ if and(eq(variables['Build.Reason'], 'PullRequest'), eq(parameters.ServiceDirectory, 'auto')) }}: - task: Powershell@2 displayName: Generate PR Diff