From f5578c1e50f4b6f9cfbe293cf5a570f8c1f2cb47 Mon Sep 17 00:00:00 2001 From: sharanya-appsmith <135708039+sharanya-appsmith@users.noreply.github.com> Date: Fri, 5 Jan 2024 18:11:01 +0530 Subject: [PATCH] ci: Added step to check if @tag.All is given as expected. (#29926) ## Description > Added step to check if @tag.All mentioned is as expected, if not throw a message to use `/ok-to-test tags="@tag.All"` and exit the run #### Type of change - Chore (housekeeping or task changes that don't impact user perception) ## Testing > TBP with tags #### How Has This Been Tested? - [x] Manual - [x] TBP > ## Checklist: #### Dev activity - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed ## Summary by CodeRabbit ## Summary by CodeRabbit The existing bullet-point list is still valid and does not need to be updated. --- .../workflows/integration-tests-command.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-tests-command.yml b/.github/workflows/integration-tests-command.yml index 66c9bf7181f1..1dd6d50fced7 100644 --- a/.github/workflows/integration-tests-command.yml +++ b/.github/workflows/integration-tests-command.yml @@ -24,7 +24,7 @@ jobs: with: issue-number: ${{ github.event.client_payload.pull_request.number }} body: | - The provided command lacks any tags. Please execute '/ok-to-test' again, specifying the tags you want to include or use `@tag.All` to run all specs. + The provided command lacks any tags. Please execute '/ok-to-test' again, specifying the tags you want to include or use `/ok-to-test tags="@tag.All"` to run all specs. Explore the tags documentation [here](https://www.notion.so/appsmith/Ok-to-test-With-Tags-7c0fc64d4efb4afebf53348cd6252918) - name: Stop the workflow run if tags are not present @@ -36,7 +36,9 @@ jobs: id: checkAll run: | tags="${{ github.event.client_payload.slash_command.args.named.tags }}" - if [[ $tags == *"@tag.All"* ]]; then + if [[ ($tags == *"ALL"* || $tags == *"All"* || $tags == *"all"*) && $tags != *"@tag.All"* ]]; then + echo "invalid_tags_all=$tags" >> $GITHUB_OUTPUT + elif [[ $tags == *"@tag.All"* ]]; then echo "tags=" >> $GITHUB_OUTPUT echo "matrix=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59]" >> $GITHUB_OUTPUT else @@ -44,6 +46,19 @@ jobs: echo "matrix=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]" >> $GITHUB_OUTPUT fi + - name: Add comment to use correct @tag.All format + if: steps.checkAll.outputs.invalid_tags_all != '' + uses: peter-evans/create-or-update-comment@v3 + with: + issue-number: ${{ github.event.client_payload.pull_request.number }} + body: | + Please use `/ok-to-test tags="@tag.All"` to run all specs. + Explore the tags documentation [here](https://www.notion.so/appsmith/Ok-to-test-With-Tags-7c0fc64d4efb4afebf53348cd6252918) + + - name: Stop the workflow run if given @tag.All format is wrong + if: steps.checkAll.outputs.invalid_tags_all != '' + run: exit 1 + # This step creates a comment on the PR with a link to this workflow run. - name: Add a comment on the PR with link to workflow run if: steps.checkTags.outputs.tags == 'true'