You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/bors/comment.rs
+8
Original file line number
Diff line number
Diff line change
@@ -47,3 +47,11 @@ Build commit: {} (`{}`)"#,
47
47
}),
48
48
}
49
49
}
50
+
51
+
pubfntry_build_in_progress_comment() -> Comment{
52
+
Comment::new(":exclamation: A try build is currently in progress. You can cancel it using @bors try cancel.".to_string())
53
+
}
54
+
55
+
pubfncant_find_last_parent_comment() -> Comment{
56
+
Comment::new(":exclamation: There was no previous build. Please set an explicit parent or remove the `parent=last` argument to use the default parent.".to_string())
let last_parent = ifletSome(ref build) = pr_model.try_build{
51
-
if build.status == BuildStatus::Pending{
52
-
tracing::warn!("Try build already in progress");
53
-
repo.client
54
-
.post_comment(pr.number,Comment::new(":exclamation: A try build is currently in progress. You can cancel it using @bors try cancel.".to_string()))
55
-
.await?;
56
-
returnOk(());
57
-
}
58
-
Some(CommitSha(build.parent.clone()))
59
-
}else{
60
-
None
61
-
};
62
-
63
-
let base_sha = match parent.clone(){
64
-
Some(parent) => match parent {
65
-
Parent::Last => match last_parent {
66
-
None => {
67
-
repo.client
68
-
.post_comment(pr.number,Comment::new(":exclamation: There was no previous build. Please set an explicit parent or remove the `parent=last` argument to use the default parent.".to_string()))
69
-
.await?;
70
-
returnOk(());
71
-
}
72
-
Some(last_parent) => last_parent,
73
-
},
74
-
Parent::CommitSha(parent) => parent,
75
-
},
76
-
None => repo
52
+
let base_sha = matchget_base_sha(&pr_model, parent){
53
+
Ok(Some(base_sha)) => base_sha,
54
+
Ok(None) => repo
77
55
.client
78
56
.get_branch_sha(&pr.base.name)
79
57
.await
80
-
.with_context(|| format!("Cannot get SHA for branch {}", pr.base.name))?,
58
+
.context(format!("Cannot get SHA for branch {}", pr.base.name))?,
0 commit comments