Conversation
Summary: Intent: - Tango's OptimizedTarget.Attributes only ever carried string-valued Bazel rule attributes: mapper.go filtered ingestion to Attribute_STRING and dropped every other type, so a target whose only real change was e.g. a boolean or integer attribute flip was still flagged as changed (via the target hash) but got misclassified during finer-grained diffing since the attribute-equality check never saw the change. Changes: - Replaced the STRING-only filter in mapper.ResultToTargetGraph with attributeValue, which stringifies STRING, BOOLEAN, INTEGER, and STRING_LIST typed attributes into the existing string value intern table. - STRING_LIST values are sorted before encoding, matching the existing precedent in core/targethasher/sourcehasher.go's encodeAttribute (which sorts string_list_value for the same reason: Bazel query does not guarantee stable list ordering across runs when nothing semantically changed). Values are JSON-encoded rather than delimiter-joined so elements containing arbitrary characters can't collide. - Other collection/dict/label attribute types (STRING_DICT, LABEL_LIST, INTEGER_LIST, etc.) are still dropped rather than stringified, since a naive string join isn't safe for them without a canonical encoder. --- <sub>Generated by the 🪄 [pr-create](https://sg.uberinternal.com/code.uber.internal/uber-code/devexp-agent-marketplace/-/blob/claude-code/plugins/dev/uber-dev/skills/pr-create/SKILL.md) skill in devexp-agent-marketplace</sub>
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:
rule attributes: mapper.go filtered ingestion to Attribute_STRING and
dropped every other type, so a target whose only real change was e.g. a
boolean or integer attribute flip was still flagged as changed (via the
target hash) but got misclassified during finer-grained diffing since the
attribute-equality check never saw the change.
Changes:
attributeValue, which stringifies STRING, BOOLEAN, INTEGER, and
STRING_LIST typed attributes into the existing string value intern table.
precedent in core/targethasher/sourcehasher.go's encodeAttribute (which
sorts string_list_value for the same reason: Bazel query does not
guarantee stable list ordering across runs when nothing semantically
changed). Values are JSON-encoded rather than delimiter-joined so
elements containing arbitrary characters can't collide.
INTEGER_LIST, etc.) are still dropped rather than stringified, since a
naive string join isn't safe for them without a canonical encoder.
Generated by the 🪄 pr-create skill in devexp-agent-marketplace
Test Plan
Issues