Skip to content

dx --affected: intersect with scopes, clear no-git error, --base and [affected] base - #13277

Merged
TrapsterDK merged 1 commit into
mainfrom
dx-affected-13198
Nov 18, 2026
Merged

TrapsterDK merged 1 commit into
mainfrom
dx-affected-13198

Conversation

@TrapsterDK

Copy link
Copy Markdown
Collaborator

Closes #13198

  • build, test, coverage, lint, typecheck, format and check now take scopes with --affected and keep only the affected targets inside them (dx test --affected //svc/...). generate, security, license and deploy still reject the pair, since their scopes are not plain Bazel patterns or a single label.
  • Outside a git work tree, --affected (and --since) say <dir> is not inside a git work tree instead of "cannot find the default branch".
  • --base <ref> and dx.toml [affected] base choose the branch whose merge-base --affected diffs from. --base wins, then dx.toml, then the existing detection. --base needs --affected and conflicts with --since. The schema was regenerated with bazel run //cli/dx_config:update_schema.
  • Help goldens, CLI docs and the dx.toml reference are updated.

Tests: scopes_narrow_the_affected_plan, outside_git_says_so_instead_of_blaming_the_default_branch, base_comes_from_the_flag_then_dx_toml_then_detection (cli/cli), affected_takes_scopes_on_the_graph_commands and base_needs_affected_and_excludes_since (cli/plan).

Local: bazel test //cli/plan:dx_plan_test //cli/cli:dx_cli_test //cli/dx_config:dx_config_test //cli/cli:dx_man_test passed (4/4). tools/dx check --affected --apply passed generate and format; its lint and typecheck phases stopped on an analysis failure in //qt/tests/fixtures/qt_rust/app:ledger_release (untouched), so clippy on the touched crates is left to CI. Nested-Bazel and *_consumer_test targets were not run locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hvgPbKqbuDgsTasg7K

@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Evidence 44195066839: macos_arm64 is green. The linux_x86_64 and windows_x86_64 failures are all in tests this PR does not touch (sync_fingerprint, dev_launcher, agents, init, link_check, update_consumer, workflow profile). Evidence 44196819972 fails with the same set on the unrelated branch dx-test-one-query, so I filed them as #13286. Locally on Linux, bazel test //cli/cli:dx_cli_test //cli/cli/tests/agents:{agents_test,dev_launcher_test} //cli/plan:dx_plan_test passes 4/4 and tools/dx lint //cli/plan/... //cli/cli:dx_cli //cli/dx_config/... passes (clippy). I did not run any nested-Bazel or consumer tests locally. No review-path prefixes are touched.

@TrapsterDK
TrapsterDK marked this pull request as ready for review November 17, 2026 23:53
… and [affected] base (closes #13198)

- build, test, coverage, lint, typecheck, format and check accept scopes
  with --affected and keep only the affected targets inside them.
  generate, security, license and deploy still reject the pair.
- --affected and --since outside a git work tree now say so instead of
  "cannot find the default branch".
- --base <ref> and dx.toml [affected] base pick the branch whose
  merge-base --affected diffs from; --base wins, then dx.toml, then
  detection. --base conflicts with --since and needs --affected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hvgPbKqbuDgsTasg7K
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dx: --affected with scopes, no-git errors, base branch setting

1 participant