From 9a7900b0cb24c8c159e144741ea2dca44b4b12ed Mon Sep 17 00:00:00 2001 From: dennisvankekem Date: Thu, 19 Dec 2024 14:02:14 +0100 Subject: [PATCH 1/7] feat: pr checklist --- .github/pull_request_template.md | 12 +++++++++ .github/workflows/checklist.yml | 45 ++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/checklist.yml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..fbc086bd2 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,12 @@ +## Checklist + +- [ ] I have tested the changes in both light and dark mode. +- [ ] I have run all unit tests and ensured they pass. +- [ ] I have considered the need for new unit tests. +- [ ] I have tested the changes on a cluster. +- [ ] I have included relevant documentation updates. +- [ ] I have an approved Figma design or have reflected my changes in Figma +- [ ] I have verified that the UI/UX is consistent in major browsers (e.g., Chrome, Firefox, Safari, Edge). +- [ ] I have tested the changes on mobile devices or simulators to ensure responsiveness. +- [ ] I have tested expected error states and verified that the user is presented with informative error messages. +- [ ] I have tested the feature with unusual or extreme inputs (e.g., very long strings, empty states, clicking a button multiple times quickly). diff --git a/.github/workflows/checklist.yml b/.github/workflows/checklist.yml new file mode 100644 index 000000000..7065af0ec --- /dev/null +++ b/.github/workflows/checklist.yml @@ -0,0 +1,45 @@ +name: Enforce Checklist + +on: + pull_request: + types: [opened, edited, synchronize] + +jobs: + check-checklist: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v2 + + - name: Get PR details + id: pr + uses: actions-ecosystem/action-get-PR-info@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Validate Checklist + run: | + PR_BODY="${{ steps.pr.outputs.body }}" + + # 1. Check for "## Checklist" section + if ! echo "$PR_BODY" | grep -q "^## Checklist"; then + echo "No '## Checklist' section found in the PR description." + exit 1 + fi + + # 2. Check that there is at least one checkbox line ('- [ ]' or '- [x]') + # We'll consider any line that starts with '- [' as a checklist item. + CHECKBOX_COUNT=$(echo "$PR_BODY" | grep "^- \[" | wc -l) + if [ "$CHECKBOX_COUNT" -eq 0 ]; then + echo "No checklist items found under '## Checklist'." + exit 1 + fi + + # 3. Ensure all checkbox items are ticked (i.e., no '- [ ]' remain). + UNCHECKED_COUNT=$(echo "$PR_BODY" | grep "^- \[ \]" | wc -l) + if [ "$UNCHECKED_COUNT" -gt 0 ]; then + echo "Not all checklist items are checked. Please tick all boxes." + exit 1 + fi + + echo "All checks passed. The checklist is present and fully checked." From db4cf6b77485cff85b5ffd249f90157581134fe7 Mon Sep 17 00:00:00 2001 From: dennisvankekem Date: Thu, 19 Dec 2024 14:13:43 +0100 Subject: [PATCH 2/7] fix: removed depricated step --- .github/workflows/checklist.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/checklist.yml b/.github/workflows/checklist.yml index 7065af0ec..95b76972b 100644 --- a/.github/workflows/checklist.yml +++ b/.github/workflows/checklist.yml @@ -11,15 +11,11 @@ jobs: - name: Check out repository uses: actions/checkout@v2 - - name: Get PR details - id: pr - uses: actions-ecosystem/action-get-PR-info@v1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - + # Extract the PR body directly from the GitHub event payload - name: Validate Checklist run: | - PR_BODY="${{ steps.pr.outputs.body }}" + # Use jq to parse the pull_request body from the event payload + PR_BODY=$(jq -r .pull_request.body "$GITHUB_EVENT_PATH") # 1. Check for "## Checklist" section if ! echo "$PR_BODY" | grep -q "^## Checklist"; then @@ -27,15 +23,14 @@ jobs: exit 1 fi - # 2. Check that there is at least one checkbox line ('- [ ]' or '- [x]') - # We'll consider any line that starts with '- [' as a checklist item. + # 2. Check that there is at least one checkbox line CHECKBOX_COUNT=$(echo "$PR_BODY" | grep "^- \[" | wc -l) if [ "$CHECKBOX_COUNT" -eq 0 ]; then echo "No checklist items found under '## Checklist'." exit 1 fi - # 3. Ensure all checkbox items are ticked (i.e., no '- [ ]' remain). + # 3. Ensure all checkbox items are ticked UNCHECKED_COUNT=$(echo "$PR_BODY" | grep "^- \[ \]" | wc -l) if [ "$UNCHECKED_COUNT" -gt 0 ]; then echo "Not all checklist items are checked. Please tick all boxes." From b7bce8c8dbe0b2ac364bd231c595f604a15065b3 Mon Sep 17 00:00:00 2001 From: Dennis van Kekem <38350840+dennisvankekem@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:16:45 +0100 Subject: [PATCH 3/7] Rename pull_request_template.md to PULL_REQUEST_TEMPLATE.md --- .github/{pull_request_template.md => PULL_REQUEST_TEMPLATE.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{pull_request_template.md => PULL_REQUEST_TEMPLATE.md} (100%) diff --git a/.github/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from .github/pull_request_template.md rename to .github/PULL_REQUEST_TEMPLATE.md From 1edfe8d20e64721f3c304a7d455733737bda888b Mon Sep 17 00:00:00 2001 From: Dennis van Kekem <38350840+dennisvankekem@users.noreply.github.com> Date: Fri, 20 Dec 2024 09:46:07 +0100 Subject: [PATCH 4/7] removed test pass check --- .github/PULL_REQUEST_TEMPLATE.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index fbc086bd2..55ff5e837 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,7 +1,6 @@ ## Checklist - [ ] I have tested the changes in both light and dark mode. -- [ ] I have run all unit tests and ensured they pass. - [ ] I have considered the need for new unit tests. - [ ] I have tested the changes on a cluster. - [ ] I have included relevant documentation updates. From 36313c10ec9aa2ce21f331d8c5d7dfac719d63b5 Mon Sep 17 00:00:00 2001 From: Dennis van Kekem <38350840+dennisvankekem@users.noreply.github.com> Date: Thu, 2 Jan 2025 15:35:02 +0100 Subject: [PATCH 5/7] Delete .github/workflows/checklist.yml --- .github/workflows/checklist.yml | 40 --------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 .github/workflows/checklist.yml diff --git a/.github/workflows/checklist.yml b/.github/workflows/checklist.yml deleted file mode 100644 index 95b76972b..000000000 --- a/.github/workflows/checklist.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Enforce Checklist - -on: - pull_request: - types: [opened, edited, synchronize] - -jobs: - check-checklist: - runs-on: ubuntu-latest - steps: - - name: Check out repository - uses: actions/checkout@v2 - - # Extract the PR body directly from the GitHub event payload - - name: Validate Checklist - run: | - # Use jq to parse the pull_request body from the event payload - PR_BODY=$(jq -r .pull_request.body "$GITHUB_EVENT_PATH") - - # 1. Check for "## Checklist" section - if ! echo "$PR_BODY" | grep -q "^## Checklist"; then - echo "No '## Checklist' section found in the PR description." - exit 1 - fi - - # 2. Check that there is at least one checkbox line - CHECKBOX_COUNT=$(echo "$PR_BODY" | grep "^- \[" | wc -l) - if [ "$CHECKBOX_COUNT" -eq 0 ]; then - echo "No checklist items found under '## Checklist'." - exit 1 - fi - - # 3. Ensure all checkbox items are ticked - UNCHECKED_COUNT=$(echo "$PR_BODY" | grep "^- \[ \]" | wc -l) - if [ "$UNCHECKED_COUNT" -gt 0 ]; then - echo "Not all checklist items are checked. Please tick all boxes." - exit 1 - fi - - echo "All checks passed. The checklist is present and fully checked." From eae98d5f3ade21f21cc04778c5651fd9ad9d0738 Mon Sep 17 00:00:00 2001 From: Dennis van Kekem <38350840+dennisvankekem@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:40:49 +0100 Subject: [PATCH 6/7] Update PULL_REQUEST_TEMPLATE.md --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 55ff5e837..285191d7b 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,6 +6,6 @@ - [ ] I have included relevant documentation updates. - [ ] I have an approved Figma design or have reflected my changes in Figma - [ ] I have verified that the UI/UX is consistent in major browsers (e.g., Chrome, Firefox, Safari, Edge). -- [ ] I have tested the changes on mobile devices or simulators to ensure responsiveness. +- [ ] I have tested the changes for responsiveness in different screen resolutions. - [ ] I have tested expected error states and verified that the user is presented with informative error messages. - [ ] I have tested the feature with unusual or extreme inputs (e.g., very long strings, empty states, clicking a button multiple times quickly). From 82fc12cbd662934686aa97820959ffc86a5f43ab Mon Sep 17 00:00:00 2001 From: Dennis van Kekem <38350840+dennisvankekem@users.noreply.github.com> Date: Tue, 7 Jan 2025 13:44:31 +0100 Subject: [PATCH 7/7] Update PULL_REQUEST_TEMPLATE.md --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 285191d7b..d6b803c15 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,4 +1,4 @@ -## Checklist +## Considerations - [ ] I have tested the changes in both light and dark mode. - [ ] I have considered the need for new unit tests.