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

feat: log-merge-group-failure #12936

Merged
merged 2 commits into from
Jan 16, 2025
Merged

feat: log-merge-group-failure #12936

merged 2 commits into from
Jan 16, 2025

Conversation

itsyoboieltr
Copy link
Contributor

Description

This PR integrates the new reusable workflow (MetaMask/github-tools#31) that can be used to write data to google sheets when the merge group event fails. Environment variables (= GitHub secrets) are required to configure:

  • GOOGLE_APPLICATION_CREDENTIALS, GOOGLE_SERVICE_ACCOUNT: The google service account that is used for authentication with the google sheets api.
    • The service account needs to have access to the google sheet you intend to operate on. To give access to the google sheet, you need to click the "Share" button in the top-right corner. Enter the service account's email (can be found on google cloud console), give "Editor" permissions. After this, the service account will have access to this spreadsheet, allowing read and write operations.
  • SPREADSHEET_ID: unique identifier that can be found in the url when you open the google sheet
  • SHEET_NAME: name of a sheet in a spreadsheet that can be found on the bottom

Short summary of what happens in the workflow:

  1. Google api authentication setup
  2. Check if current date exists in the spreadsheet
  3. If current date exists, increment number of PRs by 1
  4. If current date does not exist, create a new row with the current date, and the number 1 (so that it can be incremented later, if more merge group events fail on the same day).

Spreadsheet here: https://docs.google.com/spreadsheets/d/11niHgT_E2YzzXHXQSxX5LNdA6i0GG5aa-OZWvn7_-o4

Dashboard here: https://lookerstudio.google.com/u/1/reporting/e7e8f90e-72aa-4128-ae01-6305bf3393f4/page/p_pz1dszarmd

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/3400

Manual testing steps

  1. When the workflow runs, depending on the state of the spreadsheet:
    • If the current date already exists, the number of PRs removed from the merge queue should be incremented by 1.
    • If the current date does not exist, a new row should be added with the current date, and the number of PRs should be set to 1.

I created a private repository to test it, and there it worked. The actual production usage can only be tested if we merge and see if anything gets removed from the merge queue, in this case the spreadsheet should get updated.

Screenshots/Recordings

Not applicable

Pre-merge author checklist

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.

@itsyoboieltr itsyoboieltr self-assigned this Jan 10, 2025
@itsyoboieltr itsyoboieltr requested a review from a team as a code owner January 10, 2025 18:14
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.

@itsyoboieltr itsyoboieltr added No E2E Smoke Needed If the PR does not need E2E smoke test run No QA Needed Apply this label when your PR does not need any QA effort. and removed No E2E Smoke Needed If the PR does not need E2E smoke test run labels Jan 10, 2025
@itsyoboieltr itsyoboieltr added the No E2E Smoke Needed If the PR does not need E2E smoke test run label Jan 15, 2025
Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

LGTM

@itsyoboieltr itsyoboieltr added this pull request to the merge queue Jan 16, 2025
Merged via the queue into main with commit d1946d2 Jan 16, 2025
40 checks passed
@itsyoboieltr itsyoboieltr deleted the feat/log-merge-group-failure branch January 16, 2025 16:57
@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 2025
@metamaskbot metamaskbot added the release-7.39.0 Issue or pull request that will be included in release 7.39.0 label Jan 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
No E2E Smoke Needed If the PR does not need E2E smoke test run No QA Needed Apply this label when your PR does not need any QA effort. release-7.39.0 Issue or pull request that will be included in release 7.39.0 team-extension-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants