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(action): Improve bug report creation #30176

Merged
merged 11 commits into from
Feb 19, 2025

Conversation

gauthierpetetin
Copy link
Contributor

@gauthierpetetin gauthierpetetin commented Feb 6, 2025

Description

The purpose of this improvement is to automate several steps that I currently do manually when a new release x.y.z is created:

  1. Create regression labels on public code repo (metamask-extension) and private planning repo (MetaMask-planning)
    a. regression-RC-x.y.z
    b. regression-prod-x.y.z
  2. Create bug report issue on planning repo
  3. Add the bug report issue to the Releases Github Project board
  4. Set the RC cut date on the Releases Github Project board.

These steps are important because the data pipelines of our metrics system consume the data that's present on the Releases Github Project board.

Finally this improvement includes a check to no longer re-create the bug report issue when it already exists, which used to happen sometimes when the release was re-cut, and which was disturbing other automations (e.g. wrong metrics, duplicated Slack notifications).

The following prerequisites are already met:

  • Add BUG_REPORT_TOKEN to repo secrets (fine grained access token with Issues:Write and Metadata:Read permissions for metamask-extension and MetaMask-planning repos, as well as Projects: Write permissions for MetaMask organization)
  • Add RELEASES_GITHUB_PROJECT_BOARD_NUMBER to repo variables
  • Add RELEASES_GITHUB_PROJECT_BOARD_VIEW_NUMBER to repo variables

Same PR for Mobile

Open in GitHub Codespaces

Related issues

None

Manual testing steps

  1. Go to this public code repo (equivalent of metamask-extension repo)
  2. Create a new branch with the following format: release/x.y.z (where x, y, z, are numbers)
  3. Wait for 30s, until the Github action execution is finalised
  4. Check that regression-RC-x.y.z and regression-prod-x.y.z labels have been created on the public code repo
  5. Go to this private planning repo (equivalent of MetaMask-planning repo)
  6. Check that regression-RC-x.y.z and regression-prod-x.y.z labels have been created on the private planning repo
  7. Check that the bug report issue has been created on the private planning repo and has the following title: "vx.y.z Bug Report"
  8. Go to this Github Project board
  9. Check that the bug report issue is present on the board and its "RC Cut" date is set to the current date.

In case, you don't have sufficient permissions on these test repos, here's a video where the manual testing steps are demoed.

Screenshots/Recordings

Before

None

After

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.

@gauthierpetetin gauthierpetetin added the team-extension-platform Extension Platform team label Feb 6, 2025
@gauthierpetetin gauthierpetetin self-assigned this Feb 6, 2025
Copy link
Contributor

github-actions bot commented Feb 6, 2025

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.

@metamaskbot
Copy link
Collaborator

