-
Notifications
You must be signed in to change notification settings - Fork 97
Add way to do mentions of content changes #2171
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
Conversation
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.
Freel free to merge with/without including the filepaths
| None => write!(result, "Some changes occurred in {to_mention}").unwrap(), | ||
| None => match type_ { | ||
| MentionsEntryType::Filename => { | ||
| write!(result, "Some changes occurred in {entry}").unwrap() |
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.
Hmm, we don't actually use the relevant file paths for the filename. But I guess it doesn't hurt to collect them.
|
Amazing, thanks :) When can we start using this in rust-lang/rust? |
|
We don't have a staging environment, so starting from when it was merged. |
| fn patch_contains(patch: &str, needle: &str) -> bool { | ||
| for line in patch.lines() { | ||
| if (!line.starts_with("+++") && line.starts_with('+')) | ||
| || (!line.starts_with("---") && line.starts_with('-')) |
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.
I don't think we should trigger a mention when the text is removed.
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.
We discussed that above in #2171 (comment) and considered that removal might also be important. We can change that if you prefer since you're the only user.
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.
I don't know when you'd care about deletions. Additions is what I proposed originally. At least for the attributes I have in mind for this, removing them requires no extra care (beyond the things CI already ensures).
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.
Won't changes also count as a removal + addition?
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.
Yeah so they would still cause a ping even if we just scan + lines, which seems like reasonable behavior to me.
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.
Opened #2176 to change the behavior.
This PR adds a way to do mentions of content changes (instead of just filename changes).
Fixes #1851