Skip to content

Use mapped repository names for watched files.#818

Open
sbarfurth wants to merge 1 commit intobazelbuild:mainfrom
sbarfurth:sbarfurth/push-nlllkkpqxzlu
Open

Use mapped repository names for watched files.#818
sbarfurth wants to merge 1 commit intobazelbuild:mainfrom
sbarfurth:sbarfurth/push-nlllkkpqxzlu

Conversation

@sbarfurth
Copy link

Bazel repositories have a canonical and a mapped/apparent name. The apparent name appears in labels whereas the canonical name is used in the file tree. The old logic was not taking mappings into account. This would lead to files being discard from watching due to their labels having the apparent name.

Example:

bazel_dep(name = "my_cool_dep", repo = "foo")

This would lead to files inside the repository having labels starting with @foo//.... The canonical repo name is my_cool_dep+ so the path on disk is something like .../external/my_cool_dep+. The old logic would look at the bazel query results and check for my_cool_dep+ as the repository name, but it was actually foo which maps to my_cool_dep+. All files were discarded from watching and ibazel printed Didn't find any files to watch from query.

@sbarfurth sbarfurth requested a review from achew22 as a code owner February 10, 2026 22:07
@achew22
Copy link
Member

achew22 commented Feb 10, 2026

Hrm, seems like probably a reasonable thing do to. Do you think you (or claude?) could add an e2e test to verify this functionality?

@sbarfurth sbarfurth force-pushed the sbarfurth/push-nlllkkpqxzlu branch from 81a99e1 to fc61b49 Compare February 11, 2026 00:15
Bazel repositories have a canonical and a mapped/apparent name. The apparent
name appears in labels whereas the canonical name is used in the file tree. The
old logic was not taking mappings into account. This would lead to files being
discard from watching due to their labels having the apparent name.

Example:

```starlark
bazel_dep(name = "my_cool_dep", repo = "foo")
```

This would lead to files inside the repository having labels starting with
`@foo//...`. The canonical repo name is `my_cool_dep+` so the path on disk
is something like `.../external/my_cool_dep+`. The old logic would look at
the `bazel query` results and check for `my_cool_dep+` as the repository name,
but it was actually `foo` which maps to `my_cool_dep+`. All files were discarded
from watching and `ibazel` printed *Didn't find any files to watch from query*.
@sbarfurth sbarfurth force-pushed the sbarfurth/push-nlllkkpqxzlu branch from fc61b49 to c15c8b7 Compare February 11, 2026 05:36
@sbarfurth
Copy link
Author

@achew22 added a test targeted at this specifically

@sbarfurth
Copy link
Author

If this gets merged, how long do you think before we could see a release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants