Skip to content

prebuilt guard: root the lock, audit and security tools dx commands run, from one list (part of #14064) - #14078

Closed
TrapsterDK wants to merge 1 commit into
mainfrom
cloud/14064
Closed

TrapsterDK wants to merge 1 commit into
mainfrom
cloud/14064

Conversation

@TrapsterDK

Copy link
Copy Markdown
Collaborator

Closes #14064

  • Each <lang>/lang.json now has a commands list: the rules_dx targets that dx commands run for that language. It covers go, elixir, erlang, perl, swift, ocaml, dart, php and julia. The schema and the families_languages.json projection carry it.
  • dx_families adds COMMAND_TARGETS: generate, generate_check, cosign, gitleaks, trivy and :dx, each with a *_LABEL constant. It also adds language_commands and command_label. dx_plan's own COMMAND_TARGETS and generate constants are removed; generate_target reads from dx_families.
  • dx update (backend.rs, composer, julia, update_live, update_outdated), dx audit (gitleaks), dx security (trivy, cosign) and dx upgrade (:dx) read their labels from that list. A missing language command becomes BackendError::MissingCommand (lang_commands, infra) instead of a panic. secrets::RESOLVE_COMMAND is now resolve_command() and is built from the label.
  • dx_families_test gains no_shipped_source_spells_a_command_label_inline. It fails when a shipped source in cli/update, cli/cli, cli/audit or cli/exec_audit spells a command label inline.
  • command_roots(repo, langs) returns the shared targets plus the commands of the guarded languages. The nested guard passes its languages. The in-graph guard now roots them next to check and docs for each language.
  • Also clears three clippy findings in touched files: needless_option_as_deref and two string_add.

Tested: //cli/families:dx_families_test, //cli/update:dx_update_test, //cli/audit:dx_audit_test, //cli/exec_audit:dx_exec_audit_test, //cli/cli:dx_cli_test, //core/modules:lang_json_test, //core/modules:lang_projections_test, //tools/testing/consumer:prebuilt_guard_lib_test and //tools/testing/consumer:in_graph_prebuilt_guard_test passed. tools/dx check --apply <touched files> is clean.
Not passing locally:

  • //cli/plan:dx_plan_test has 2 failures (every_family_with_shard_aspects_has_a_probe_for_that_capability, go_only_consumer_selects_core_and_go). The same 2 fail on main without this diff.
  • //tools/testing/consumer:go_prebuilt_guard_test could not run in the cloud container: the nested Bazel fails a TLS check (PKIX) when it downloads aran/rules_flutter through the proxy.

Left as draft until CI runs the nested go and java prebuilt guards. If a newly rooted target (cosign, :dx, gitleaks, trivy, go/private/tools:go) compiles a rules_dx binary there, it needs an allowlist line with a reason, or its asset wired.


Generated by Claude Code

…un, from one list (part of #14064)

Each <lang>/lang.json now lists the rules_dx targets dx commands run for it
under `commands`, and dx_families holds the language-independent ones
(generate, cosign, gitleaks, trivy, :dx) in COMMAND_TARGETS. dx update,
dx audit, dx security and dx upgrade read their labels from there, and a
dx_families test fails when a shipped source spells one inline.

command_roots now takes the guarded languages, so the nested and in-graph
prebuilt guards root the shared targets plus the commands of their
languages.

Also clears three clippy findings in touched files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copy link
Copy Markdown
Collaborator Author

The affected tests (linux_x86_64, shard 19) failure is from main, not this PR. //msix/tests:root_data fails analysis with a visibility error on //msix:BUILD.bazel. On main at d68393b, msix/BUILD.bazel exports that file only to //tools/api:__pkg__. This PR doesn't touch msix. The shard only ran because of the ocaml, perl and php lang.json edits. The other tests in the shard that ran passed (72); the rest were aborted by the analysis error.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

The affected tests (linux_x86_64, shard 23) failures also come from main, not this PR. I ran them locally on this branch and each one names a file the PR doesn't touch:

  • //tools/api:api_test: the snapshot is missing //cli/prebuilt:guard_stub.
  • bzl_visibility_test: android/repositories.bzl and elixir/repositories.bzl.
  • lock_hub_names_test: tools/api/page.rs and pr_check.rs.
  • lock_registry_test: cli/update/src/recovery.rs, gofumpt.go, ruby/private/gems.bzl and doc.rs.
  • pin_locations_test: core/pins.bzl.
  • aggregate_gates_test: ci.yml preflight.
  • config_consistency_test: the README .bazelversion and cli/cli/clippy.toml.
  • host_env_test / host_program_test: cli/plan/src/disk.rs and cli/process/src/lib.rs allowlist lines.

Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

The failures in shards 10, 15, 24, 25 and 26 also come from main. I reran the shard 10, 15 and 24 failures and module_extension_srcs_test (shard 25) on this branch. No failure message names a file this PR touches:

  • prose_rules_test, zero_compat_test and unreferenced_files_test: new allowlist lines in .github/workflows/README.md, android/repositories.bzl, elixir/repositories.bzl, cli/output, cli/shim, java/tests and julia/private/runtime.
  • starlark_docs_test: multi-line docstrings in core/stage.bzl, jvm_check.bzl and windows_tool.bzl.
  • module_extension_srcs_test: apple/private/tools/ops sources missing from //:module_srcs.
  • core_load_graph_test: tools/docs/protobuf/defs.bzl.
  • gazelle/ocaml:ocaml_test, gazelle/csharp:generation_test, gazelle/julia:stdlib_test, support_unit and policy_profile_analysis fail with the same output.

toolchain_gate_test fails on #14073 as well. Shard 26 fails at planning (invalid_scope "@llvm//tests/stage0_features:stage0_features_test") before any test runs. I didn't rerun the shard 25 consumer tests (go_consumer_test, root_module_test); language_skeleton_test there is a known main failure. Still draft until the go and java prebuilt guards run.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

The failures in shards 0, 4 and 11 also come from main. I reran the shard 4 and shard 11 core/tests:pins failures on this branch:

  • //cli/plan:update_registry_gen_test: the checked-in registry_gen.rs differs only in rustfmt layout of the DOCS_ASPECTS and *_PROBES arrays. This PR doesn't touch that file.
  • //cli/plan:dx_plan_test: the same 2 failures as on main without this diff.
  • //core/tests:pins: the julia_src URLs don't name the version.
  • //config:workspace_policy: an observation mismatch in config/.

Not rerun: //android/tests/conformance:format_error_test (shard 0) and //csharp/tests/fixtures/xunit:csharp_coverage_test_on (shard 11). This PR touches neither language.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

Shard 22 fails only //rust/tests:rust_analyzer_acquisition_test, and the rest of the shard passes or is skipped as incompatible. This PR changes nothing that test depends on, so it belongs with the main failures listed above.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

Shard 8 fails three core/quality/testdata matrix tests: matrix_rust_typos_fail, matrix_text_typos_fail and matrix_sql_lint_parse_error. matrix_rust_typos_fail also fails on #14073 (shard 3 of run 44603301494). These tests check lint tool output, and this PR touches no lint tool or aspect.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

Shard 12 fails //d/tests:metadata and //deploy/private/offline:bootstrap_test. This PR doesn't touch d/lang.json or anything else under d/, nor the offline bootstrap. The only lang.json change is the new commands key in nine other languages. I didn't rerun these two tests locally.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

Shard 13 fails only //deploy/tests/cross:cross_archive_test. This PR doesn't touch deploy/. The only nearby change is cosign (under deploy/private/release), which is now read from dx_families::COSIGN_LABEL; the label string is the same.


Generated by Claude Code

@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Superseded by #14081.

@TrapsterDK TrapsterDK closed this Nov 20, 2026
@TrapsterDK
TrapsterDK deleted the cloud/14064 branch November 20, 2026 06:20
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.

prebuilt guard: root the lock, audit and security tools dx commands run, from one list (part of #13722)

2 participants