From 4d3ee646ab9bd71c13691e828a57df3e0fa3bc2b Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Sat, 15 Jun 2024 21:29:51 -0700 Subject: [PATCH 1/3] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 30 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 +++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..7557a1d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,30 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Use WorkUnit submit.. +2. Add parameters.... + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. Windows, Mac, Linux] + - Version [e.g. 22] + + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From 431dba99d7a16c854e276af04339efa731e3a037 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Sat, 15 Jun 2024 22:09:38 -0700 Subject: [PATCH 2/3] PR Validation template and changes to PR Template --- .github/pull_request_template.md | 2 +- .github/workflows/pr.yaml | 43 ++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pr.yaml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 946134c..852df28 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -5,7 +5,7 @@ -Fixes # +Fixes [#](https://hpccsystems.atlassian.net/browse/HPCC-) ### Type of change: diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..636dc76 --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,43 @@ +name: Pull Request Checker +on: + pull_request_target: + types: + - opened + - reopened + branches: + - main + +jobs: + check-pr: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - uses: actions/github-script@v7 + with: + script: | + const pr = await github.rest.pulls.get({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.issue.number + }) + const isTitleValid = /^\[#\d+\] /.test(pr.data.title) + const isDescriptionValid = /([Ff]ix(es|ed)?|[Cc]lose(s|d)?|[Rr]esolve(s|d)?|[Pp]art [Oo]f) \(.*\)\[.*\]/.test(pr.data.body) + if (isTitleValid && isDescriptionValid) { + return + } + let body = `Hi @${pr.data.user.login}, thank you for your interest in contributing to PyHPCC! + However, your PR does not appear to follow our [contribution guidelines](CONTRIBUTING.md):\n\n` + if (!isTitleValid) { + body += "- Title must start with the issue number the PR is fixing in square brackets, e.g. `[#]`\n" + } + if (!isDescriptionValid) { + body += "- Description must reference the issue number the PR is fixing, e.g. `Fixes #` (or `Part of #` if the PR does not address the issue fully)\n" + } + body += "\nPlease address the above before we proceed to review your PR." + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body, + }) \ No newline at end of file From 12bbb74034f46a3d5b03581ce68d41ee8aaba3c6 Mon Sep 17 00:00:00 2001 From: Rohith Surya Podugu Date: Sat, 15 Jun 2024 22:11:06 -0700 Subject: [PATCH 3/3] Change version to pyhpcc version --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 7557a1d..7fc4156 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -23,7 +23,7 @@ If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - OS: [e.g. Windows, Mac, Linux] - - Version [e.g. 22] + - PyHPCC Version [e.g. 22] **Additional context**