|
1 | 1 | use super::{GithubRepoName, PullRequest, PullRequestNumber}; |
2 | 2 | use crate::PgDbClient; |
3 | | -use crate::bors::make_text_ignored_by_bors; |
| 3 | +use crate::bors::{make_text_ignored_by_bors, normalize_merge_message}; |
4 | 4 | use crate::github::api::client::GithubRepositoryClient; |
5 | 5 | use crate::github::api::operations::MergeError; |
6 | 6 | use crate::github::oauth::{OAuthClient, UserGitHubClient}; |
@@ -299,6 +299,7 @@ async fn create_rollup( |
299 | 299 | pr.title, |
300 | 300 | pr_github.message |
301 | 301 | ); |
| 302 | + let merge_msg = normalize_merge_message(&merge_msg); |
302 | 303 |
|
303 | 304 | // Merge the PR's head commit into the rollup branch |
304 | 305 | let merge_attempt = user_client |
@@ -675,6 +676,62 @@ mod tests { |
675 | 676 | "); |
676 | 677 | } |
677 | 678 |
|
| 679 | + #[sqlx::test] |
| 680 | + async fn rollup_remove_homu_ignore_block(pool: sqlx::PgPool) { |
| 681 | + let gh = run_test((pool, rollup_state()), async |ctx: &mut BorsTester| { |
| 682 | + let pr2 = ctx |
| 683 | + .open_pr(default_repo_name(), |pr| { |
| 684 | + pr.description = r"This is a very good PR. |
| 685 | +
|
| 686 | +<!-- homu-ignore:start --> |
| 687 | +ignore this 1 |
| 688 | +<!-- homu-ignore:end --> |
| 689 | +
|
| 690 | +include this |
| 691 | +
|
| 692 | +<!-- homu-ignore:start --> |
| 693 | +ignore this 2 |
| 694 | +<!-- homu-ignore:end --> |
| 695 | +
|
| 696 | +also include this pls" |
| 697 | + .to_string(); |
| 698 | + }) |
| 699 | + .await?; |
| 700 | + ctx.approve(pr2.id()).await?; |
| 701 | + |
| 702 | + make_rollup(ctx, &[&pr2]) |
| 703 | + .await? |
| 704 | + .assert_status(StatusCode::TEMPORARY_REDIRECT); |
| 705 | + Ok(()) |
| 706 | + }) |
| 707 | + .await; |
| 708 | + let rollup_branch = gh |
| 709 | + .get_repo(fork_repo()) |
| 710 | + .lock() |
| 711 | + .branches() |
| 712 | + .iter() |
| 713 | + .find(|branch| branch.name().starts_with("rollup")) |
| 714 | + .unwrap() |
| 715 | + .clone(); |
| 716 | + // Find the rollup merge commit |
| 717 | + let rollup_merge_commit = rollup_branch.get_commit_history().last().unwrap().clone(); |
| 718 | + insta::assert_snapshot!(rollup_merge_commit.message(), @" |
| 719 | + Rollup merge of #2 - pr-2, r=default-user |
| 720 | +
|
| 721 | + Title of PR 2 |
| 722 | +
|
| 723 | + This is a very good PR. |
| 724 | +
|
| 725 | +
|
| 726 | +
|
| 727 | + include this |
| 728 | +
|
| 729 | +
|
| 730 | +
|
| 731 | + also include this pls |
| 732 | + "); |
| 733 | + } |
| 734 | + |
678 | 735 | async fn make_rollup( |
679 | 736 | ctx: &mut BorsTester, |
680 | 737 | prs: &[&PullRequest], |
|
0 commit comments