Skip to content

Commit

Permalink
Rollup merge of rust-lang#138053 - Kobzol:more-try-jobs, r=marcoieni
Browse files Browse the repository at this point in the history
Increase the max. custom try jobs requested to `20`

Requested [here](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Increase.20try-job.20limit).

r? ```@marcoieni```
  • Loading branch information
Noratrieb authored Mar 6, 2025
2 parents b83827e + 3dbf3dc commit c460006
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ci/citool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ fn yaml_map_to_json(map: &BTreeMap<String, Value>) -> BTreeMap<String, serde_jso
.collect()
}

/// Maximum number of custom try jobs that can be requested in a single
/// `@bors try` request.
const MAX_TRY_JOBS_COUNT: usize = 20;

fn calculate_jobs(
run_type: &RunType,
db: &JobDatabase,
Expand All @@ -191,9 +195,9 @@ fn calculate_jobs(
RunType::PullRequest => (db.pr_jobs.clone(), "PR", &db.envs.pr_env),
RunType::TryJob { custom_jobs } => {
let jobs = if let Some(custom_jobs) = custom_jobs {
if custom_jobs.len() > 10 {
if custom_jobs.len() > MAX_TRY_JOBS_COUNT {
return Err(anyhow::anyhow!(
"It is only possible to schedule up to 10 custom jobs, received {} custom jobs",
"It is only possible to schedule up to {MAX_TRY_JOBS_COUNT} custom jobs, received {} custom jobs",
custom_jobs.len()
));
}
Expand Down

0 comments on commit c460006

Please sign in to comment.