feat: flip --keep_going default to false#400
Open
tinder-maxwellelliott wants to merge 2 commits into
Open
Conversation
`bazel-diff`'s `--keep_going` flag defaulted to `true` across generate-hashes (and the inheriting warmup), fingerprint, and serve. With keep_going enabled, `bazel query` tolerates failures in the build graph and bazel-diff treats a partial query (exit code 3) as success -- so when a repository rule fails to resolve (e.g. a transient network error fetching a remote dep), the affected package silently disappears from the results and bazel-diff emits a truncated hash set with no error. This makes hashes non-deterministic across runs (see #398). Flip the default to `false` so the common case fails loudly on configuration/resolution issues and keeps hashes deterministic. Users who want the old tolerant behavior can still opt in with `--keep_going` (the bare flag still resolves to true via fallbackValue). - Flip defaultValue "true" -> "false" and field initializers in GenerateHashesCommand, FingerprintCommand, and ServeCommand. - Rewrite the help text / README to frame keep_going as the risky opt-in and the default as fail-loud. - Update the #398 reproducer e2e test: the default path now asserts fail-loud (exit 1); the silent-drop behavior is demonstrated behind an explicit --keep_going. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Flip the default for
--keep_goingfromtruetofalseacross all commands that expose it:generate-hashes(andwarmup, which inherits the option viaScopeType.INHERIT)fingerprintservefallbackValuestays"true", so a bare-k/--keep_goingstill enables it. The old behavior remains available by explicitly passing--keep_going.Why
With
--keep_goingenabled,bazel querytolerates failures in the build graph and bazel-diff treats a partial query (exit code 3) as success. When a repository rule fails to resolve — e.g. a transient network error fetching a remote dependency — the package that references it silently disappears from the query results, and bazel-diff emits a hash set that is missing those targets with no error. That makes hashes non-deterministic across runs (a target present when a fetch succeeds vanishes when it flakes). This is the failure mode captured in the #398 reproducer.Defaulting to
falsemakes the common case fail loudly on configuration/resolution issues, keeping hashes deterministic.Changes
defaultValue = "false", field initializers →false, and updated help text inGenerateHashesCommand,FingerprintCommand,ServeCommand.generate-hashes,serve) toDefaults to falsewith the new rationale.--keep_going. Fixed a now-stale "default behavior" comment in the Using --cquery can't skip targets #301 cquery test.This changes a user-facing default. Runs that previously relied on the implicit
--keep_goingwill now fail on partial queries instead of silently producing truncated hashes; those callers must pass--keep_goingexplicitly to keep the old behavior. Worth a release-note callout.Testing
bazel build //cli:bazel-diff— clean.E2ETest: the 4 external-repo/cquery tests fail locally due to a pre-existing sandbox environment issue (nested coursier repo rule can't locate a JDK → bazel exit 37, rejected under both old and new allowed-exit-code sets); confirmed identical failure onmaster. Not caused by this change.🤖 Generated with Claude Code