diff --git a/.github/Pull_Request_template.md b/.github/Pull_Request_template.md index de511c0a84..b4def2e1b8 100644 --- a/.github/Pull_Request_template.md +++ b/.github/Pull_Request_template.md @@ -1,12 +1,16 @@ -### Description +## Description _Add a comprehensive description of proposed changes_ -_List issue number(s) if exist(s): #6 (for example)_ +_List associated issue number(s) if exist(s): #6 (for example)_ + +_Documentation PR (if needed): #1340 (for example)_ + +_Benchmarks PR (if needed): https://github.com/IntelPython/scikit-learn_bench/pull/155 (for example)_ --- -Checklist to comply with before moving PR from draft: +Checklist to comply with **before moving PR from draft**: **PR completeness and readability** @@ -14,15 +18,18 @@ Checklist to comply with before moving PR from draft: - [ ] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation to reflect the changes or created a separate PR with update and provided its number in the description, if necessary. - [ ] Git commit message contains an appropriate signed-off-by string _(see [CONTRIBUTING.md](https://github.com/intel/scikit-learn-intelex/blob/main/CONTRIBUTING.md#pull-requests) for details)_. -- [ ] I have added a respective label(s) to PR if I have a permission for that. +- [ ] I have added a respective label(s) to PR if I have a permission for that. - [ ] I have resolved any merge conflicts that might occur with the base branch. **Testing** -- [ ] The unit tests pass successfully. - [ ] I have run it locally and tested the changes extensively. +- [ ] All CI jobs are green or I have provided justification why they aren't. +- [ ] I have extended testing suite if new functionality was introduced in this PR. **Performance** - [ ] I have measured performance for affected algorithms using [scikit-learn_bench](https://github.com/IntelPython/scikit-learn_bench) and provided at least summary table with measured data, if performance change is expected. - [ ] I have provided justification why performance has changed or why changes are not expected. +- [ ] I have provided justification why quality metrics have changed or why changes are not expected. +- [ ] I have extended benchmarking suite and provided corresponding scikit-learn_bench PR if new measurable functionality was introduced in this PR. diff --git a/.github/workflows/pr-checklist.yml b/.github/workflows/pr-checklist.yml new file mode 100644 index 0000000000..db75d3c689 --- /dev/null +++ b/.github/workflows/pr-checklist.yml @@ -0,0 +1,69 @@ +#=============================================================================== +# Copyright 2024 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#=============================================================================== + +name: Check PR Checklist + +on: + pull_request: + types: [opened, edited, synchronize] + +jobs: + checklist: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Get pull request details + id: pr + uses: actions/github-script@v7 + with: + script: | + const pr_desc = await github.rest.pulls.get({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number + }); + console.log(pr_desc); + console.log(pr_desc.data.body); + console.log(pr_desc.data.draft); + return { + body: pr_desc.data.body, + draft: pr_desc.data.draft + }; + - name: Check if PR is not draft + id: is-not-draft + run: | + if [ "${{ steps.pr.outputs.draft }}" = "true" ]; then + echo "PR is in draft state. Exiting." + exit 0 + fi + - name: Check if all checkboxes are checked + id: checkboxes + run: | + DESCRIPTION="${{ steps.pr.outputs.body }}" + UNCHECKED=$(echo "$DESCRIPTION" | grep -c '\[ \]') + echo "::set-output name=unchecked::$UNCHECKED" + - name: Move PR to draft if not all checkboxes are checked + if: steps.checkboxes.outputs.unchecked != '0' + uses: actions/github-script@v7 + with: + script: | + await github.rest.pulls.update({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + draft: true + });