Skip to content

build(etl): rename submodule path to match directory for Go consumability#300

Merged
raymondjacobson merged 1 commit into
mainfrom
etl/fix-module-path
May 20, 2026
Merged

build(etl): rename submodule path to match directory for Go consumability#300
raymondjacobson merged 1 commit into
mainfrom
etl/fix-module-path

Conversation

@raymondjacobson
Copy link
Copy Markdown
Contributor

Summary

The etl submodule declared its module path as `github.com/OpenAudio/go-openaudio/etl` while living in the directory `pkg/etl/`. Go's multi-module repo rules require the module path to match the directory path within the repo — otherwise external consumers can't resolve the submodule at all, regardless of how tags are formatted.

Quoting Go's docs on multi-module repos:

A version tag in a module subdirectory must be prefixed with the relative path from the root of the repository to the module's go.mod file, followed by '/'. For example, the module example.com/repo/sub at version v1.5.2 corresponds to the tag sub/v1.5.2.

Concretely, with the old setup:

```
$ go get github.com/OpenAudio/go-openaudio/etl@v1.3.0
go: module github.com/OpenAudio/go-openaudio@v1.3.0 found,
but does not contain package github.com/OpenAudio/go-openaudio/etl
```

Go interprets the path as a subpackage of the parent module (since no `etl/` directory exists at repo root) and never finds it. The pkg/etl/v1.3.0 tag I pushed earlier in this thread is currently inert.

Changes

File Change
`pkg/etl/go.mod` `module github.com/OpenAudio/go-openaudio/etl` → `.../pkg/etl`
`go.mod` (root) require + replace directive bumped to new module path
54 `.go` files mechanical import-path rewrite via sed
`release-please-config.json` `pkg/etl` package's `component` and `package-name` changed from `"etl"` → `"pkg/etl"` so generated tags are `pkg/etl/vX.Y.Z`
`pkg/etl/README.md`, `pkg/etl/FEATURE.md` stale path references

After this lands

  1. The previously-pushed `pkg/etl/v1.3.0` tag becomes externally consumable: `go get github.com/OpenAudio/go-openaudio/pkg/etl@v1.3.0` resolves.
  2. Release-please will open a new release PR; its first lockstep cut will produce `v1.4.0` + `pkg/etl/v1.4.0` tags (correct Go submodule tag format).
  3. The deleted `etl/v1.3.0` tag stays gone — release-please won't recreate that format.

Side note

Closed #298 (the release-please PR with the old `etl/v1.4.0` tag format) before opening this. Release-please will reopen with the correct format after this merges.

Verified

`go build ./...` clean in both modules. Only `go vet ./...` warnings are pre-existing in unrelated packages.

…lity

The etl submodule declared its module path as
`github.com/OpenAudio/go-openaudio/etl` while living in the directory
`pkg/etl/`. Go's multi-module repo rules require the module path to
match the directory path within the repo — otherwise external consumers
can't resolve the submodule at all, regardless of how tags are formatted.

Quoting Go's docs on multi-module repos:

> A version tag in a module subdirectory must be prefixed with the
> relative path from the root of the repository to the module's go.mod
> file, followed by '/'. For example, the module example.com/repo/sub
> at version v1.5.2 corresponds to the tag sub/v1.5.2.

Concretely, `go get github.com/OpenAudio/go-openaudio/etl@v1.3.0`
fails with "module github.com/OpenAudio/go-openaudio@v1.3.0 found,
but does not contain package github.com/OpenAudio/go-openaudio/etl"
— Go interprets the path as a subpackage of the parent module (since
no `etl/` directory exists at repo root) and never finds it.

Changes:

- pkg/etl/go.mod: `module github.com/OpenAudio/go-openaudio/etl` →
  `module github.com/OpenAudio/go-openaudio/pkg/etl`
- Rewrite ~54 import statements across cmd/, pkg/, examples/.
- Root go.mod: bump the etl require + replace directive to the new
  module path.
- release-please-config.json: change the etl package's `component`
  and `package-name` from "etl" to "pkg/etl" so generated tags become
  `pkg/etl/vX.Y.Z` (matching Go's submodule tag convention).
- pkg/etl/README.md and pkg/etl/FEATURE.md: stale path references.

After this lands, the previously-pushed `pkg/etl/v1.3.0` tag becomes
externally consumable via `go get github.com/OpenAudio/go-openaudio/pkg/etl@v1.3.0`.
The bad `etl/v1.3.0` tag (deleted earlier in this work) will not be
recreated by release-please now that the component name is corrected.

Verified `go build ./...` clean in both the root module and pkg/etl/.
@raymondjacobson
Copy link
Copy Markdown
Contributor Author

Updated to also fix the 10 .templ source files in pkg/explorer/templates/pages/ — they still had the old github.com/OpenAudio/go-openaudio/etl/db import. Without this fix, running templ generate after merge would regenerate the *_templ.go files with the broken old import path and break the build.

To answer the original question: yes, the explorer keeps working in prod after this change. Confirmed by:

  • go build ./pkg/explorer/... clean (explorer compiles)
  • go build ./cmd/openaudio/... clean (the prod binary that embeds explorer compiles)
  • All 10 explorer page .templ sources have the corrected import; the generated *_templ.go files (touched by the original sed) match. Future templ generate runs stay consistent.

The explorer imports (pkg/etl, pkg/etl/db, pkg/etlserver) all resolve via the in-repo replace directive in the root go.mod, which I updated to the new path. Production builds from the repo itself, so consumption mechanics are identical to today — the rename only affects external Go-module consumers.

Updated PR is force-pushed; please re-review.

@raymondjacobson raymondjacobson merged commit c40bd1d into main May 20, 2026
5 checks passed
@raymondjacobson raymondjacobson deleted the etl/fix-module-path branch May 20, 2026 22:24
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.

1 participant