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

fix(action): add a workaround for known bots #27019

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

gauthierpetetin
Copy link
Contributor

@gauthierpetetin gauthierpetetin commented Sep 10, 2024

Description

Bots like "devin-ai-integration" are not Github users, which leads to the following error when the Github action is executed on PRs created by bots.

Same PR for Mobile repo.

This PR adds a workaround for known bots.

Open in GitHub Codespaces

Related issues

Fixes: #27037

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

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.

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.

Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the quick fix @gauthierpetetin 🙏 🔥

Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

Hmm looks like it's still failing. I got Devin AI to duplicate the updates here and create a new PR so I can use that to test #27040

@georgewrmarshall georgewrmarshall self-requested a review September 10, 2024 16:15
@gauthierpetetin
Copy link
Contributor Author

gauthierpetetin commented Sep 10, 2024

The error message in the test PR you prepared shows userBelongsToMetaMaskOrg function is being called.
I don't understand how this can happen. Given that labelable?.author equals "devin-ai-integration", we shall not be able to reach line 87 of this script.

@gauthierpetetin
Copy link
Contributor Author

gauthierpetetin commented Sep 16, 2024

Hi @georgewrmarshall , I just tried it out on a test repo:

  • Here's an issue I created BEFORE adding myself (@gauthierpetetin ) to the list of known bots => The Github action ran successfully and external-contributor label was added, which indicates userBelongsToMetaMaskOrg function was executed and returned false
  • Here's another issue I created AFTER adding myself (@gauthierpetetin ) to the list of known bots (cf. this commit) => The Github action ran successfully and external-contributor label was not added, which indicates userBelongsToMetaMaskOrg function hasn't been executed (which is expected behaviour for knownBots)

@hjetpoluru hjetpoluru self-requested a review September 16, 2024 12:39
Copy link
Contributor

@hjetpoluru hjetpoluru left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

Copy link

codecov bot commented Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.96%. Comparing base (aeb91c9) to head (76669a9).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #27019   +/-   ##
========================================
  Coverage    69.96%   69.96%           
========================================
  Files         1441     1441           
  Lines        50102    50102           
  Branches     14012    14012           
========================================
  Hits         35049    35049           
  Misses       15053    15053           

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

@metamaskbot
Copy link
Collaborator

Builds ready [76669a9]
Page Load Metrics (1694 ± 103 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint21721021573422203
domContentLoaded141520951673213102
load142421001694214103
domInteractive12103392814
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

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

I was under the impression the actions were run from the PR and not from develop, which is why I expected the tests to pass in this duplicate PR that I had Devin create. Let's merge and test!

Screenshot 2024-09-16 at 3 56 20 PM

@georgewrmarshall georgewrmarshall merged commit 0100886 into develop Sep 16, 2024
78 checks passed
@georgewrmarshall georgewrmarshall deleted the fix/github-action-for-known-bots branch September 16, 2024 22:55
@github-actions github-actions bot locked and limited conversation to collaborators Sep 16, 2024
@metamaskbot metamaskbot added the release-12.6.0 Issue or pull request that will be included in release 12.6.0 label Sep 16, 2024
@metamaskbot metamaskbot added release-12.5.0 Issue or pull request that will be included in release 12.5.0 and removed release-12.6.0 Issue or pull request that will be included in release 12.6.0 labels Sep 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.5.0 Issue or pull request that will be included in release 12.5.0 team-extension-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Bug]: Check Template and Add Labels Test Fails When Devin AI Creates a PR
5 participants