Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Post comment after e2e smoke (MetaMask#8495)
## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> The purpose of these changes is to add a Github check for checking E2E smoke test run status (for PRs that have `Run Smoke E2E` label applied). Under the hood, the action does the following: - Take the latest Bitrise comment, which is posted after the `Run Smoke E2E` label is applied - Extract the commit hash from the comment body - Compare the hash against a list of commits - The list of commits to check against - Starting with the latest commit and moving backwards, it includes all merge from main (from pressing the update with main button) up to the latest non-merge from main commit (a commit that the contributor pushed up) - If the comment commit hash does not match any from the list, the check fails since there is no comment associated with the list of commits - If the comment commit hash does match something from the list, the action checks the build status listed in the comment - If it's pending or failed, then the action fails and the PR is blocked from merge. If it's a success status, then the action passes and the PR is unblocked for merge ## **Related issues** Fixes: ## **Manual testing steps** Scenario `Check Bitrise E2E status` will fail if Bitrise status comment with last non-merge commit hash either doesn't exist, is pending, or failed - GIVEN The Bitrise E2E status check runs - AND The `Run Smoke E2E` label is applied - AND A Bitrise status comment with last non-merge commit hash either doesn't exist, is pending, or failed - THEN the Bitrise E2E status check will fail Scenario `Check Bitrise E2E status` will pass if Bitrise E2E smoke comment with last non-merge commit hash is posted as a successful build - GIVEN The Bitrise E2E status check runs - AND The `Run Smoke E2E` label is applied - AND A Bitrise status comment with last non-merge commit hash shows passed - THEN the E2E comment check will pass and PR merge should be unblocked Scenario `Check Bitrise E2E status` will pass if E2E smoke label is applied - GIVEN The Bitrise E2E status check runs - AND The `Run E2E Smoke` label is not applied to the PR - THEN the E2E comment check will pass and PR merge should be unblocked ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> Check fails when comment shows pending https://github.com/MetaMask/metamask-mobile/assets/10508597/01be00e3-a0e8-4c14-96eb-e884d9829507 Check fails since no Bitrise comment exists with latest commit https://github.com/MetaMask/metamask-mobile/assets/10508597/ab0ac40d-322f-4f1f-9bff-ee2cc3ef436e Check passes with Bitrise comment showing pass on latest commit https://github.com/MetaMask/metamask-mobile/assets/10508597/9ffbd0c5-4b3b-426d-9396-cfb271da8422 Check passes with Bitrise comment showing pass on latest non-main merge commit https://github.com/MetaMask/metamask-mobile/assets/10508597/415fb89c-a873-4a4f-86c5-afc06c0d6a90 Comment shows failed when Bitrise build fails. Check will also detect this and fail. https://github.com/MetaMask/metamask-mobile/assets/10508597/aee06b95-06b8-4861-8611-d2cdda219fd4 Check passes with Bitrise comment showing pass on a later merge from main commit https://github.com/MetaMask/metamask-mobile/assets/10508597/dacc0c99-e2a4-434c-be7a-00e63cb34c14 ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've clearly explained what problem this PR is solving and how it is solved. - [ ] I've linked related issues - [ ] I've included manual testing steps - [ ] I've included screenshots/recordings if applicable - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [ ] I’ve properly set the pull request status: - [ ] In case it's not yet "ready for review", I've set it to "draft". - [ ] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
- Loading branch information