From 082eb59d49bdf30bc9736b34deb69c5dd3224fe1 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:25:39 -0800 Subject: [PATCH 01/21] Update label-issues.yml --- .github/policies/label-issues.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/policies/label-issues.yml b/.github/policies/label-issues.yml index b2b2b9d86c..355129250e 100644 --- a/.github/policies/label-issues.yml +++ b/.github/policies/label-issues.yml @@ -68,7 +68,7 @@ configuration: - isAction: action: Closed - isActivitySender: - user: ${issueAuthor} + issueAuthor: true then: - addLabel: From 57e6d8721b2115bf1d5220c73d30131ef8a5fdd6 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:27:09 -0800 Subject: [PATCH 02/21] Create pullRequestManagement-serviceLabels.yml --- .../pullRequestManagement-serviceLabels.yml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/policies/pullRequestManagement-serviceLabels.yml diff --git a/.github/policies/pullRequestManagement-serviceLabels.yml b/.github/policies/pullRequestManagement-serviceLabels.yml new file mode 100644 index 0000000000..3684a23e2a --- /dev/null +++ b/.github/policies/pullRequestManagement-serviceLabels.yml @@ -0,0 +1,29 @@ +id: pullRequestManagement.serviceLabels +name: GitOps.PullRequestServiceLabels +description: Checks the files touched by a pull request and assigns area labels. +owner: +resource: repository +disabled: false +where: +configuration: + resourceManagementConfiguration: + eventResponderTasks: + - description: + if: + - payloadType: PullRequest + - not: + - targetsBranch: + branch: live + then: + # Framework WPF + - if: + - filesMatchPattern: + pattern: '(?i).*dotnet-desktop-guide\/framework\/wpf.*' + then: + - addLabels: + - label: 'dotnet-framework/svc' + - label: 'wpf/subsvc' + triggerOnOwnActions: false + +onFailure: +onSuccess: From bc470e3e3831e3c7794de3ecddd5ab1a1fa81ae9 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:29:16 -0800 Subject: [PATCH 03/21] Fix typo in payloadType value --- .github/policies/pullRequestManagement-serviceLabels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/policies/pullRequestManagement-serviceLabels.yml b/.github/policies/pullRequestManagement-serviceLabels.yml index 3684a23e2a..157f6b5d7b 100644 --- a/.github/policies/pullRequestManagement-serviceLabels.yml +++ b/.github/policies/pullRequestManagement-serviceLabels.yml @@ -10,7 +10,7 @@ configuration: eventResponderTasks: - description: if: - - payloadType: PullRequest + - payloadType: Pull_Request - not: - targetsBranch: branch: live From 314a4ad22e9b9077ccb665def89904ca68c387f2 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:31:22 -0800 Subject: [PATCH 04/21] Refactor pull request branch condition logic --- .github/policies/pullRequestManagement-serviceLabels.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/policies/pullRequestManagement-serviceLabels.yml b/.github/policies/pullRequestManagement-serviceLabels.yml index 157f6b5d7b..daea6df931 100644 --- a/.github/policies/pullRequestManagement-serviceLabels.yml +++ b/.github/policies/pullRequestManagement-serviceLabels.yml @@ -11,9 +11,10 @@ configuration: - description: if: - payloadType: Pull_Request - - not: - - targetsBranch: - branch: live + - and: + - not: + targetsBranch: + branch: live then: # Framework WPF - if: From 5acdbae0819a567527eb5598f95e9b476fc8568d Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:33:23 -0800 Subject: [PATCH 05/21] Add 'Opened' and 'Synchronize' actions in policy --- .github/policies/pullRequestManagement-serviceLabels.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/policies/pullRequestManagement-serviceLabels.yml b/.github/policies/pullRequestManagement-serviceLabels.yml index daea6df931..896d71efe7 100644 --- a/.github/policies/pullRequestManagement-serviceLabels.yml +++ b/.github/policies/pullRequestManagement-serviceLabels.yml @@ -11,6 +11,11 @@ configuration: - description: if: - payloadType: Pull_Request + - or + - isAction + Opened + - isAction + Synchronize - and: - not: targetsBranch: From 1c40c4a70821472a6eee6e7a06fc9bfad84fdadc Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:34:21 -0800 Subject: [PATCH 06/21] Fix YAML syntax for pull request actions --- .github/policies/pullRequestManagement-serviceLabels.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/policies/pullRequestManagement-serviceLabels.yml b/.github/policies/pullRequestManagement-serviceLabels.yml index 896d71efe7..0b4ed07f9d 100644 --- a/.github/policies/pullRequestManagement-serviceLabels.yml +++ b/.github/policies/pullRequestManagement-serviceLabels.yml @@ -11,10 +11,10 @@ configuration: - description: if: - payloadType: Pull_Request - - or - - isAction + - or: + - isAction: Opened - - isAction + - isAction: Synchronize - and: - not: From ce9b5f1a51ad08e2c8bd36d1e46409c1e44a950d Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:35:14 -0800 Subject: [PATCH 07/21] Remove branch condition from pull request policy --- .github/policies/pullRequestManagement-serviceLabels.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/policies/pullRequestManagement-serviceLabels.yml b/.github/policies/pullRequestManagement-serviceLabels.yml index 0b4ed07f9d..4c20ce4eef 100644 --- a/.github/policies/pullRequestManagement-serviceLabels.yml +++ b/.github/policies/pullRequestManagement-serviceLabels.yml @@ -16,10 +16,7 @@ configuration: Opened - isAction: Synchronize - - and: - - not: - targetsBranch: - branch: live + then: # Framework WPF - if: From 6ef60eff7cbc74957d0dd7b703639352d9758ec4 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:37:02 -0800 Subject: [PATCH 08/21] Remove redundant conditions in YAML file --- .github/policies/pullRequestManagement-serviceLabels.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/policies/pullRequestManagement-serviceLabels.yml b/.github/policies/pullRequestManagement-serviceLabels.yml index 4c20ce4eef..3ac2529d87 100644 --- a/.github/policies/pullRequestManagement-serviceLabels.yml +++ b/.github/policies/pullRequestManagement-serviceLabels.yml @@ -11,11 +11,6 @@ configuration: - description: if: - payloadType: Pull_Request - - or: - - isAction: - Opened - - isAction: - Synchronize then: # Framework WPF From 762d82b9ea817be312a3cfa42570f1a782188159 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:37:32 -0800 Subject: [PATCH 09/21] Add 'wpf/subsvc' label to PR management --- .github/policies/pullRequestManagement-serviceLabels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/policies/pullRequestManagement-serviceLabels.yml b/.github/policies/pullRequestManagement-serviceLabels.yml index 3ac2529d87..ca1f0c5f4b 100644 --- a/.github/policies/pullRequestManagement-serviceLabels.yml +++ b/.github/policies/pullRequestManagement-serviceLabels.yml @@ -20,6 +20,7 @@ configuration: then: - addLabels: - label: 'dotnet-framework/svc' + - addLabels: - label: 'wpf/subsvc' triggerOnOwnActions: false From 4e61e43a40d8491ef74f22472dd4181776c3929e Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:38:21 -0800 Subject: [PATCH 10/21] Update pull request management service labels --- .github/policies/pullRequestManagement-serviceLabels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/policies/pullRequestManagement-serviceLabels.yml b/.github/policies/pullRequestManagement-serviceLabels.yml index ca1f0c5f4b..0a57a46464 100644 --- a/.github/policies/pullRequestManagement-serviceLabels.yml +++ b/.github/policies/pullRequestManagement-serviceLabels.yml @@ -8,7 +8,7 @@ where: configuration: resourceManagementConfiguration: eventResponderTasks: - - description: + - description: Does stuff if: - payloadType: Pull_Request From c1699e80c4770bb8f13afc443a9f361f46b46c12 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:39:00 -0800 Subject: [PATCH 11/21] Add label for community PRs --- .../pullRequestManagement-serviceLabels.yml | 35 +++++++++++++------ 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/.github/policies/pullRequestManagement-serviceLabels.yml b/.github/policies/pullRequestManagement-serviceLabels.yml index 0a57a46464..9873eacdf1 100644 --- a/.github/policies/pullRequestManagement-serviceLabels.yml +++ b/.github/policies/pullRequestManagement-serviceLabels.yml @@ -8,20 +8,33 @@ where: configuration: resourceManagementConfiguration: eventResponderTasks: - - description: Does stuff + - description: Label community PRs if: - payloadType: Pull_Request - + - isAction: + action: Opened + - and: + - not: + activitySenderHasPermission: + permission: Admin + - not: + activitySenderHasPermission: + permission: Write + - not: + isActivitySender: + user: github-actions[bot] + - not: + isActivitySender: + user: github-actions + - not: + isActivitySender: + user: azure-sdk + - not: + isActivitySender: + user: dependabot then: - # Framework WPF - - if: - - filesMatchPattern: - pattern: '(?i).*dotnet-desktop-guide\/framework\/wpf.*' - then: - - addLabels: - - label: 'dotnet-framework/svc' - - addLabels: - - label: 'wpf/subsvc' + - addLabel: + label: community-contribution triggerOnOwnActions: false onFailure: From d7ea64849697fb50190f58f23f3995c9aa9b8fca Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:39:55 -0800 Subject: [PATCH 12/21] Update PR label management conditions and description --- .../pullRequestManagement-serviceLabels.yml | 28 ++++--------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/.github/policies/pullRequestManagement-serviceLabels.yml b/.github/policies/pullRequestManagement-serviceLabels.yml index 9873eacdf1..af7a2be938 100644 --- a/.github/policies/pullRequestManagement-serviceLabels.yml +++ b/.github/policies/pullRequestManagement-serviceLabels.yml @@ -8,30 +8,14 @@ where: configuration: resourceManagementConfiguration: eventResponderTasks: - - description: Label community PRs + - description: Add labels to PRs that touch certain files if: - payloadType: Pull_Request - - isAction: - action: Opened - - and: - - not: - activitySenderHasPermission: - permission: Admin - - not: - activitySenderHasPermission: - permission: Write - - not: - isActivitySender: - user: github-actions[bot] - - not: - isActivitySender: - user: github-actions - - not: - isActivitySender: - user: azure-sdk - - not: - isActivitySender: - user: dependabot + - or: + - isAction: + Opened + - isAction: + Synchronize then: - addLabel: label: community-contribution From 60988c8de7e22f79a3322d39c3b599acf344ae33 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:40:30 -0800 Subject: [PATCH 13/21] Add condition to exclude 'live' branch --- .github/policies/pullRequestManagement-serviceLabels.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/policies/pullRequestManagement-serviceLabels.yml b/.github/policies/pullRequestManagement-serviceLabels.yml index af7a2be938..9fccd679e9 100644 --- a/.github/policies/pullRequestManagement-serviceLabels.yml +++ b/.github/policies/pullRequestManagement-serviceLabels.yml @@ -16,6 +16,9 @@ configuration: Opened - isAction: Synchronize + - not: + targetsBranch: + branch: live then: - addLabel: label: community-contribution From cebd066da8addc8ce44509bfa70da0cb991aed15 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:41:22 -0800 Subject: [PATCH 14/21] Add labels for dotnet framework and WPF --- .github/policies/pullRequestManagement-serviceLabels.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/policies/pullRequestManagement-serviceLabels.yml b/.github/policies/pullRequestManagement-serviceLabels.yml index 9fccd679e9..2740d8937f 100644 --- a/.github/policies/pullRequestManagement-serviceLabels.yml +++ b/.github/policies/pullRequestManagement-serviceLabels.yml @@ -20,8 +20,13 @@ configuration: targetsBranch: branch: live then: - - addLabel: - label: community-contribution + - if: + - filesMatchPattern: + pattern: '(?i).*dotnet-desktop-guide\/framework\/wpf.*' + then: + - addLabels: + - label: 'dotnet-framework/svc' + - label: 'wpf/subsvc' triggerOnOwnActions: false onFailure: From c9123e6eae5f34fa2d72bb3a3dfbb93b62327646 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:43:30 -0800 Subject: [PATCH 15/21] Update pull request label conditions --- .github/policies/pullRequestManagement-serviceLabels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/policies/pullRequestManagement-serviceLabels.yml b/.github/policies/pullRequestManagement-serviceLabels.yml index 2740d8937f..75f60ba2fb 100644 --- a/.github/policies/pullRequestManagement-serviceLabels.yml +++ b/.github/policies/pullRequestManagement-serviceLabels.yml @@ -21,8 +21,8 @@ configuration: branch: live then: - if: - - filesMatchPattern: - pattern: '(?i).*dotnet-desktop-guide\/framework\/wpf.*' + - isAction: + Opened then: - addLabels: - label: 'dotnet-framework/svc' From 74b544115ae1bec781e2708be799497a972eaa4b Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:44:08 -0800 Subject: [PATCH 16/21] Simplify label addition logic --- .../policies/pullRequestManagement-serviceLabels.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/policies/pullRequestManagement-serviceLabels.yml b/.github/policies/pullRequestManagement-serviceLabels.yml index 75f60ba2fb..8d7b8308ed 100644 --- a/.github/policies/pullRequestManagement-serviceLabels.yml +++ b/.github/policies/pullRequestManagement-serviceLabels.yml @@ -20,13 +20,9 @@ configuration: targetsBranch: branch: live then: - - if: - - isAction: - Opened - then: - - addLabels: - - label: 'dotnet-framework/svc' - - label: 'wpf/subsvc' + - addLabels: + - label: 'dotnet-framework/svc' + - label: 'wpf/subsvc' triggerOnOwnActions: false onFailure: From 98c9aef9d1e609219ba92cae8ea56694f82cfc13 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:45:02 -0800 Subject: [PATCH 17/21] Add conditional labels for WPF framework --- .../policies/pullRequestManagement-serviceLabels.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/policies/pullRequestManagement-serviceLabels.yml b/.github/policies/pullRequestManagement-serviceLabels.yml index 8d7b8308ed..6c94986e49 100644 --- a/.github/policies/pullRequestManagement-serviceLabels.yml +++ b/.github/policies/pullRequestManagement-serviceLabels.yml @@ -20,9 +20,14 @@ configuration: targetsBranch: branch: live then: - - addLabels: - - label: 'dotnet-framework/svc' - - label: 'wpf/subsvc' + # Framework WPF + - if: + - filesMatchPattern: + pattern: '(?i).*dotnet-desktop-guide\/framework\/wpf.*' + then: + - addLabel: + - label: 'dotnet-framework/svc' + - label: 'wpf/subsvc' triggerOnOwnActions: false onFailure: From de32598070aeb248d7f7c5fb8c0f9ed24c602fe9 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:45:34 -0800 Subject: [PATCH 18/21] Add 'wpf/subsvc' label to PRs --- .github/policies/pullRequestManagement-serviceLabels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/policies/pullRequestManagement-serviceLabels.yml b/.github/policies/pullRequestManagement-serviceLabels.yml index 6c94986e49..bc5ce3ccc3 100644 --- a/.github/policies/pullRequestManagement-serviceLabels.yml +++ b/.github/policies/pullRequestManagement-serviceLabels.yml @@ -27,6 +27,7 @@ configuration: then: - addLabel: - label: 'dotnet-framework/svc' + - addLabel: - label: 'wpf/subsvc' triggerOnOwnActions: false From f0bb47f3615b7452371964ac849d7ed403f0efb6 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:46:09 -0800 Subject: [PATCH 19/21] Fix indentation in pull request labels configuration --- .github/policies/pullRequestManagement-serviceLabels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/policies/pullRequestManagement-serviceLabels.yml b/.github/policies/pullRequestManagement-serviceLabels.yml index bc5ce3ccc3..0355ee061c 100644 --- a/.github/policies/pullRequestManagement-serviceLabels.yml +++ b/.github/policies/pullRequestManagement-serviceLabels.yml @@ -26,9 +26,9 @@ configuration: pattern: '(?i).*dotnet-desktop-guide\/framework\/wpf.*' then: - addLabel: - - label: 'dotnet-framework/svc' + label: 'dotnet-framework/svc' - addLabel: - - label: 'wpf/subsvc' + label: 'wpf/subsvc' triggerOnOwnActions: false onFailure: From 1fb40d92a895e0dd41fbafe9597030be4993666a Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:48:44 -0800 Subject: [PATCH 20/21] Add labels for WinForms and WPF files --- .../pullRequestManagement-serviceLabels.yml | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/.github/policies/pullRequestManagement-serviceLabels.yml b/.github/policies/pullRequestManagement-serviceLabels.yml index 0355ee061c..cf50d75378 100644 --- a/.github/policies/pullRequestManagement-serviceLabels.yml +++ b/.github/policies/pullRequestManagement-serviceLabels.yml @@ -9,6 +9,7 @@ configuration: resourceManagementConfiguration: eventResponderTasks: - description: Add labels to PRs that touch certain files + triggerOnOwnActions: false if: - payloadType: Pull_Request - or: @@ -29,7 +30,36 @@ configuration: label: 'dotnet-framework/svc' - addLabel: label: 'wpf/subsvc' - triggerOnOwnActions: false + + # Framework WinForms + - if: + - filesMatchPattern: + pattern: '(?i).*dotnet-desktop-guide\/framework\/winforms.*' + then: + - addLabel: + label: 'dotnet-framework/svc' + - addLabel: + label: 'winforms/subsvc' + + # .NET WPF + - if: + - filesMatchPattern: + pattern: '(?i).*dotnet-desktop-guide\/net\/wpf.*' + then: + - addLabel: + label: 'dotnet-desktop/svc' + - addLabel: + label: 'wpf/subsvc' + + # .NET WinForms + - if: + - filesMatchPattern: + pattern: '(?i).*dotnet-desktop-guide\/net\/winforms.*' + then: + - addLabel: + label: 'dotnet-desktop/svc' + - addLabel: + label: 'winforms/subsvc' onFailure: onSuccess: From 25b6c37ca1b4157135da9e148efde33b2807486d Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:49:51 -0800 Subject: [PATCH 21/21] Update .repoman.yml -- Remove PR file -> label mappings --- .repoman.yml | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.repoman.yml b/.repoman.yml index 007c0c269b..0c5c7a053e 100644 --- a/.repoman.yml +++ b/.repoman.yml @@ -32,27 +32,6 @@ pull_request: # Set default sprint for new PRs - milestone-set: "![sprint]" - - - check: - - type: query - value: "PullRequest.Base.Ref != 'live'" - pass: - - files-changed: - - path: "(?i).*dotnet-desktop-guide\/framework\/wpf.*" - run: - - labels-add: ["dotnet-framework/svc", "wpf/subsvc"] - - - path: "(?i).*dotnet-desktop-guide\/framework\/winforms.*" - run: - - labels-add: ["dotnet-framework/svc", "winforms/subsvc"] - - - path: "(?i).*dotnet-desktop-guide\/net\/wpf.*" - run: - - labels-add: ["dotnet-desktop/svc", "wpf/subsvc"] - - - path: "(?i).*dotnet-desktop-guide\/net\/winforms.*" - run: - - labels-add: ["dotnet-desktop/svc", "winforms/subsvc"] projects_v2_item: