bazel-watcher icon indicating copy to clipboard operation
bazel-watcher copied to clipboard

support MODULE.bazel file

Open klandergren opened this issue 1 year ago • 8 comments

addresses #646

  • verified that ibazel with this patch can correctly watch and run the target in the linked issue
  • verified that //internal/ibazel/workspace:workspace_test passes

klandergren avatar Mar 07 '24 03:03 klandergren

I think this is a great change! Would you be willing to add a new e2e test based on the simple test case but instead of having the test change BUILD files, having it change the MODULE.bazel file? I'd be very happy to merge as soon as something like that was in

achew22 avatar Mar 07 '24 06:03 achew22

Thanks @achew22! What specific changes to a MODULE.bazel should the new e2e test exercise?

I ask because I noticed that none of the tests in simple_test.go test modifications to WORKSPACE, which is the closest equivalent file to what MODULE.bazel replaces. My understanding is that both WORKSPACE and MODULE.bazel are used to do things like load and resolve external dependencies which—I think—would involve external network requests which would not be desired for testing.

I considered loading a macro via load but after getting an error found that only a subset of methods are available for use in MODULE.bazel files.

In light of this my opinion is that an e2e test exercising MODULE.bazel may not be necessary but of course I defer to you.

klandergren avatar Mar 13 '24 17:03 klandergren

I did some experimentation and investigation and found that sourceQuery and buildQuery are the two queries that control which files ibazel pays attention to when detecting changes. While it does pass the parent directories of these outputs to fsevents it filters events (by path) against the results of these two queries. Neither result contains WORKSPACE or MODULE.bazel, so to support an end-to-end test that detects changes in those files would be more involved and probably need its own separate PR.

klandergren avatar Mar 19 '24 16:03 klandergren

@achew22 Is there a way to get this PR merged?

farhaven avatar May 10 '24 11:05 farhaven

@klandergren any chance you get the builds working so this pr can be merged?

n1ght-hunter avatar Jun 02 '24 02:06 n1ght-hunter

@achew22 Is there a way to get more detailed logs from the failed Windows build? It looks like it just aborts at some point without a specific error message. Or maybe that test is just flaky and needs to be triggered again?

farhaven avatar Jun 25 '24 13:06 farhaven

The only additional information I have been able to find is on the artifacts tab. Unfortunately, windows remains hostile to people wanting to develop software for it.

achew22 avatar Jun 25 '24 14:06 achew22

Stale pull request message

github-actions[bot] avatar Aug 25 '24 01:08 github-actions[bot]