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.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Gazelle plugin generates a UUID for each
py_library
target forpy_binary
andpy_test
in the same package to refer to. However, creating another identifier such as UUID is not necessary because Bazel already has id for each target, which is its label.Furthermore, in some large monorepos where it's too slow for Gazelle to index the whole repo, we turn off the indexing with
bazel run //:gazelle -- -index=false
and rely on CrossResolver to resolve dependencies based on paths conventions. The UUID makes it impossible to resolve dependencies without indexing the whole repository.What is the new behavior?
Reuse Bazel label as the id for the library and avoid depending on the UUID library. Now CrossResolvers can easily resolve same-package dependencies
Does this PR introduce a breaking change?
Other information
If this approach is acceptable, I can create a follow up PR to rename variables to reflect the fact that we are no longer using UUID