Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Post comment after e2e smoke #8495

Merged
merged 85 commits into from
Feb 28, 2024
Merged

ci: Post comment after e2e smoke #8495

merged 85 commits into from
Feb 28, 2024

Conversation

Cal-L
Copy link
Contributor

@Cal-L Cal-L commented Feb 1, 2024

Description

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: https://github.com/MetaMask/mobile-planning/issues/1552

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

Before

After

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.
  • 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 format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). 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.

@Cal-L Cal-L requested a review from a team as a code owner February 1, 2024 07:37
Copy link
Contributor

github-actions bot commented Feb 1, 2024

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@Cal-L Cal-L marked this pull request as draft February 1, 2024 07:38
@Cal-L Cal-L added the Run Smoke E2E Triggers smoke e2e on Bitrise label Feb 1, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.60%. Comparing base (224f737) to head (af333f3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8495   +/-   ##
=======================================
  Coverage   41.60%   41.60%           
=======================================
  Files        1267     1267           
  Lines       30722    30722           
  Branches     3062     3062           
=======================================
  Hits        12781    12781           
  Misses      17171    17171           
  Partials      770      770           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Cal-L Cal-L added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Feb 6, 2024
@Cal-L Cal-L added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Feb 6, 2024
@Cal-L Cal-L added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Feb 6, 2024
@Cal-L Cal-L added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Feb 7, 2024
@Cal-L Cal-L removed the Run Smoke E2E Triggers smoke e2e on Bitrise label Feb 7, 2024
@Cal-L Cal-L added the Run Smoke E2E Triggers smoke e2e on Bitrise label Feb 7, 2024
@MetaMask MetaMask deleted a comment from github-actions bot Feb 7, 2024
@Cal-L Cal-L removed the Run Smoke E2E Triggers smoke e2e on Bitrise label Feb 7, 2024
@MetaMask MetaMask deleted a comment from github-actions bot Feb 7, 2024
@MetaMask MetaMask deleted a comment from github-actions bot Feb 7, 2024
@MetaMask MetaMask deleted a comment from github-actions bot Feb 7, 2024
@Cal-L Cal-L removed the android Android specific issue label Feb 28, 2024
@Cal-L
Copy link
Contributor Author

Cal-L commented Feb 28, 2024

Can you explain the issue that it fixes or point to a GH issue?

Updated description to describe behavior - #8495 (comment)
Issue is connected to ticket - https://github.com/MetaMask/mobile-planning/issues/1552

@Cal-L Cal-L added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Feb 28, 2024
@MetaMask MetaMask deleted a comment from github-actions bot Feb 28, 2024
@Cal-L Cal-L added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Feb 28, 2024
Copy link
Contributor

github-actions bot commented Feb 28, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 6036a02
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/dee376b7-aec3-4afa-8550-b96c5e1ccf82

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@M111111111r

This comment was marked as spam.

@Cal-L Cal-L added android Android specific issue and removed android Android specific issue labels Feb 28, 2024
@Cal-L Cal-L added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Feb 28, 2024
Copy link
Contributor

github-actions bot commented Feb 28, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 1c3435f
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/8e9a0f82-0ee6-440f-8d87-93f818d1ed7b

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Copy link

sonarcloud bot commented Feb 28, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Member

@cortisiko cortisiko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is massive! Good stuff Cal!!! 🌮 🌮 🌮 🌮

@Cal-L Cal-L added android Android specific issue and removed android Android specific issue labels Feb 28, 2024
@Cal-L Cal-L merged commit a386010 into main Feb 28, 2024
37 of 41 checks passed
@Cal-L Cal-L deleted the ci/bitrise-message-check branch February 28, 2024 23:31
@github-actions github-actions bot locked and limited conversation to collaborators Feb 28, 2024
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Feb 28, 2024
@metamaskbot metamaskbot added release-7.18.0 Issue or pull request that will be included in release 7.18.0 issues-found labels Feb 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issues-found No QA Needed/E2E Only Apply this label when your PR does not need any QA effort. release-7.18.0 Issue or pull request that will be included in release 7.18.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-mobile-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

6 participants