bug: Support non-string (bool/int) attribute values in Tango

Open
#318 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go

Research direction

Start by examining mapper/mapper.go lines 69-77 to see the current string-only filter. Review proto/tango.proto to understand the Metadata structure and plan the additive changes. Then, look at core/itg/graph/graph.go for interning logic and internal/targetdiff/compare.go line 142 for attribute comparison. A good first step is to run existing tests to ensure they pass before modifying the type handling.

Written by the indexing model from the issue text.

Description

enhancement

Problem

Tango only propagates string-valued Bazel attributes. mapper/mapper.go:69-77 filters ingestion to Attribute_STRING only — bool/int/other types are dropped before reaching the graph, and the proto (proto/tango.proto) has no field to carry them anyway.

Effect: internal/targetdiff/compare.go:142 can't see non-string attribute changes, so a target whose only real change is e.g. a boolean flip still gets flagged as changed (via hash) but is misclassified as INDIRECT instead of DIRECT.

Proposed Solution

  • Add typed value mapping(s) to Metadata in proto/tango.proto (additive, backward compatible).
  • Remove the STRING-only filter in mapper/mapper.go; route by attr.GetType().
  • Update interning in core/itg/graph/graph.go to handle typed values, not just GetStringValue().
  • Extend attributesChanged in internal/targetdiff/compare.go to compare typed values.
Dominant language
Go
Stars
23
Forks
12
Avg merge
1d 10h
Merged PRs (30d)
18

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from uber/tango

All issues in uber/tango

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.