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
+28-9Lines changed: 28 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,4 @@
1
+
usecrate::bors::approval::ApprovalNote;
1
2
usecrate::bors::command::CommandPrefix;
2
3
usecrate::bors::{FailedWorkflowRun,WorkflowRun};
3
4
usecrate::database::PullRequestModel;
@@ -296,8 +297,8 @@ pub fn approved_comment(
296
297
reviewer:&str,
297
298
unknown_reviewers:Vec<String>,
298
299
tree_state:TreeState,
299
-
was_failed:bool,
300
-
failed_pr_ci:bool,
300
+
had_failed_auto_build:bool,
301
+
note:Option<ApprovalNote>,
301
302
) -> Comment{
302
303
let approve_emoji = ifis_holiday_season(){
303
304
"star2"
@@ -312,20 +313,38 @@ It is now in the [queue]({web_url}/queue/{}) for this repository.
312
313
repo.name()
313
314
);
314
315
315
-
ifwas_failed{
316
+
ifhad_failed_auto_build{
316
317
writeln!(
317
318
comment,
318
319
"\nA failed build status on this PR was cleared due to the approval."
319
320
)
320
321
.unwrap();
321
322
}
322
323
323
-
if failed_pr_ci {
324
-
writeln!(
325
-
comment,
326
-
"\n> [!WARNING]\n> This PR was force-approved despite failing PR CI."
327
-
)
328
-
.unwrap();
324
+
ifletSome(note) = note {
325
+
match note {
326
+
ApprovalNote::PrCiIsFailing => {
327
+
writeln!(
328
+
comment,
329
+
"\n> [!WARNING]\n> This PR was force-approved despite failing PR CI."
330
+
)
331
+
.unwrap();
332
+
}
333
+
ApprovalNote::TentativeApprovalUpgraded => {
334
+
writeln!(
335
+
comment,
336
+
r#"
337
+
> [!WARNING]
338
+
> This PR was already fully approved previously, so this tentative approval was treated as a full approval. If you want to instead downgrade the PR to be only tentatively approved, unapprove it first and then re-approve it again:
:pushpin: Commit pr-1-sha has been approved by `default-user`
2355
+
2356
+
It is now in the [queue](https://bors-test.com/queue/borstest) for this repository.
2357
+
2358
+
> [!WARNING]
2359
+
> This PR was already fully approved previously, so this tentative approval was treated as a full approval. If you want to instead downgrade the PR to be only tentatively approved, unapprove it first and then re-approve it again:
2360
+
> ```
2361
+
> @bors r-
2362
+
> @bors r+
2363
+
> ```
2364
+
");
2365
+
2366
+
// The tentative approval should not unapprove the PR
0 commit comments