Fix check-for-reproducer action not adding Missing Repro comment#38531
Fix check-for-reproducer action not adding Missing Repro comment#38531kacperkapusciak wants to merge 6 commits intofacebook:mainfrom
Conversation
Base commit: 5705661 |
If having a bot with a PAT can solve this, I'll gladly set up one for @react-native-bot and add the token to the setup |
I'm afraid of a case where there would an infinite loop somewhere I haven't tested yet (or 20 max invocations as GitHub docs says) so maybe it's better to have it that way |
What do you mean with "that way" here? |
|
@cortinico sorry, I meant without the PAT so loops in GH action invocation wouldn't be possible. I think it's safer |
|
@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
@cortinico I coded it so it when a non-author (a maintainer) alters the "Needs: Repro" label it turns off the action completely Q: Do you think it should attempt to remove the "Missing Repro" comment when a maintainer removes the label before it turns off? |
|
@cortinico merged this pull request in 3f78fa9. |
Not necessarily. Let's keep it as it is for now, and we can refine it afterwards |

Summary:
This PR fixes a bug where GitHub Actions bot didn't add a comment when "Needs: Repro" label was present in an issue.
When a maintainer adds the label manually the bot comments with "Missing Reproductible Example" as normally.
It seems like the problem occurred because of a difference in a sandbox repository and the proper facebook/react-native repo environment.
My sandbox that I used to test #38338 had an "bot" account with Personal Access Token setup to reply to issues. Turns out that bots using PAT have more permissions and can trigger one action from the other.
The solution is to send the comment directly from the
checkForReproduceraction. This won't collide with other actions but sadly will duplicate the sending logic into two actions.This PR also makes the bot respect when a maintainer removes and adds a label by hand and won't alter the maintainer decision.
Related to ☂️ #35591
Changelog:
[INTERNAL] [FIXED] - Fix check-for-reproducer action not adding Missing Repro comment
Test Plan:
When issue is added
Bot adds comment and "Needs: Repro" label when no reproducer is present in the issue body

Bot adds comment and "Needs: Repro" label when a repository not connected to the user's name was submitted
When issue body is edited
When comment is added
Bot removes the comment and the Needs Repro label when user submits a repo under their name

Bot removes the comment and the Needs Repro label when any user submits a snack

Bot removes the comment and the Needs repro label when other user submits a repo under their name
When maintainer changes the label