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
"Unexpected commit name `{first_line}`, did not find expected prefix. Is the commit an unrolled build?"
304
+
"Unexpected commit name `{first_line}`, could not parse commit title. Is the commit an unrolled build?"
288
305
));
289
306
};
290
-
letOk(pr_number) = pr_number.parse::<u32>()else{
307
+
308
+
letSome(member_pr_number) = member_pr_number
309
+
.strip_prefix("#")
310
+
.and_then(|num| num.parse::<u32>().ok())
311
+
else{
291
312
returnErr(format!(
292
-
"Unexpected commit name, pr number `{pr_number}` was not parsable as u32. Is the commit an unrolled build?"
313
+
"Unexpected commit name `{first_line}`, could not parse member pr number. Is the commit an unrolled build?"
314
+
));
315
+
};
316
+
letSome(rollup_pr_number) = rollup_pr_number
317
+
.strip_prefix("#")
318
+
.and_then(|num| num.parse::<u32>().ok())
319
+
else{
320
+
returnErr(format!(
321
+
"Unexpected commit name `{first_line}`, could not parse rollup pr number. Is the commit an unrolled build?"
293
322
));
294
323
};
295
324
296
-
Ok(pr_number)
325
+
Ok(UnrolledBuildMessage{
326
+
member_pr_number,
327
+
rollup_pr_number,
328
+
})
297
329
}
298
330
299
331
asyncfnenqueue_sha_build(
@@ -713,19 +745,23 @@ Otherwise LGTM."#),
713
745
714
746
#[test]
715
747
fnpr_number_from_unrolled_build(){
716
-
constEXAMPLE:&str = "Unrolled build for #157428
748
+
constEXAMPLE:&str = "Unrolled build for #157428 in rollup #1234
717
749
Rollup merge of #157428 - nia-e:allocator-refactor, r=clarfonthey
718
750
719
751
allocator: refactor for stabilisation
720
752
721
753
Adds my current proposal per the doc in #156882 and follow-up Zulip conversations (notably for [dyn-compat](https://rust-lang.zulipchat.com/#narrow/channel/197181-t-libs.2Fwg-allocators/topic/Allocator.20dyn-safety/near/599555822)) unstably.
insta::assert_compact_debug_snapshot!(parse_unrolled_build_message("Not a correct title"),
759
+
@r#"Err("Unexpected commit name `Not a correct title`, could not parse commit title. Is the commit an unrolled build?")"#);
760
+
insta::assert_compact_debug_snapshot!(parse_unrolled_build_message("Unrolled build for #123almost in rollup #1234"),
761
+
@r#"Err("Unexpected commit name `Unrolled build for #123almost in rollup #1234`, could not parse member pr number. Is the commit an unrolled build?")"#);
762
+
insta::assert_compact_debug_snapshot!(parse_unrolled_build_message("Unrolled build for #123 in rollup #1234almost"),
763
+
@r#"Err("Unexpected commit name `Unrolled build for #123 in rollup #1234almost`, could not parse rollup pr number. Is the commit an unrolled build?")"#);
764
+
insta::assert_compact_debug_snapshot!(parse_unrolled_build_message("Unrolled build for #123"),
765
+
@r#"Err("Unexpected commit name `Unrolled build for #123`, could not parse commit title. Is the commit an unrolled build?")"#);
0 commit comments