Skip to content

Decide target_map renames in one place, and list renamed exclusions - #38

Open
anakanemison wants to merge 1 commit into
mschaller/u02-validate-bazel-argsfrom
mschaller/u03-target-map-renames-one-place
Open

anakanemison wants to merge 1 commit into
mschaller/u02-validate-bazel-argsfrom
mschaller/u03-target-map-renames-one-place

Conversation

@anakanemison

Copy link
Copy Markdown

Part 3 of 23 of a stacked series (tracking issue: #35). Based on U02-validate-bazel-args, the previous part: review and merge that first.

Kind: fix. Lab proposal: (support for P3, P17).

What the migration runs showed

A Bazel target mapped to an excluded CMake name was skipped without being listed in excluded.bazel.

The change

exclude_targets holds CMake names. The diff applies target_map before
deciding participation, so a Bazel target mapped to an excluded CMake name
is skipped. excluded_summary, which reports what was skipped and why,
checked the raw Bazel label instead, so that target appeared nowhere in
excluded.bazel: skipped, but not on the record.

A new helper, _bazel_renames, returns each Bazel label with the name the
diff compares it under (today, the target_map entries whose label exists),
and is the one place that decision is made. diff_models renames the Bazel
views with it and, as before, also applies every explicit target_map entry
to dependency references (a map entry can align an external dependency
that has no target node). excluded_summary checks exclusion on the renamed
name while still listing the target under its Bazel label. The per-side
summaries later in this series use the same helper, so they count exactly
the targets the diff compares, and the automatic executable alignment
extends it rather than deciding separately.

Testing

pytest tests/ at this commit: 138 passed (130 on main).

🤖 Generated with Claude Code

exclude_targets holds CMake names. The diff applies target_map before
deciding participation, so a Bazel target mapped to an excluded CMake name
is skipped. excluded_summary, which reports what was skipped and why,
checked the raw Bazel label instead, so that target appeared nowhere in
`excluded.bazel`: skipped, but not on the record.

A new helper, _bazel_renames, returns each Bazel label with the name the
diff compares it under (today, the target_map entries whose label exists),
and is the one place that decision is made. diff_models renames the Bazel
views with it and, as before, also applies every explicit target_map entry
to dependency references (a map entry can align an external dependency
that has no target node). excluded_summary checks exclusion on the renamed
name while still listing the target under its Bazel label. The per-side
summaries later in this series use the same helper, so they count exactly
the targets the diff compares, and the automatic executable alignment
extends it rather than deciding separately.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant