Skip to content

Commit 03813bc

Browse files
authored
DEVPROD-17817 add dependencies for multiversion binary selection on burn-in task references (#100)
1 parent f7bbc75 commit 03813bc

File tree

4 files changed

+49
-4
lines changed

4 files changed

+49
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Changelog
2+
## 3.0.1 - 2025-05-22
3+
* Add multiversion binary selection dependency to burn-in tasks when needed.
4+
25
## 3.0.0 - 2025-05-07
36
* Generate multiversion binary selection tasks
47

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "mongo-task-generator"
33
description = "Dynamically split evergreen tasks into subtasks for testing the 10gen/mongo project."
44
license = "Apache-2.0"
5-
version = "3.0.0"
5+
version = "3.0.1"
66
repository = "https://github.com/mongodb/mongo-task-generator"
77
authors = ["DevProd Correctness Team <[email protected]>"]
88
edition = "2018"

src/task_types/burn_in_tests.rs

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ use std::{
1111

1212
use crate::evergreen::evg_config_utils::EvgConfigUtils;
1313
use crate::evergreen_names::{
14-
BURN_IN_TASKS, BURN_IN_TASK_NAME, COMPILE_VARIANT, VERSION_BURN_IN_GEN_TASK,
15-
VERSION_GEN_VARIANT,
14+
BURN_IN_TASKS, BURN_IN_TASK_NAME, COMPILE_VARIANT, MULTIVERSION_BINARY_SELECTION,
15+
VERSION_BURN_IN_GEN_TASK, VERSION_GEN_VARIANT,
1616
};
1717
use crate::{
1818
evergreen_names::BURN_IN_BYPASS,
@@ -451,6 +451,48 @@ impl BurnInService for BurnInServiceImpl {
451451
},
452452
];
453453

454+
let mut includes_multiversion_tasks = false;
455+
for task_ref in gen_config.gen_task_specs.iter_mut() {
456+
// Find the corresponding subtask to check its dependencies
457+
let depends_on_multiversion = generated_task
458+
.sub_tasks()
459+
.iter()
460+
.find(|&t| t.evg_task.name == task_ref.name)
461+
.map(|subtask| {
462+
subtask.evg_task.depends_on.as_ref().map_or(false, |deps| {
463+
deps.iter()
464+
.any(|dep| dep.name == MULTIVERSION_BINARY_SELECTION)
465+
})
466+
})
467+
.unwrap_or(false);
468+
469+
if depends_on_multiversion {
470+
includes_multiversion_tasks = true;
471+
472+
// Combine the multiversion binary selection with variant task dependencies
473+
let multiversion_dependency = TaskDependency {
474+
name: MULTIVERSION_BINARY_SELECTION.to_string(),
475+
variant: None,
476+
};
477+
478+
task_ref.depends_on = Some(
479+
std::iter::once(multiversion_dependency)
480+
.chain(variant_task_dependencies.iter().cloned())
481+
.collect(),
482+
);
483+
}
484+
}
485+
486+
// Add the multiversion binary selection task if needed
487+
if includes_multiversion_tasks {
488+
gen_config.gen_task_specs.push(TaskRef {
489+
name: MULTIVERSION_BINARY_SELECTION.to_string(),
490+
distros: None,
491+
activate: Some(false),
492+
depends_on: None,
493+
});
494+
}
495+
454496
Ok(BuildVariant {
455497
name: gen_config.build_variant_name.clone(),
456498
tasks: gen_config.gen_task_specs.clone(),

0 commit comments

Comments
 (0)