-
Notifications
You must be signed in to change notification settings - Fork 76
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
don't try to reassign a reviewer when a pr title is edited #1755
Conversation
I don't think this is the correct thing to change. We want this to handle Edited comments. For example, if someone writes a comment like I'm not entirely sure what happened to cause #1750 to happen. Just changing the title normally doesn't cause it to attempt to reassign. There are multiple guards to prevent this from happening:
I'm not able to reproduce the problem by just editing a PR title. Can you maybe dig into the exact sequence of events that causes this to happen? It seems like the primary clues are that the PR comment includes My initial thoughts were that it was maybe a race condition with overlapping webhooks for opening the issue and the subsequent title rename. However, it looks like rust-lang/rust#117522 (comment) happened weeks afterwards. |
BTW, thanks for taking a look at fixing this! |
Github sends a different event when comments are edited than when the PR is edited. Here is the action it sends for a comment: Line 920 in fa84ceb
and for a PR: Line 937 in fa84ceb
So this is only preventing people from editing the PR description to send triagebot commands, not editing comments. I'll talk in a second about why I think it would be hard to support that.
That code is in triagebot/src/handlers/assign.rs Lines 511 to 522 in c156fe9
The Line 1847 in fa84ceb
github documents that body text as: https://docs.github.com/en/rest/using-the-rest-api/github-event-types?apiVersion=2022-11-28#event-payload-object-for-issuesevent
I suspect that somehow we are deserializing the wrong part of the JSON object somehow and
do you have a repo where i can play around with triagebot without sending people notifications? i'm not willing to try and run my own instance locally. |
say more about how you tested this? i tried this out on a test repo and was able to reproduce it every time i edited the pr title: WaffleLapkin/teloxidebottest#8 |
ok cool i think i know what's going on. here's some logging from bf58902 deployed onto WaffleLapkin/teloxidebottest#9:
notice in particular this bit:
that explains why the second check is not firing: we are not getting a you mentioned wanting to support editing (as mentioned above i am talking specifically about the case of editing the PR description, not a later comment). i think that will be error-prone and would prefer to disallow it, but if we were going to do it, i would suggest one or more of the following approaches:
|
Thanks for investigating! I think I understand it better now.
This sounds like the right solution to me. That is, ignore if the action is Edited and the changes body is |
doing so leads to weird errors: > Could not assign reviewer from: jyn514. > User(s) jyn514 are either the PR author, already assigned, or on vacation, and there are no other candidates. > Use r? to specify someone else to assign. this was likely missed when transitioning from highfive to triagebot. see rust-lang/rust#118993 for an example of a bug this fixes
btw, just saw another case of the bug: rust-lang/rust#118391 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Sorry I missed the push here.
doing so leads to weird errors:
this was likely missed when transitioning from highfive to triagebot.
see rust-lang/rust#118993 for an example of a bug this fixes.