An experimental Bazel/Bzlmod workspace that stitches every active Go module in
the git-pkgs org into a single dependency
graph. Gazelle generates the targets from the source; the per-repo build stays
authoritative.
gh (authenticated), git, jq, go 1.27+, graphviz, and bazelisk on $PATH
(go install github.com/bazelbuild/bazelisk@latest, or set BAZEL=bazel if
you already manage Bazel versions another way).
make bootstrap runs, in order:
scripts/sync-repos.shlists the org viagh, drops forks, archived repos,infra, and this repo, and clones/updates the rest intorepos/.scripts/gen-gowork.shwritesgo.workcovering everygo.modunderrepos/, promotes conflictingreplacedirectives to workspace level sogo work syncconverges, and drops a# gazelle:prefixstub in each module root so nested modules with foreign import paths resolve locally.bazel mod tidyrefreshesuse_repo(...)inMODULE.bazelfrom the combinedrequireset.bazel run //:gazellescansrepos/and writesBUILD.bazelfiles.
Generated BUILD.bazel files are written only into the local repos/ clones.
The first run fetches the Go SDK and every transitive external module for the
query index, so expect a few minutes; subsequent runs are seconds.
make sync gazelle # pull latest main across the org and regenerate
make gazelle # regenerate from whatever is already in repos/
make graph # package-level DOT of all //repos/... edges
make graph-repos # collapsed to one node per repo (every edge)
make graph-architecture # graph-repos with transitive reduction applied
make deps TARGET=//repos/brief/... # git-pkgs packages a target pulls in
make rdeps TARGET=//repos/purl:purl # everything in the org that reaches it
Ad-hoc queries work directly (the .bazelrc sets query --noimplicit_deps so
toolchain edges stay out of results):
bazel query 'somepath(//repos/silo/..., //repos/vers:vers)'
bazel query --output=graph 'allpaths(//repos/git-pkgs/..., //repos/purl:purl)'
Gazelle warnings of the form finding module path for import github.com/git-pkgs/<x>/<y> mean one repo on main imports a package another
repo's main has since removed: real cross-repo drift the graph is surfacing.
repos/, go.work, MODULE.bazel.lock, and the graph outputs are
git-ignored. MODULE.bazel is checked in; bazel mod tidy (run by
make gazelle) keeps its use_repo list matched to the current sync.
MIT. The cloned repositories under repos/ keep their own
licences.