Builds ready [4cf5e72]
Page Load Metrics (1902 ± 145 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint50326391776520250
domContentLoaded161425331872285137
load164426151902303145
domInteractive23198604622
backgroundConnect10102362713
firstReactRender1779442512
getState55215147
initialActions01000
loadScripts112019371372250120
setupStore763252210
uiStartup187329352159314151
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

The purpose of this improvement is to
automate several steps when a new release is created: the creation of regression labels on code and planning repos, the creation of bug report issue on planning repo, the addition of the bug report issue to the Releases Github Project board, and the setting of the RC cut date on the Github Project board. Finally this improvement ensures we no longer re-create the bug report issue when it already exists, which can happen when the release is re-cut.
@gauthierpetetin gauthierpetetin force-pushed the feat/create-bug-report-action branch from 4cf5e72 to c82d59b Compare February 7, 2025 12:28
@metamaskbot
Copy link
Collaborator

Builds ready [c82d59b]
Page Load Metrics (1566 ± 34 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1426171615727536
domContentLoaded1414165115386330
load1427171615667134
domInteractive227135178
backgroundConnect86927178
firstReactRender1575292211
getState54311115
initialActions01000
loadScripts1016120811145627
setupStore665182010
uiStartup1656193217786129
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

github-merge-queue bot pushed a commit to MetaMask/metamask-mobile that referenced this pull request Feb 11, 2025
## **Description**

The purpose of this improvement is to automate several steps that I
currently do manually when a new release x.y.z is created:

1. Create regression labels on public code repo (metamask-extension) and
private planning repo (MetaMask-planning)
  a. `regression-RC-x.y.z`
  b. `regression-prod-x.y.z`
2. Create bug report issue on planning repo
3. Add the bug report issue to the Releases Github Project board 
4. Set the RC cut date on the Releases Github Project board.

These steps are important because the data pipelines of our metrics
system consume the data that's present on the [Releases Github Project
board](https://github.com/orgs/MetaMask/projects/86/views/1).

Finally this improvement includes a check to no longer re-create the bug
report issue when it already exists, which used to happen sometimes when
the release was re-cut, and which was disturbing other automations (e.g.
wrong metrics, duplicated Slack notifications).

The following prerequisites are already met:

- [x] Add `BUG_REPORT_TOKEN` to repo secrets (fine grained access token
with `Issues:Write` and `Metadata:Read` permissions for metamask-mobile
and mobile-planning repos, as well as `Projects: Write` permissions for
MetaMask organization)
- [x] Add `RELEASES_GITHUB_PROJECT_BOARD_NUMBER` to repo variables
- [x] Add `RELEASES_GITHUB_PROJECT_BOARD_VIEW_NUMBER` to repo variables

[Same PR for
Extension](MetaMask/metamask-extension#30176)

## **Related issues**

None

## **Manual testing steps**

1. Go to this [public code
repo](https://github.com/gauthierpetetin-test/repo_test) (equivalent of
metamask-extension repo)
2. Create a [new
branch](https://github.com/gauthierpetetin-test/repo_test/branches) with
the following format: `release/x.y.z` (where x, y, z, are numbers)
3. Wait for 30s, until the Github action execution is finalised
4. Check that `regression-RC-x.y.z` and r`egression-prod-x.y.z` labels
have been created on the [public code
repo](https://github.com/gauthierpetetin-test/repo_test/labels)
5. Go to this [private planning
repo](https://github.com/gauthierpetetin-test/repo_test_2) (equivalent
of MetaMask-planning repo)
6. Check that `regression-RC-x.y.z` and r`egression-prod-x.y.z` labels
have been created on the [private planning
repo](https://github.com/gauthierpetetin-test/repo_test_2/labels)
7. Check that the bug report issue has been created on the [private
planning
repo](https://github.com/gauthierpetetin-test/repo_test_2/issues) and
has the following title: "vx.y.z Bug Report"
8. Go to this [Github Project
board](https://github.com/users/gauthierpetetin-test/projects/2/views/1)
9. Check that the bug report issue is present on the board and its "RC
Cut" date is set to the current date.

In case, you don't have sufficient permissions on these test repos,
here's a video where the manual testing steps are demoed.

## **Screenshots/Recordings**

### **Before**

None

### **After**

<div>
<a href="https://www.loom.com/share/0f794c36cb6843809afed9472e396830">
      <p>Github action to automate bug report creation - Watch Video</p>
    </a>
<a href="https://www.loom.com/share/0f794c36cb6843809afed9472e396830">
<img style="max-width:300px;"
src="https://cdn.loom.com/sessions/thumbnails/0f794c36cb6843809afed9472e396830-6d9405bba082fb85-full-play.gif">
    </a>
  </div>

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
In some cases, the Github Project board includes private issues that can't be access by the access token we're using. For example the access token used on Extension repo can't access Mobile planning issues and vice-versa.
@metamaskbot
Copy link
Collaborator

Builds ready [f893bc6]
Page Load Metrics (1745 ± 60 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint40119741634407195
domContentLoaded14961952171212962
load15401976174512660
domInteractive19523495
backgroundConnect106341199
firstReactRender1676362412
getState55313105
initialActions01000
loadScripts10751457124511053
setupStore75616168
uiStartup17772340199415976
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Contributor

@itsyoboieltr itsyoboieltr left a comment

Choose a reason for hiding this comment

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

Overall LGTM, small changes requested.

@metamaskbot
Copy link
Collaborator

Builds ready [92a7ef0]
Page Load Metrics (1820 ± 85 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15542202181617283
domContentLoaded15482190179017283
load15532206182017785
domInteractive2610440189
backgroundConnect1081322311
firstReactRender1792352512
getState666292311
initialActions00000
loadScripts10581586129715574
setupStore86518189
uiStartup18262463213219292
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@itsyoboieltr
Copy link
Contributor

One more thing: Since this logic is shared between mobile and extension, the contents of this PR actually belong to the github-tools repository, where the other reusable workflows are stored. It is ok to merge this PR until the reusable workflow is created in github-tools, but later a follow-up PR will be needed to replace this implementation with the reusable one.

@gauthierpetetin
Copy link
Contributor Author

Thank you very much for the detailed reviews. I have made the suggested changes and successfully re-tested everything on my test repo. I will create a PR to replicate those changes in the Mobile repo to maintain code parity between the two. This will allow me to then move everything to the github-tools repo.

@metamaskbot
Copy link
Collaborator

Builds ready [2658653]
Page Load Metrics (1523 ± 44 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint24217371462294141
domContentLoaded1354168015038541
load1362173715239144
domInteractive2494412411
backgroundConnect86225189
firstReactRender1575412512
getState411721
initialActions01000
loadScripts948126410858239
setupStore76917189
uiStartup15412280174515474
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [2681404]
Page Load Metrics (1795 ± 61 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint24120381558561270
domContentLoaded16082031177112661
load16372041179512661
domInteractive27120492613
backgroundConnect974272110
firstReactRender1497392713
getState581212211
initialActions01000
loadScripts11531564127510751
setupStore76517178
uiStartup18782474209715574
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

itsyoboieltr
itsyoboieltr previously approved these changes Feb 18, 2025
Copy link
Contributor

@itsyoboieltr itsyoboieltr left a comment

Choose a reason for hiding this comment

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

LGTM!

@metamaskbot
Copy link
Collaborator

Builds ready [7178a59]
Page Load Metrics (1612 ± 50 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint14741799160410550
domContentLoaded14371788158210349
load14751802161210450
domInteractive208436178
backgroundConnect1073362210
firstReactRender1373352412
getState45413136
initialActions01000
loadScripts1012133911419646
setupStore65314136
uiStartup16682035183411555
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@DDDDDanica
Copy link
Contributor

LGTM !

@gauthierpetetin gauthierpetetin added this pull request to the merge queue Feb 19, 2025
Merged via the queue into main with commit af66eb6 Feb 19, 2025
73 checks passed
@gauthierpetetin gauthierpetetin deleted the feat/create-bug-report-action branch February 19, 2025 11:18
@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2025
@metamaskbot metamaskbot added the release-12.14.0 Issue or pull request that will be included in release 12.14.0 label Feb 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.14.0 Issue or pull request that will be included in release 12.14.0 team-extension-platform Extension Platform team
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants