Skip to content

Commit 3e023b9

Browse files
Correctly handle --keep_going (#279)
* Correctly handle --keep_going I will work on making this logic more testable soon Fixes fineGrainedHashExternalRepos parameter issue #267 Signed-off-by: Maxwell Elliott <[email protected]> * rollback Signed-off-by: Maxwell Elliott <[email protected]> * more updates Signed-off-by: Maxwell Elliott <[email protected]> --------- Signed-off-by: Maxwell Elliott <[email protected]>
1 parent 3361a6a commit 3e023b9

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module(
22
name = "bazel-diff",
3-
version = "9.1.0",
3+
version = "10.0.0",
44
compatibility_level = 0,
55
)
66

MODULE.bazel.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.

cli/src/main/kotlin/com/bazel_diff/bazel/BazelQueryService.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ class BazelQueryService(
130130

131131
queryFile.writeText(query)
132132

133+
val allowedExitCodes = mutableListOf(0)
134+
133135
val cmd: MutableList<String> =
134136
ArrayList<String>().apply {
135137
add(bazelPath.toString())
@@ -179,6 +181,7 @@ class BazelQueryService(
179181
}
180182
if (keepGoing) {
181183
add("--keep_going")
184+
allowedExitCodes.add(3)
182185
}
183186
if (useCquery) {
184187
addAll(cqueryOptions)
@@ -204,8 +207,10 @@ class BazelQueryService(
204207
destroyForcibly = true,
205208
)
206209

207-
if (result.resultCode != 0)
208-
throw RuntimeException("Bazel query failed, exit code ${result.resultCode}")
210+
if (!allowedExitCodes.contains(result.resultCode)) {
211+
logger.w { "Bazel query failed, output: ${result.output.joinToString("\n")}" }
212+
throw RuntimeException("Bazel query failed, exit code ${result.resultCode}, allowed exit codes: ${allowedExitCodes.joinToString()}")
213+
}
209214
return outputFile
210215
}
211216

0 commit comments

Comments
 (0)