From 8761e50ac479ac0bfb082bd66b33c2206c711d59 Mon Sep 17 00:00:00 2001 From: Kaleb Luedtke Date: Thu, 13 Jul 2023 15:12:21 -0500 Subject: [PATCH] Add Information on what to test before Submitting Package (#112071) * Add Information on what to test before Submitting Package * Update GitOps id and description * Remove issue search * Fix mising sentence * Fix message spacing --- .../labelAdded.manifestContentIncomplete.yml | 48 +++++++++++++++++++ .../policies/labelManagement.issueUpdated.yml | 2 + .github/policies/moderatorTriggers.yml | 8 ++++ ...dSearch.closeManifestContentIncomplete.yml | 32 +++++++++++++ AUTHORING_MANIFESTS.md | 11 +++++ CONTRIBUTING.md | 10 +++- Moderation.md | 1 + 7 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 .github/policies/labelAdded.manifestContentIncomplete.yml create mode 100644 .github/policies/scheduledSearch.closeManifestContentIncomplete.yml diff --git a/.github/policies/labelAdded.manifestContentIncomplete.yml b/.github/policies/labelAdded.manifestContentIncomplete.yml new file mode 100644 index 0000000000000..cea9ed5f5a235 --- /dev/null +++ b/.github/policies/labelAdded.manifestContentIncomplete.yml @@ -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: diff --git a/.github/policies/labelManagement.issueUpdated.yml b/.github/policies/labelManagement.issueUpdated.yml index 58b7446366225..3b4d24d4cb0ed 100644 --- a/.github/policies/labelManagement.issueUpdated.yml +++ b/.github/policies/labelManagement.issueUpdated.yml @@ -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 diff --git a/.github/policies/moderatorTriggers.yml b/.github/policies/moderatorTriggers.yml index 694524249c9d6..a05890e4ef83e 100644 --- a/.github/policies/moderatorTriggers.yml +++ b/.github/policies/moderatorTriggers.yml @@ -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: diff --git a/.github/policies/scheduledSearch.closeManifestContentIncomplete.yml b/.github/policies/scheduledSearch.closeManifestContentIncomplete.yml new file mode 100644 index 0000000000000..3ab30cd1165d7 --- /dev/null +++ b/.github/policies/scheduledSearch.closeManifestContentIncomplete.yml @@ -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: diff --git a/AUTHORING_MANIFESTS.md b/AUTHORING_MANIFESTS.md index d48ad15227de4..40fba21fdf99a 100644 --- a/AUTHORING_MANIFESTS.md +++ b/AUTHORING_MANIFESTS.md @@ -66,3 +66,14 @@ If you decide to create or edit your manifest by manually editing the YAML, it i ```powershell winget validate --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 `. +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. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 22fbed2c7455f..e63a2859df3c6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 `. +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 diff --git a/Moderation.md b/Moderation.md index 8f1df4276033c..13221a45bf34c 100644 --- a/Moderation.md +++ b/Moderation.md @@ -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`