Skip to content

[-] rpc: depend on pgwatch's own pgwatch.proto - #43

Merged
pashagolub merged 2 commits into
mainfrom
claude/rpc-pgwatch-dependency-cd44f6
Sep 3, 2026
Merged

[-] rpc: depend on pgwatch's own pgwatch.proto#43
pashagolub merged 2 commits into
mainfrom
claude/rpc-pgwatch-dependency-cd44f6

Conversation

@pashagolub

Copy link
Copy Markdown
Contributor

Summary

  • rpc/go.mod's module path was still github.com/destrex271/pgwatch3_rpc_server, a leftover from before this code was folded into pgwatch-contrib — no code actually depended on that repo, every reference was this module importing itself under the stale name.
  • sinks/pb/pgwatch.proto was a hand-copied duplicate of pgwatch's own api/pb/pgwatch.proto, with nothing keeping the two in sync.
  • Renamed the module to github.com/cybertec-postgresql/pgwatch-contrib/rpc and added a real dependency on github.com/cybertec-postgresql/pgwatch/v6. A new generator (sinks/pb/gen) resolves that dependency's on-disk location via go list -m on every go generate ./sinks/pb, copies its pgwatch.proto in locally, and generates the Go/gRPC bindings from that copy — so the schema this repo builds against always matches upstream. sinks/pb/pgwatch.proto is now a generated artifact (gitignored) instead of checked-in source.
  • Picking up a future upstream schema change is now go get -u github.com/cybertec-postgresql/pgwatch/v6 && go generate ./sinks/pb.

Note for reviewers

Pinned to github.com/cybertec-postgresql/pgwatch/v6's master pseudo-version rather than the v6.0.0-beta tag: that tag's go.mod still declares module path .../v5, so Go's module resolver can't treat it as a valid /v6 version. Worth a follow-up tag fix on the pgwatch repo itself, but that's a separate change in a different repository.

Test plan

  • go generate ./sinks/pb — confirmed it fetches and matches pgwatch's upstream pgwatch.proto byte-for-byte
  • go build ./... and go vet ./... — clean
  • go test -short ./... — all packages pass except a pre-existing Windows-only DuckDB file-locking flake in duckdb_receiver, unrelated to this change (the sinks package that actually uses the generated pb types passes)

rpc/go.mod's module path was still github.com/destrex271/pgwatch3_rpc_server,
a leftover from before this code was folded into pgwatch-contrib, and
sinks/pb/pgwatch.proto was a hand-copied duplicate of pgwatch's own
api/pb/pgwatch.proto with nothing keeping the two in sync.

Rename the module to github.com/cybertec-postgresql/pgwatch-contrib/rpc and
add a real dependency on github.com/cybertec-postgresql/pgwatch/v6. A new
generator (sinks/pb/gen) resolves that dependency's on-disk location via
`go list -m` on every `go generate ./sinks/pb`, copies its pgwatch.proto in
locally, and generates the Go/gRPC bindings from that copy - so the schema
this repo builds against always matches upstream, and bumping the pgwatch
dependency is what picks up schema changes going forward.
@pashagolub pashagolub changed the title rpc: depend on pgwatch's own pgwatch.proto instead of a stale duplicate [-] rpc: depend on pgwatch's own pgwatch.proto Sep 3, 2026
@pashagolub pashagolub self-assigned this Sep 3, 2026
@pashagolub pashagolub added the enhancement New feature or request label Sep 3, 2026
@pashagolub
pashagolub merged commit 4d270f1 into main Sep 3, 2026
2 checks passed
@pashagolub
pashagolub deleted the claude/rpc-pgwatch-dependency-cd44f6 branch September 3, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant