Skip to content

Commit 0cd9f2f

Browse files
committed
fix(build): Avoid useless log when job has no split
1 parent 6162c82 commit 0cd9f2f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

buildSrc/src/main/kotlin/datadog/gradle/plugin/ci/CIJobsExtensions.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ val Project.isInSelectedSlot: Provider<Boolean>
2222
return@map true
2323
}
2424

25+
// When CI_NODE_INDEX or CI_NODE_TOTAL is unset in non-parallel jobs, one part may be empty (e.g. slot="/1") — treat as no filtering
26+
if (parts[0].isBlank() || parts[1].isBlank()) {
27+
project.logger.info("Incomplete slot value '{}', CI_NODE_INDEX or CI_NODE_TOTAL not set. Treating all projects as selected.", slot)
28+
return@map true
29+
}
30+
2531
val selectedSlot = parts[0].toIntOrNull()
2632
val totalSlots = parts[1].toIntOrNull()
2733

0 commit comments

Comments
 (0)