From b97252c70baaf55b59ee86a8b3ff18a21babdd84 Mon Sep 17 00:00:00 2001 From: Project Mu Uefibot <45776386+uefibot@users.noreply.github.com> Date: Tue, 20 Dec 2022 20:32:36 -0800 Subject: [PATCH] Repo File Sync: Synced file(s) with microsoft/mu_devops (#214) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Synced local file(s) with [microsoft/mu_devops](https://github.com/microsoft/mu_devops). 🤖: View the [Repo File Sync Configuration File](https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml) to see how files are synced. --- This PR was created automatically by the [repo-file-sync-action](https://github.com/BetaHuhn/repo-file-sync-action) workflow run [#3744565799](https://github.com/microsoft/mu_devops/actions/runs/3744565799) Signed-off-by: Project Mu UEFI Bot --- .github/advanced-issue-labeler.yml | 55 ++++++++++++++--------------- .github/pull_request_template.md | 6 ++++ .github/workflows/triage-issues.yml | 2 +- CONTRIBUTING.md | 46 ++++++++++++++++++++++++ 4 files changed, 80 insertions(+), 29 deletions(-) diff --git a/.github/advanced-issue-labeler.yml b/.github/advanced-issue-labeler.yml index b003c650ad..d0b8957292 100644 --- a/.github/advanced-issue-labeler.yml +++ b/.github/advanced-issue-labeler.yml @@ -16,33 +16,32 @@ # https://github.com/redhat-plumbers-in-action/advanced-issue-labeler policy: - - template: [bug_report.yml, documentation_request.yml, feature_request.yml] - section: + - section: - # Issue Template - Urgency Dropdown - - id: ['urgency'] - block-list: [] - label: - - name: 'urgency:low' - keys: ['Low'] - - name: 'urgency:medium' - keys: ['Medium'] - - name: 'urgency:high' - keys: ['High'] + # Issue Template - Urgency Dropdown + - id: ['urgency'] + block-list: [] + label: + - name: 'urgency:low' + keys: ['Low'] + - name: 'urgency:medium' + keys: ['Medium'] + - name: 'urgency:high' + keys: ['High'] - # Issue Template - Fix Owner Dropdown - - id: ['fix_owner', 'request_owner'] - block-list: [] - label: - - name: 'state:needs-owner' - keys: [ - 'Someone else needs to fix it', - 'Someone else needs to make the change', - 'Someone else needs to implement the feature' - ] - - name: 'state:needs-triage' - keys: [ - 'Someone else needs to fix it', - 'Someone else needs to make the change', - 'Someone else needs to implement the feature' - ] + # Issue Template - Fix Owner Dropdown + - id: ['fix_owner', 'request_owner'] + block-list: [] + label: + - name: 'state:needs-owner' + keys: [ + 'Someone else needs to fix it', + 'Someone else needs to make the change', + 'Someone else needs to implement the feature' + ] + - name: 'state:needs-triage' + keys: [ + 'Someone else needs to fix it', + 'Someone else needs to make the change', + 'Someone else needs to implement the feature' + ] diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 1004868c1d..b8f980753c 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,3 +1,9 @@ +# Preface + +Please ensure you have read the [contribution docs](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md) prior +to submitting the pull request. In particular, +[pull request guidelines](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md#pull-request-best-practices). + ## Description <_Please include a description of the change and why this change was made._> diff --git a/.github/workflows/triage-issues.yml b/.github/workflows/triage-issues.yml index 8a12fb739c..f47825d05d 100644 --- a/.github/workflows/triage-issues.yml +++ b/.github/workflows/triage-issues.yml @@ -18,5 +18,5 @@ on: types: [ opened ] jobs: - sync: + triage: uses: microsoft/mu_devops/.github/workflows/IssueTriager.yml@v1.3.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b7df7bff81..19a95214d7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,6 +46,52 @@ If you cannot find an existing issue that describes your bug or feature, create Please continue to follow your request after it is submitted to assist with any additional information that might be requested. +### Pull Request Best Practices + +Pull requests for UEFI code can become large and difficult to review due to the large number of build and +configuration files. To aid maintainers in reviewing your code, we suggest adhering to the following guidelines: + +1. Do keep code reviews single purpose; don't add more than one feature at a time. +2. Do fix bugs independently of adding features. +3. Do provide documentation and unit tests. +4. Do introduce code in digestible amounts. + * If the contribution logically be broken up into separate pull requests that independently build and function + successfully, do use multiple pull requests. + +#### Code Categories + +To keep code digestible, you may consider breaking large pull requests into three categories of commits within the pull +request. + +1. **Interfaces**: .h, .inf, .dec, documentation +2. **Implementation**: .c, unit tests, unit test build file; unit tests should build and run at this point +3. **Integration/Build**: .dec, .dsc, .fdf, (.yml) configuration files, integration tests; code added to platform and + affects downstream consumers + +By breaking the pull request into these three categories, the pull request reviewers can digest each piece +independently. + +If your commits are still very large after adhering to these categories, consider further breaking the pull request +down by library/driver; break each component into its own commit. + +#### Implementation Limits + +Implementation is ultimately composed of functions as logical units of code. + +To help maintainers review the code and improve long-term maintainability, limit functions to 60 lines of code. If your +function exceeds 60 lines of code, it likely has also exceeded a single responsibility and should be broken up. + +Files are easier to review and maintain if they contain functions that serves similar purpose. Limit files to around +1,000 lines of code (excluding comments). If your file exceeds 1,000 lines of code, it may have functions that should +be split into separate files. + +--- + +By following these guidelines, your pull requests will be reviewed faster, and you'll avoid being asked to refactor the +code to follow the guidelines. + +Feel free to create a draft pull request and ask for suggestions on how to split the pull request if you are unsure. + ## Thank You Thank you for your interest in Project Mu and taking the time to contribute!