• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 20533309613

27 Dec 2025 02:49AM UTC coverage: 80.283%. First build
20533309613

push

github

web-flow
partition protobuf targets for dependency inference using any "resolve-like" fields (#21918)

## Background

As reported in https://github.com/pantsbuild/pants/issues/21409,
protobuf dependency inference cannot handle resolve-like fields which
are attached to `protobuf_source` target types by plugins. Basically,
multiple targets own the same source file but in different resolves, but
the existing code does not know about resolves and thus has no way to
partition the targets into distinct groups and apply dependency
inference within each group.

## Solution

Partition the protobuf targets by any "resolve-like" field found
registered on a `protobuf_source` target. The new `ResolveLikeField`
mix-in is used to detect fields which are "resolve like." The dependency
inference logic then uses the new `ResolveLikeFieldToValueRequest` union
to query the applicable language backend for what the actual resolve
name is so it can be used for partitioning.

The Python and JVM backends support `ResolveLikeField`.

225 of 297 new or added lines in 11 files covered. (75.76%)

78750 of 98090 relevant lines covered (80.28%)

3.36 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.99
/src/python/pants/backend/python/target_types.py


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc