Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rule for deprecating singletons #181585

Merged
merged 3 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/policies/labelAdded.manifestSingletonDeprecated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
id: labelAdded.manifestSingletonDeprecated
name: GitOps.PullRequestIssueManagement
description: Handlers when "Manifest-Singleton-Deprecated" label is added
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: >-
When the label "Manifest-Singleton-Deprecated" is added to a pull request
* Add the PR specific reply notifying the issue author
* Assign to the Author
* Label with Needs-Author-Feedback
* Remove the Needs-Attention Label
if:
- payloadType: Pull_Request
- labelAdded:
label: Manifest-Singleton-Deprecated
then:
- addReply:
reply: >-
Hello @${issueAuthor},


The package manager bot determined that your submission uses a `Singleton` Manifest, which been deprecated in this repository. Please update your submission to use the newer multi-manifest format. If you built your manifest by hand, a tool like [WingetCreate](https://github.com/microsoft/winget-create) or [YamlCreate](https://github.com/microsoft/winget-pkgs/blob/master/doc/tools/YamlCreate.md) can help you build the multi-manifest.


Template: msftbot/validationError/manifest/singleton/deprecated
- assignTo:
author: True
- addLabel:
label: Needs-Author-Feedback
- removeLabel:
label: Needs-Attention
# The policy service should trigger even when the label was added by the policy service
triggerOnOwnActions: true
onFailure:
onSuccess:
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: >-
When the label "Manifest-Version-Error" is added to a pull request
When the label "Manifest-Version-Deprecated" is added to a pull request
* Add the PR specific reply notifying the issue author
* Assign to the Author
* Label with Needs-Author-Feedback
Expand Down
30 changes: 30 additions & 0 deletions .github/policies/labelManagement.issueOpened.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,5 +206,35 @@ configuration:
then:
- addLabel:
label: Author-Not-Authorized
- description: >-
When a PR is opened/updated, if
* The files are in /manifests
* The files match *.yaml
* The files do not match *.installer.yaml
* The files do no match *.locale.yaml
Then
* Add label Manifest-Singleton-Deprecated
if:
- payloadType: Pull_Request
- isOpen
- or:
- isAction:
action: Opened
- isAction:
action: Synchronize
- not:
filesMatchPattern: # has at least one file
pattern: ^$
- filesMatchPattern:
pattern: ^manifests/.*\.yaml # matches manifests/*.yaml
- not:
filesMatchPattern:
pattern: ^manifests/.*\.installer\.yaml # matches manifests/*.installer.yaml
- not:
filesMatchPattern:
pattern: ^manifests/.*\.locale\..*\.yaml # matches manifests/*.locale.*.yaml
then:
- addLabel:
label: Manifest-Singleton-Deprecated
onFailure:
onSuccess: