Skip to content

Commit

Permalink
Add Information on what to test before Submitting Package (microsoft#…
Browse files Browse the repository at this point in the history
…112071)

* Add Information on what to test before Submitting Package

* Update GitOps id and description

* Remove issue search

* Fix mising sentence

* Fix message spacing
  • Loading branch information
Trenly authored Jul 13, 2023
1 parent 88dc31b commit 8761e50
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .github/policies/labelAdded.manifestContentIncomplete.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
id: labelAdded.manifestContentIncomplete
name: GitOps.PullRequestIssueManagement
description: Handlers when "Manifest-Content-Incomplete" label is added
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- description: >-
When the label "Manifest-Content-Incomplete" 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-Content-Incomplete"
then:
- addReply:
reply: >-
@${issueAuthor},
Your manifest appears to contain one or more issues with the content. Please ensure it meets the contribution guidelines.
* Manifests should be tested to ensure applications can install unattended
* Manifests should be tested to ensure application version matches the Package Version, or that AppsAndFeaturesEntries are included if necessary
* Manifests should be tested to ensure application publisher matches the defaultLocale Publisher, or that AppsAndFeaturesEntries are included if necessary
* Manifests should be tested to ensure application name matches the defaultLocale PackageName, or that AppsAndFeaturesEntries are included if necessary
Please review your manifest and make the appropriate changes. This PR will be automatically closed if no changes are made.
Template: msftbot/validationError/manifest/contentIncomplete
- 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:
2 changes: 2 additions & 0 deletions .github/policies/labelManagement.issueUpdated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ configuration:
label: Manifest-AppsAndFeaturesVersion-Error
- removeLabel:
label: Validation-Shell-Execute
- removeLabel:
label: Manifest-Content-Incomplete
- description: Remove status labels when a PR is re-run
if:
- payloadType: Issue_Comment
Expand Down
8 changes: 8 additions & 0 deletions .github/policies/moderatorTriggers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ configuration:
then:
- addLabel:
label: Needs-Manual-Merge
# Manifest-Content-Incomplete
- if:
- commentContains:
pattern: '\[[Pp]olicy\]\s+([Mm]anifest[\s-])?[Cc]ontent[\s-][Ii]ncomplete'
isRegex: True
then:
- addLabel:
label: Manifest-Content-Incomplete
# Reset-Feedback
- if:
- commentContains:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
id: scheduledSearch.closeManifestContentIncomplete
name: GitOps.PullRequestIssueManagement
description: Close stale pull requests marked with "Manifest-Content-Incomplete"
owner:
resource: repository
disabled: false
where:
configuration:
resourceManagementConfiguration:
scheduledSearches:
- description: >-
Search for PR where -
* Pull Request is Open
* Pull request has the label Manifest-Content-Incomplete
* Has not had activity in the last 5 days
Then -
* Close the PR
frequencies:
- hourly:
hour: 6
filters:
- isPullRequest
- isOpen
- hasLabel:
label: Manifest-Content-Incomplete
- noActivitySince:
days: 5
actions:
- closeIssue
onFailure:
onSuccess:
11 changes: 11 additions & 0 deletions AUTHORING_MANIFESTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,14 @@ If you decide to create or edit your manifest by manually editing the YAML, it i
```powershell
winget validate --manifest <Path to manifest>
```

## Testing
It is important to test your manifest before submission to ensure it meets the repository's quality standards. While it isn't possible to describe everything that we check for when reviewing contributions, testing your manifest helps keep the quality of contributions high and increases the chance of your contribution being accepted.

* Manifests should be tested to ensure applications can install unattended
* Manifests should be tested to ensure application version matches the Package Version, or that AppsAndFeaturesEntries are included if necessary
* Manifests should be tested to ensure application publisher matches the defaultLocale Publisher, or that AppsAndFeaturesEntries are included if necessary
* Manifests should be tested to ensure application name matches the defaultLocale PackageName, or that AppsAndFeaturesEntries are included if necessary

After enabling the setting for local manifests (`winget settings --enable LocalManifestFiles`), manifests can be tested locally with `winget install --manifest <path>`.
If your system supports Windows Sandbox, you can also use the [SandboxTest.ps1 Script](https://github.com/microsoft/winget-pkgs/blob/master/doc/tools/SandboxTest.md) to test the manifest in the Windows Sandbox. This is the preferred method, as it ensures the package doesn't require any dependencies to install.
10 changes: 9 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,15 @@ Once you've discussed your proposed feature/fix/etc. with a team member, and you

### Testing

Testing is a key component in the development workflow.
Testing is a key component in the development workflow. The PR Template asks if you have tested your manifest locally, but what does this mean? When testing your manifest, this is what you should be looking for -

* Manifests should be tested to ensure applications can install unattended
* Manifests should be tested to ensure application version matches the Package Version, or that AppsAndFeaturesEntries are included if necessary
* Manifests should be tested to ensure application publisher matches the defaultLocale Publisher, or that AppsAndFeaturesEntries are included if necessary
* Manifests should be tested to ensure application name matches the defaultLocale PackageName, or that AppsAndFeaturesEntries are included if necessary

After enabling the setting for local manifests (`winget settings --enable LocalManifestFiles`), manifests can be tested locally with `winget install --manifest <path>`.
If your system supports Windows Sandbox, you can also use the [SandboxTest.ps1 Script](https://github.com/microsoft/winget-pkgs/blob/master/doc/tools/SandboxTest.md) to test the manifest in the Windows Sandbox. This is the preferred method, as it ensures the package doesn't require any dependencies to install.

### Code Review

Expand Down
1 change: 1 addition & 0 deletions Moderation.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Moderators are often the first to see and triage new issues, and so they have th
* `Hardware`
* `Installer-Issue`
* `Interactive-Only-Installer`
* `Manifest-Content-Incomplete`
* `Needs-Attention`
* `Needs-Author-Feedback`
* `Needs-CLA`
Expand Down

0 comments on commit 8761e50

Please sign in to comment.