Split the repo into one module per package - #65
Merged
Conversation
Inline a trace-API-only helper so grpcx no longer imports obsx. The access log keeps stamping the active span's trace_id; a new test pins the correlation contract before the module split makes obsx a separate, heavier module that grpcx must not require.
Give each of the 13 packages its own module (logger splits into zapx/zerolog/clog). Dependency versions stay pinned to the previous root go.mod; each module's go.sum now carries only what that module uses, so a service importing httpx no longer drags testcontainers, temporal, or the OTel SDK.
Discovers modules by go.mod, encodes / as : in target names, and fans out tidy/fmt/vet/lint/test via $(MAKE) so -j parallelises across modules. release-<module> VER=x.y.z validates semver, refuses commits not on origin/main, and tags <module>/vx.y.z; coverage merges per-module profiles for SonarCloud.
Deny imports of the terminal modules (obsx, dbx, migratex, temporalx) everywhere except each module's own tree, and the OTel SDK outside obsx (tests exempt). Also fix the goimports local-prefixes typo (duynhne) that kept local import grouping from ever applying.
go-check.yml assumes a single root go.mod the packages live in; check/build now run make test TAGS=integration natively, merge the per-module coverage profiles into the coverage.out artifact the sonarqube.yml reusable workflow already expects, and fail if tidy or fmt left uncommitted changes. release.yml also matches <module>/vX.Y.Z tags. .gitignore unanchors coverage.out for the per-module profiles.
AGENTS.md documents the 13-module architecture, the three-layer dependency rules with depguard enforcement, the Makefile targets, per-module tagging, the tombstone root module, and the contribution conventions (module-prefixed subjects, rebase-only). README gains the module/layer table and per-module install lines; docs/MIGRATION.md walks services off the frozen single-module v0.35.0 line, go.mod-only, including the ambiguous-import remedy via the vacated root v0.36.0.
gha-workflows' go-check.yml now takes cache-dependency-path and disables Ryuk in the unit-test job, so the multi-module gate no longer needs a bespoke job: command-test drives make test TAGS=integration, verifies tidy/fmt left no diff, and merges coverage for the sonarqube.yml artifact contract. Reusable lint stays off — lint runs per module inside make test. Referenced @main until the gha-workflows change merges and can be pinned.
Run the shared codeql.yml once per language: go with build-mode none (a multi-module monorepo has no root module to autobuild; CodeQL scans Go source without a build) and actions for the workflow files. Weekly cron catches newly added queries.
Labels live in .github/labels.yaml and EndBug/label-sync applies them with delete-other-labels, so the file is the whole set: a triage tier plus one area/* label per module, colored by layer.
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
gha-workflows now ships the cache-dependency-path input and the Ryuk-disabled unit-test step; pin the merged commit in place of the temporary @main reference.
duynhne
force-pushed
the
refactor/multi-module
branch
from
August 7, 2026 08:38
54cf3b7 to
30cd5b2
Compare
The single-module line github.com/duynhlab/pkg is frozen at v0.35.0 and will never publish another version. A dependency graph mixing the old require with a new per-module require fails with ambiguous import; consumers must drop the old require (see docs/MIGRATION.md). Nothing lives at the repo root anymore.
The runner's CodeQL CLI rejects build-mode none for Go, and autobuild cannot see a multi-module monorepo with no root module. Switch the go analysis to build-mode manual driving the new make build target, which compiles every module under the tracer.
duynhne
force-pushed
the
refactor/multi-module
branch
from
August 7, 2026 08:45
30cd5b2 to
2520053
Compare
Platform, DBA and SRE teams plus @duyhenryer own the whole repo. Owners share one * line: with duplicate patterns GitHub honors only the last matching line, so separate lines would drop the teams.
Weekly grouped updates for workflow actions, labeled area/ci and dependencies to match .github/labels.yaml.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: Split the repo into one module per package
What
go.modper package (loggersplits intozapx/zerolog/clog), tagged separately as<module>/vX.Y.Zstarting atv0.36.0. Import paths are unchanged; dependency versions stay pinned to the previous rootgo.mod.make test-<module>gate (tidy+fmt+vet+lint+race tests),make release-<module> VER=x.y.zwith semver/clean-tree/on-main guards, coverage merge for SonarCloud.go-check.yml(needs go-check: Support multi-module monorepos gha-workflows#103 merged, then pin the SHA — currently@main); CodeQL (go + actions) added; labels synced declaratively from.github/labels.yaml; release workflow matches<module>/vX.Y.Ztags.docs/MIGRATION.mdfor moving the 10 services offpkg@v0.35.0(go.mod-only, no code changes).Why
A service importing only
httpxcurrently drags the full tree (testcontainers/moby, temporal, pyroscope, OTel SDK) into itsgo.sum, and every change bumps one shared version. Per-module tagging isolates dependencies and lets modules version independently.Verification
make modules= 13;make testgreen for all modules (race + lint, 0 issues); integration tests run in CI (Docker).buf lint+buf generatewith the pinned codegen versions → zero stub diff.require pkg/httpx + pkg/logger/zapxvia replace) builds; its go.sum carries no heavy transitive deps.v0.35.0and earlier) keep resolving — tags are immutable snapshots.After merge
check.yml/build.yml(TODO comments mark the spots).make release-<module> VER=0.36.0for all 13 modules.docs/MIGRATION.md.🤖 Generated with Claude Code