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: Create github action for triggering Bitrise E2E builds based on label #7339

Merged
merged 86 commits into from
Oct 26, 2023

Conversation

Cal-L
Copy link
Contributor

@Cal-L Cal-L commented Sep 26, 2023

Description

This PR introduces a new workflow (check-bitrise-e2e-smoke), which applies the Run Smoke E2E label to the PR, kicks off a Bitrise build (pr_smoke_e2e_pipeline), and will post a comment to the PR containing a link to the E2E build. The workflow is triggered under 4 conditions:

  1. Whenever the Run Smoke E2E label is added to a pull request
  2. When a PR is opened that is not draft
  3. When a PR goes from draft to ready for review
  4. When a PR is reopened

Manual testing steps

Scenario: Triggered by adding the Run Smoke E2E label

  1. If the Run Smoke E2E label exists on the PR, first remove it. Otherwise, skip to step two
  2. Re-add the Run Smoke E2E label back to the PR
  3. After a second or two, the Check Bitrise E2E Smoke Tests workflow will run in the CI checks
  4. Shortly after, the Run Smoke E2E label should be automatically added to the PR
  5. Once that workflow is complete, the github bot will post a comment that contains a link to the Bitrise E2E build

Scenario: Triggered by opening a non-draft PR

  1. Open a non-draft PR
  2. After a second or two, the Check Bitrise E2E Smoke Tests workflow will run in the CI checks
  3. Shortly after, the Run Smoke E2E label should be automatically added to the PR
  4. Once that workflow is complete, the github bot will post a comment that contains a link to the Bitrise E2E build

Scenario: Triggered by making a draft PR ready for review

  1. Mark the draft PR as ready for review
  2. After a second or two, the Check Bitrise E2E Smoke Tests workflow will run in the CI checks
  3. Shortly after, the Run Smoke E2E label should be automatically added to the PR
  4. Once that workflow is complete, the github bot will post a comment that contains a link to the Bitrise E2E build

Scenario: Triggered by reopening a non-draft PR

  1. Reopen a non-draft PR
  2. After a second or two, the Check Bitrise E2E Smoke Tests workflow will run in the CI checks
  3. Shortly after, the Run Smoke E2E label should be automatically added to the PR
  4. Once that workflow is complete, the github bot will post a comment that contains a link to the Bitrise E2E build

Screenshots/Recordings

Before

After

Video of the workflow being triggered by adding the Run E2E label.
https://github.com/MetaMask/metamask-mobile/assets/10508597/f6f503ac-1d61-4734-af12-cdfcecbeaec9
Screenshot 2023-10-26 at 8 53 53 AM

Video of the workflow being triggered by updating a draft PR to ready for review.
https://github.com/MetaMask/metamask-mobile/assets/10508597/fa9b8bf0-9317-4a26-9993-8f2f4d3d1e6f
Screenshot 2023-10-26 at 8 57 50 AM

Video of the workflow being triggered by reopening a PR.
https://github.com/MetaMask/metamask-mobile/assets/10508597/2acd05e2-3777-4e63-9f03-480f55f1a32b
image

Video of the workflow being triggered by opening a PR.
https://github.com/MetaMask/metamask-mobile/assets/10508597/238b3234-9a74-4b30-9893-5b5cf3591cd5
image

Comment that is posted once the build is started.
image

Related issues

Fixes #???

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained:
    • What problem this PR is solving.
    • How this problem was solved.
    • How reviewers can test my changes.
  • I’ve indicated what issue this PR is linked to: Fixes #???
  • I’ve included tests if applicable.
  • I’ve documented any added code.
  • I’ve applied the right labels on the PR (see labeling guidelines).
  • 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.

@github-actions
Copy link
Contributor

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.

@codecov-commenter
Copy link

codecov-commenter commented Sep 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (72f6690) 34.96% compared to head (59409c1) 34.96%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7339   +/-   ##
=======================================
  Coverage   34.96%   34.96%           
=======================================
  Files        1030     1030           
  Lines       27401    27401           
  Branches     2253     2253           
=======================================
  Hits         9580     9580           
  Misses      17311    17311           
  Partials      510      510           

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

@Cal-L Cal-L closed this Oct 26, 2023
@Cal-L Cal-L reopened this Oct 26, 2023
@github-actions github-actions bot unlocked this conversation Oct 26, 2023
@Cal-L Cal-L closed this Oct 26, 2023
@Cal-L Cal-L reopened this Oct 26, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 26, 2023
@github-actions github-actions bot unlocked this conversation Oct 26, 2023
@metamaskbot metamaskbot removed the INVALID-PR-TEMPLATE PR's body doesn't match template label Oct 26, 2023
@metamaskbot metamaskbot added the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Oct 26, 2023
@MetaMask MetaMask deleted a comment from github-actions bot Oct 26, 2023
@MetaMask MetaMask deleted a comment from github-actions bot Oct 26, 2023
@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/5d162c77-f888-45f5-b9ca-561097aa628d
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@sonarcloud
Copy link

sonarcloud bot commented Oct 26, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

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.

✅ ✅ ✅ ✅

@Cal-L Cal-L merged commit b4b3574 into main Oct 26, 2023
28 checks passed
@Cal-L Cal-L deleted the feature/label-triggered-e2e-test branch October 26, 2023 22:08
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Oct 26, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Oct 26, 2023
@metamaskbot metamaskbot added the release-7.11.0 Issue or pull request that will be included in release 7.11.0 label Oct 26, 2023
process.exit(1);
}
} catch (error) {
console.log(`Error occured when applying label: ${error}`);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update this to setFailed instead

Copy link
Contributor

@tommasini tommasini left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.11.0 Issue or pull request that will be included in release 7.11.0 team-mobile-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants