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

Github action to check issue body matches issues templates and add labels to issue when needed #21184

Merged
merged 6 commits into from
Oct 12, 2023

Conversation

gauthierpetetin
Copy link
Contributor

@gauthierpetetin gauthierpetetin commented Oct 4, 2023

Description

This PR introduces a new Github action, to achieve the following:

  1. Check if issue matches an existing issue template ('general-issue.yml' or 'bug-report.yml')
  2. Add an INVALID-ISSUE-TEMPLATE label in case issue doesn't match any of the templates
  3. Add an external-contributor label in case issue was created by someone external to the MetaMask organisation
  4. Add a regression-prod-x.y.z label when possible, when x.y.z value can be extracted from 'bug-report.yml' template

We will be able to leverage regression-prod-x.y.z and external-contributor labels to improve our bug triage process and our metrics collection.

Same PR for Mobile repo

Manual testing steps

  1. Go on this test repo
  2. Fill the bug report issue form
  3. Make sure the release version you indicate in the form has x.y.z format
  4. Click on "Submit new issue"
  5. Wait for ~30s and 2 new labels shall appear on the issue you just created (regression-prod-x.y.z and external-contributor)
  6. Edit the issue's description by indicating a different release version
  7. Wait for ~30s and the regression-prod-x.y.z shall be updated accordingly
  8. Edit the issue by deleting the whole description
  9. Wait for ~30s and the INVALID-ISSUE-TEMPLATE shall be added

Screenshots/Recordings

Before

NA

After

https://recordit.co/Sq7fvCwkr5

Related issues

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

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.

…tected with a label

The new bug report template makes it mandatory to indicate what release version the bug was detected in. We want to exploit that information by extracting the version number from issue body and indicate it by adding corresponding regression prod label on the issue. In addition to it, we also want to add a label to indicate when the bug has been reported by someone external to the MetaMask organisation. We will be able to leverage these two new labels to improve our bug triage process and our metrics collection.
@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

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.

…s to achieve

The github action was initially only meant to add regression-prod labels while the scope is nox extended, which is why it's worth renaming a few things to reflect it.
@metamaskbot
Copy link
Collaborator

Builds ready [a7778a0]
Page Load Metrics (810 ± 373 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint871741072210
domContentLoaded751731002210
load881832810777373
domInteractive751731002210
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@gauthierpetetin gauthierpetetin changed the title New action to indicate release version where bug was detected with a label Github action to check issue body matches issues templates and add labels to issue when needed Oct 5, 2023
brad-decker
brad-decker previously approved these changes Oct 5, 2023
@metamaskbot
Copy link
Collaborator

Builds ready [3b4b907]
Page Load Metrics (635 ± 352 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint811811022210
domContentLoaded65185932713
load761779635733352
domInteractive65185932713
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (3d780ce) 68.62% compared to head (df4ea3f) 68.62%.
Report is 12 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #21184   +/-   ##
========================================
  Coverage    68.62%   68.62%           
========================================
  Files         1018     1018           
  Lines        40828    40828           
  Branches     10901    10901           
========================================
  Hits         28015    28015           
  Misses       12813    12813           

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

@metamaskbot
Copy link
Collaborator

Builds ready [7eb06e6]
Page Load Metrics (1015 ± 357 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint88142106168
domContentLoaded7213998189
load8417841015743357
domInteractive7213998188
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

…iles

Nicholas Ellul raised that the script would not be able to retrieve list of organisations for users who have their GitHub set to private mode. As a consequence, these users would appear as external contributors while they are not. This commit introduces a different way to check if users belong to the MetaMask organisation, which allows to support even users with private profiles.
@metamaskbot
Copy link
Collaborator

Builds ready [df4ea3f]
Page Load Metrics (643 ± 355 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint831701002110
domContentLoaded6714691188
load781756643739355
domInteractive6714691188
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

gauthierpetetin added a commit to MetaMask/metamask-mobile that referenced this pull request Oct 11, 2023
…d labels to issue when needed (#7379)

## **Description**

This PR introduces a new Github action, to achieve the following:
1. Check if issue matches an existing issue template
('general-issue.yml' or 'bug-report.yml')
2. Add an `INVALID-ISSUE-TEMPLATE` label in case issue doesn't match any
of the templates
3. Add an `external-contributor` label in case issue was created by
someone external to the MetaMask organisation
4. Add a `regression-prod-x.y.z` label when possible, when `x.y.z` value
can be extracted from 'bug-report.yml' template

We will be able to leverage `regression-prod-x.y.z` and
`external-contributor` labels to improve our bug triage process and our
metrics collection.

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

## **Manual testing steps**

1. Go on this [test
repo](https://github.com/gauthierpetetin-test/repo_test/issues/new?assignees=&labels=type-bug&projects=&template=bug-report-extension.yml&title=%5BBug%5D%3A+)
2. Fill the bug report issue form
6. Make sure the release version you indicate in the form has x.y.z
format
7. Click on "Submit new issue"
8. Wait for ~30s and 2 new labels shall appear on the issue you just
created (`regression-prod-x.y.z` and `external-contributor`)
9. Edit the issue's description by indicating a different release
version
10. Wait for ~30s and the `regression-prod-x.y.z` shall be updated
accordingly
11. Edit the issue by deleting the whole description
12. Wait for ~30s and the `INVALID-ISSUE-TEMPLATE` shall be added
 
## **Screenshots/Recordings**

### **Before**

NA

### **After**

https://recordit.co/Sq7fvCwkr5

## **Related issues**

Fixes MetaMask/mobile-planning#1293

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've clearly explained:
  - [x] What problem this PR is solving.
  - [x] How this problem was solved.
  - [x] How reviewers can test my changes.
- [x] I’ve indicated what issue this PR is linked to: Fixes #???
- [ ] I’ve included tests if applicable.
- [x] I’ve documented any added code.
- [x] 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)).
- [x] I’ve properly set the pull request status:
  - [ ] In case it's not yet "ready for review", I've set it to "draft".
- [x] 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.

---------

Co-authored-by: Cal Leung <cleun007@gmail.com>
@gauthierpetetin gauthierpetetin merged commit dad057b into develop Oct 12, 2023
@gauthierpetetin gauthierpetetin deleted the feat/bug-report-labeling branch October 12, 2023 12:25
@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2023
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Oct 12, 2023
@metamaskbot metamaskbot added the release-11.4.0 Issue or pull request that will be included in release 11.4.0 label Oct 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-11.4.0 Issue or pull request that will be included in release 11.4.0 team-extension-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants