Skip to content

Commit bf58902

Browse files
committed
add some debugging
1 parent c156fe9 commit bf58902

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/github.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1859,7 +1859,10 @@ impl Event {
18591859
pub fn comment_from(&self) -> Option<&str> {
18601860
match self {
18611861
Event::Create(_) => None,
1862-
Event::Issue(e) => Some(&e.changes.as_ref()?.body.as_ref()?.from),
1862+
Event::Issue(e) => {
1863+
log::debug!("issue body: {:?}", e.changes);
1864+
Some(&e.changes.as_ref()?.body.as_ref()?.from)
1865+
}
18631866
Event::IssueComment(e) => Some(&e.changes.as_ref()?.body.as_ref()?.from),
18641867
Event::Push(_) => None,
18651868
}

src/handlers/assign.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -475,16 +475,15 @@ pub(super) async fn handle_command(
475475
// r? is ignored if `owners` is not configured in triagebot.toml.
476476
return Ok(());
477477
}
478-
if matches!(
479-
event,
480-
Event::Issue(IssuesEvent {
481-
action: IssuesAction::Opened | IssuesAction::Edited,
482-
..
483-
})
484-
) {
478+
if let Event::Issue(IssuesEvent {
479+
action: action @ (IssuesAction::Opened | IssuesAction::Edited),
480+
..
481+
}) = event
482+
{
485483
// Don't handle r? comments on new PRs. Those will be
486484
// handled by the new PR trigger (which also handles the
487485
// welcome message).
486+
log::debug!("not handling PR event {action:?} (delegating to handle_assign)");
488487
return Ok(());
489488
}
490489
if is_self_assign(&name, &event.user().login) {

src/handlers/notification.rs

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ pub async fn handle(ctx: &Context, event: &Event) -> anyhow::Result<()> {
5757
// comment, so they don't get notified again
5858
let mut users_notified = HashSet::new();
5959
if let Some(from) = event.comment_from() {
60+
log::debug!("previous comment text: {from}");
6061
for login in parser::get_mentions(from).into_iter() {
6162
if let Some((Ok(users), _)) = id_from_user(ctx, login).await? {
6263
users_notified.extend(users.into_iter().map(|user| user.id.unwrap()));

0 commit comments

Comments
 (0)