Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit a6b08c6

Browse files
authored
Unrolled build for rust-lang#141355
Rollup merge of rust-lang#141355 - marcoieni:citool-errors, r=Kobzol ci: improve citool job db errors
2 parents d423c81 + f57a64a commit a6b08c6

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/ci/citool/src/jobs.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,20 @@ impl JobDatabase {
8585
}
8686

8787
pub fn load_job_db(db: &str) -> anyhow::Result<JobDatabase> {
88-
let mut db: Value = serde_yaml::from_str(db)?;
88+
let mut db: Value = serde_yaml::from_str(db).context("failed to parse YAML content")?;
8989

9090
// We need to expand merge keys (<<), because serde_yaml can't deal with them
9191
// `apply_merge` only applies the merge once, so do it a few times to unwrap nested merges.
92-
db.apply_merge()?;
93-
db.apply_merge()?;
9492

95-
let db: JobDatabase = serde_yaml::from_value(db)?;
93+
let apply_merge = |db: &mut Value| -> anyhow::Result<()> {
94+
db.apply_merge().context("failed to apply merge keys")
95+
};
96+
97+
// Apply merge twice to handle nested merges
98+
apply_merge(&mut db)?;
99+
apply_merge(&mut db)?;
100+
101+
let db: JobDatabase = serde_yaml::from_value(db).context("failed to parse job database")?;
96102
Ok(db)
97103
}
98104

0 commit comments

Comments
 (0)