Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/bors/handlers/trybuild.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ It fixes so many issues, sir."
pr.description = r"This is a very good PR.

try-job: Foo
try-jobs: Bar

It fixes so many issues, sir.

Expand All @@ -460,6 +461,7 @@ try-job: Bar
Title of PR 1

try-job: Foo
try-jobs: Bar
try-job: Bar
");
Ok(())
Expand Down
12 changes: 8 additions & 4 deletions src/bors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ pub fn normalize_merge_message(message: &str) -> String {
pub fn create_merge_commit_message(pr: handlers::PullRequestData, merge_type: MergeType) -> String {
use std::fmt::Write;

/// Prefix used to specify custom try jobs in PR descriptions.
const CUSTOM_TRY_JOB_PREFIX: &str = "try-job:";
/// Prefixes used to specify custom try jobs in PR descriptions.
const CUSTOM_TRY_JOB_PREFIXES: &[&str] = &["try-job:", "try-jobs:"];

let pr_number = pr.number();

Expand All @@ -405,7 +405,11 @@ pub fn create_merge_commit_message(pr: handlers::PullRequestData, merge_type: Me
.message
.lines()
.map(|l| l.trim())
.filter(|l| l.starts_with(CUSTOM_TRY_JOB_PREFIX))
.filter(|l| {
CUSTOM_TRY_JOB_PREFIXES
.iter()
.any(|prefix| l.starts_with(prefix))
})
.join("\n"),
// If we do have custom jobs, ignore the original description completely
MergeType::Try { .. } => String::new(),
Expand All @@ -426,7 +430,7 @@ pub fn create_merge_commit_message(pr: handlers::PullRequestData, merge_type: Me
match merge_type {
MergeType::Try { try_jobs, nolimit } => {
for job in try_jobs {
write!(message, "\n{CUSTOM_TRY_JOB_PREFIX} {job}").unwrap();
write!(message, "\n{} {job}", CUSTOM_TRY_JOB_PREFIXES[0]).unwrap();
}
if nolimit {
writeln!(message, "\ntry-nolimit").unwrap();
Expand Down
Loading