|
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 |
@@ -665,6 +666,62 @@ mod tests { |
665 | 666 | "); |
666 | 667 | } |
667 | 668 |
|
| 669 | + #[sqlx::test] |
| 670 | + async fn rollup_remove_homu_ignore_block(pool: sqlx::PgPool) { |
| 671 | + let gh = run_test((pool, rollup_state()), async |ctx: &mut BorsTester| { |
| 672 | + let pr2 = ctx |
| 673 | + .open_pr(default_repo_name(), |pr| { |
| 674 | + pr.description = r"This is a very good PR. |
| 675 | +
|
| 676 | +<!-- homu-ignore:start --> |
| 677 | +ignore this 1 |
| 678 | +<!-- homu-ignore:end --> |
| 679 | +
|
| 680 | +include this |
| 681 | +
|
| 682 | +<!-- homu-ignore:start --> |
| 683 | +ignore this 2 |
| 684 | +<!-- homu-ignore:end --> |
| 685 | +
|
| 686 | +also include this pls" |
| 687 | + .to_string(); |
| 688 | + }) |
| 689 | + .await?; |
| 690 | + ctx.approve(pr2.id()).await?; |
| 691 | + |
| 692 | + make_rollup(ctx, &[&pr2]) |
| 693 | + .await? |
| 694 | + .assert_status(StatusCode::TEMPORARY_REDIRECT); |
| 695 | + Ok(()) |
| 696 | + }) |
| 697 | + .await; |
| 698 | + let rollup_branch = gh |
| 699 | + .get_repo(fork_repo()) |
| 700 | + .lock() |
| 701 | + .branches() |
| 702 | + .iter() |
| 703 | + .find(|branch| branch.name().starts_with("rollup")) |
| 704 | + .unwrap() |
| 705 | + .clone(); |
| 706 | + // Find the rollup merge commit |
| 707 | + let rollup_merge_commit = rollup_branch.get_commit_history().last().unwrap().clone(); |
| 708 | + insta::assert_snapshot!(rollup_merge_commit.message(), @" |
| 709 | + Rollup merge of #2 - pr-2, r=default-user |
| 710 | +
|
| 711 | + Title of PR 2 |
| 712 | +
|
| 713 | + This is a very good PR. |
| 714 | +
|
| 715 | +
|
| 716 | +
|
| 717 | + include this |
| 718 | +
|
| 719 | +
|
| 720 | +
|
| 721 | + also include this pls |
| 722 | + "); |
| 723 | + } |
| 724 | + |
668 | 725 | async fn make_rollup( |
669 | 726 | ctx: &mut BorsTester, |
670 | 727 | prs: &[&PullRequest], |
|
0 commit comments