[feature] Add per-repo allowlist for direct-change attribute detection - #273
Merged
Merged
Conversation
xytan0056
reviewed
Aug 6, 2026
xytan0056
approved these changes
Aug 6, 2026
Summary: Intent: - GetChangedTargets classifies a target as directly changed (distance 0) whenever its attribute set differs between revisions. - Some Bazel attributes are pure BUILD-file bookkeeping (e.g. generator_location, which shifts whenever unrelated lines move earlier in the same file) rather than semantic configuration, so comparing the full attribute set can misclassify cosmetic churn as a direct change. Changes: - Add RepositoryConfig.DirectlyChangedAttributes, a per-repo allowlist of attribute names that count as evidence of a direct change. - Wire config.RepositoryConfigProvider into controller.Params/controller so GetChangedTargets can look up the allowlist for a request's remote. - Thread the resolved allowlist through compareTargetGraphs and toDiffGraph so only allowlisted attributes (or all attributes, when unset) are kept on each target before diffing. Test Plan: - Added TestToDiffGraph_OnlyKeepsAllowlistedAttributes and TestDirectlyChangedAttributesFor covering the allowlist filtering and lookup logic. - Updated existing compareTargetGraphs/toDiffGraph call sites for the new parameter. --- <sub>Generated by the 🪄 [pr-create](https://sg.uberinternal.com/code.uber.internal/uber-non-production/personal-wua-skills/-/blob/pr-create/SKILL.md) skill in wua/skills</sub>
Reviewer feedback: the original name read unclear about what it controlled. Renamed the field, YAML tag, and internal identifiers to SeedAttributes / seed_attributes for clarity.
yushan8
force-pushed
the
yushan/add-directly-changed-attributes-filter
branch
from
August 6, 2026 17:46
3931d7a to
5b8a99f
Compare
yushan8
marked this pull request as draft
August 6, 2026 20:51
yushan8
marked this pull request as ready for review
August 6, 2026 20:51
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.
Summary
Intent:
whenever its attribute set differs between revisions.
generator_location, which shifts whenever unrelated lines move earlier in
the same file) rather than semantic configuration, so comparing the full
attribute set can misclassify cosmetic churn as a direct change.
Changes:
attribute names that count as evidence of a direct change.
GetChangedTargets can look up the allowlist for a request's remote.
so only allowlisted attributes (or all attributes, when unset) are kept on
each target before diffing.
Test Plan
TestDirectlyChangedAttributesFor covering the allowlist filtering and
lookup logic.
parameter.