Skip to content

chore: align go.mod and MODULE.bazel mods#214

Draft
jbedard wants to merge 1 commit intomainfrom
modules
Draft

chore: align go.mod and MODULE.bazel mods#214
jbedard wants to merge 1 commit intomainfrom
modules

Conversation

@jbedard
Copy link
Copy Markdown
Member

@jbedard jbedard commented Mar 17, 2026

Changes are visible to end-users: no

Test plan

  • Covered by existing test cases

Copilot AI review requested due to automatic review settings March 17, 2026 02:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the repository’s Bazel bzlmod setup so the shared Go “common” code becomes its own aspect_gazelle module rooted in ./common, and updates Bazel labels / Gazelle resolves to match the new module layout.

Changes:

  • Introduces common/MODULE.bazel and updates submodules’ local_path_override to point at ../../common / ../common.
  • Rewrites @aspect_gazelle//common/... dependencies to @aspect_gazelle//... and adjusts Gazelle resolve directives accordingly.
  • Simplifies the root MODULE.bazel into a workspace wrapper module and updates .bazelignore to ignore common/ at the workspace level.

Reviewed changes

Copilot reviewed 35 out of 37 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
runner/pkg/watchman/BUILD.bazel Updates @aspect_gazelle deps to new package roots.
runner/pkg/ibp/BUILD.bazel Updates logger dep label for new module layout.
runner/pkg/git/BUILD.bazel Updates logger dep label for new module layout.
runner/bin/gazelle/BUILD.bazel Updates @aspect_gazelle deps to new package roots.
runner/bin/cli/BUILD.bazel Updates @aspect_gazelle deps to new package roots.
runner/MODULE.bazel Points aspect_gazelle override to ../common.
runner/BUILD.bazel Updates Gazelle resolve rules and common/cache label.
language/orion/starzelle/BUILD.bazel Updates deps to new @aspect_gazelle label scheme.
language/orion/queries/BUILD.bazel Updates deps to new @aspect_gazelle label scheme (incl. treesitter).
language/orion/plugin/BUILD.bazel Updates common dep label to @aspect_gazelle//:common.
language/orion/MODULE.bazel Points aspect_gazelle override to ../../common.
language/orion/BUILD.bazel Updates Gazelle resolve rules + @aspect_gazelle deps.
language/kotlin/parser/BUILD.bazel Updates treesitter/logger deps to new @aspect_gazelle roots.
language/kotlin/MODULE.bazel Points aspect_gazelle override to ../../common.
language/kotlin/BUILD.bazel Updates Gazelle resolve rules + @aspect_gazelle deps.
language/js/typescript/BUILD.bazel Updates logger dep label for new module layout.
language/js/parser/BUILD.bazel Updates treesitter/logger deps to new @aspect_gazelle roots.
language/js/node/BUILD.bazel Updates logger dep label for new module layout.
language/js/MODULE.bazel Points aspect_gazelle override to ../../common.
language/js/BUILD.bazel Updates Gazelle resolve rules + @aspect_gazelle deps.
common/treesitter/grammars/typescript/BUILD.bazel Adjusts dependency label to //treesitter for module-rooted common.
common/treesitter/grammars/tsx/BUILD.bazel Adjusts dependency label to //treesitter for module-rooted common.
common/treesitter/grammars/starlark/BUILD.bazel Adjusts dependency label to //treesitter for module-rooted common.
common/treesitter/grammars/rust/BUILD.bazel Adjusts dependency label to //treesitter for module-rooted common.
common/treesitter/grammars/ruby/BUILD.bazel Adjusts dependency label to //treesitter for module-rooted common.
common/treesitter/grammars/kotlin/BUILD.bazel Adjusts dependency label to //treesitter for module-rooted common.
common/treesitter/grammars/json/BUILD.bazel Adjusts dependency label to //treesitter for module-rooted common.
common/treesitter/grammars/java/BUILD.bazel Adjusts dependency label to //treesitter for module-rooted common.
common/treesitter/grammars/golang/BUILD.bazel Adjusts dependency label to //treesitter for module-rooted common.
common/treesitter/BUILD.bazel Updates deps to //:common and //logger for module-rooted common.
common/rule/BUILD.bazel Updates deps to //logger for module-rooted common.
common/cache/BUILD.bazel Updates deps to //buildinfo and //logger for module-rooted common.
common/bazel/BUILD.bazel Updates workspace dep label to //bazel/workspace.
common/MODULE.bazel Adds a dedicated bzlmod module definition for aspect_gazelle plus tree-sitter archives.
common/BUILD.bazel Updates deps to //logger for module-rooted common.
MODULE.bazel Converts root into aspect_gazelle_workspace that depends on (and locally overrides) aspect_gazelle from ./common.
.bazelignore Ignores common/ at the workspace root level.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +4 to +5
# gazelle:resolve go github.com/aspect-build/aspect-gazelle/common @aspect_gazelle//:common
# gazelle:resolve_regexp go github.com/aspect-build/aspect-gazelle/common/(.*) @aspect_gazelle//$1
Comment thread runner/BUILD.bazel
Comment on lines +11 to +12
# gazelle:resolve go github.com/aspect-build/aspect-gazelle/common @aspect_gazelle//:common
# gazelle:resolve_regexp go github.com/aspect-build/aspect-gazelle/common/(.*) @aspect_gazelle//$1
Comment thread common/BUILD.bazel
Comment on lines 14 to 18
importpath = "github.com/aspect-build/aspect-gazelle/common",
visibility = ["//visibility:public"],
deps = [
"//common/logger",
"//logger",
"@com_github_bazelbuild_buildtools//build",
Comment thread language/js/BUILD.bazel
Comment on lines +4 to +5
# gazelle:resolve go github.com/aspect-build/aspect-gazelle/common @aspect_gazelle//:common
# gazelle:resolve_regexp go github.com/aspect-build/aspect-gazelle/common/(.*) @aspect_gazelle//$1
Comment on lines +4 to +5
# gazelle:resolve go github.com/aspect-build/aspect-gazelle/common @aspect_gazelle//:common
# gazelle:resolve_regexp go github.com/aspect-build/aspect-gazelle/common/(.*) @aspect_gazelle//$1
@aspect-workflows
Copy link
Copy Markdown

aspect-workflows Bot commented Mar 17, 2026

Test

All tests were cache hits

1 test (100.0%) was fully cached saving 172ms.


Test

common

3 test targets passed

Targets
//:common_test [k8-fastbuild]445ms
//buildinfo:buildinfo_test [k8-fastbuild]56ms
//rule:rule_test [k8-fastbuild]162ms

Test

language/js

All tests were cache hits

124 tests (100.0%) were fully cached saving 21s.


Test

language/kotlin

All tests were cache hits

19 tests (100.0%) were fully cached saving 4s.


Test

language/orion

All tests were cache hits

52 tests (100.0%) were fully cached saving 10s.


Test

runner

All tests were cache hits

30 tests (100.0%) were fully cached saving 6s.


Test

runner/e2e/bin

Buildkite build #774 is running...


Buildifier      Gazelle [common]      Gazelle [language/js]      Gazelle [language/kotlin]      Gazelle [language/orion]      Gazelle [runner]

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restructures the repository’s bzlmod setup so the common/ subtree is its own Bazel module (aspect_gazelle) and the repo root becomes a workspace module (aspect_gazelle_workspace), then updates BUILD deps and Gazelle resolves to match the new module/package layout.

Changes:

  • Split the root MODULE into a workspace module and a common/ module, moving common’s deps (including tree-sitter archives) into common/MODULE.bazel.
  • Update Gazelle resolve directives and BUILD deps to reference @aspect_gazelle//... packages without the former //common/... prefix.
  • Relocate Gazelle targets into common/BUILD.bazel and add helper macro common/gazelle.bzl; update ignore files for the new structure.

Reviewed changes

Copilot reviewed 39 out of 43 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
runner/pkg/watchman/BUILD.bazel Update deps to new @aspect_gazelle//<pkg> labels.
runner/pkg/ibp/BUILD.bazel Update logger dep label to @aspect_gazelle//logger.
runner/pkg/git/BUILD.bazel Update logger dep label to @aspect_gazelle//logger.
runner/bin/gazelle/BUILD.bazel Update deps to new @aspect_gazelle//bazel and @aspect_gazelle//logger.
runner/bin/cli/BUILD.bazel Update deps to new @aspect_gazelle//bazel and @aspect_gazelle//buildinfo.
runner/MODULE.bazel Point aspect_gazelle local override at ../common (module root moved).
runner/BUILD.bazel Update Gazelle resolves for common and adjust cache dep label.
language/orion/starzelle/BUILD.bazel Update common/logger deps to new labels.
language/orion/queries/BUILD.bazel Update common/logger/treesitter grammar deps to new labels.
language/orion/plugin/BUILD.bazel Update common dep to @aspect_gazelle//:common.
language/orion/MODULE.bazel Point aspect_gazelle local override at ../../common.
language/orion/BUILD.bazel Update Gazelle resolves and common/cache/logger/rule deps to new labels.
language/kotlin/parser/BUILD.bazel Update logger/treesitter deps to new labels.
language/kotlin/MODULE.bazel Point aspect_gazelle local override at ../../common.
language/kotlin/BUILD.bazel Update Gazelle resolves and common/logger/rule deps to new labels.
language/js/typescript/BUILD.bazel Update logger dep to new label.
language/js/parser/BUILD.bazel Update logger/treesitter deps to new labels.
language/js/node/BUILD.bazel Update logger dep to new label.
language/js/MODULE.bazel Point aspect_gazelle local override at ../../common.
language/js/BUILD.bazel Update Gazelle resolves and common/cache/logger/rule deps to new labels.
common/treesitter/grammars/typescript/BUILD.bazel Update treesitter dep label to //treesitter (module-rooted).
common/treesitter/grammars/tsx/BUILD.bazel Update treesitter dep label to //treesitter (module-rooted).
common/treesitter/grammars/starlark/BUILD.bazel Update treesitter dep label to //treesitter (module-rooted).
common/treesitter/grammars/rust/BUILD.bazel Update treesitter dep label to //treesitter (module-rooted).
common/treesitter/grammars/ruby/BUILD.bazel Update treesitter dep label to //treesitter (module-rooted).
common/treesitter/grammars/kotlin/BUILD.bazel Update treesitter dep label to //treesitter (module-rooted).
common/treesitter/grammars/json/BUILD.bazel Update treesitter dep label to //treesitter (module-rooted).
common/treesitter/grammars/java/BUILD.bazel Update treesitter dep label to //treesitter (module-rooted).
common/treesitter/grammars/golang/BUILD.bazel Update treesitter dep label to //treesitter (module-rooted).
common/treesitter/BUILD.bazel Update deps to //:common and //logger (module-rooted).
common/rule/BUILD.bazel Update logger dep label to //logger (module-rooted).
common/gazelle.bzl Add wrapper macro for gazelle_generation_test supporting .test-* dotfiles.
common/cache/BUILD.bazel Update buildinfo/logger dep labels to module-rooted targets.
common/bazel/BUILD.bazel Update workspace dep label to //bazel/workspace (module-rooted).
common/MODULE.bazel Introduce aspect_gazelle module definition with go_deps and tree-sitter archives.
common/BUILD.bazel Move Gazelle targets into the aspect_gazelle module root package.
MODULE.bazel Convert repo root to aspect_gazelle_workspace and depend on aspect_gazelle via local override.
BUILD.bazel Remove root-level Gazelle targets (now in common/BUILD.bazel).
.gitignore Ignore Bazel output under common/.
.bazelignore Ignore common/ at root workspace level (common becomes external module).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread MODULE.bazel
Comment on lines 21 to 27
# Go deps loaded just for bazel/tools
go_deps2 = use_extension("@gazelle//:extensions.bzl", "go_deps", dev_dependency = True)
go_deps2 = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps2.module(
path = "golang.org/x/tools",
sum = "h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE=",
version = "0.37.0",
sum = "h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s=",
version = "0.43.0",
)
Comment thread MODULE.bazel
Comment on lines +35 to +37
bazel_dep(name = "aspect_rules_lint", version = "2.3.0")
bazel_dep(name = "bazelrc-preset.bzl", version = "1.9.2")
bazel_dep(name = "buildifier_prebuilt", version = "8.5.1")
Comment thread .bazelignore
@@ -1,3 +1,4 @@
common
language
Comment thread MODULE.bazel
Comment on lines +13 to 18
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.nogo(nogo = "//bazel/go:nogo")
go_sdk.from_file(
go_sdk.download(
name = "go_sdk",
go_mod = "//common:go.mod",
version = "1.26.1",
)
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