[-] rpc: depend on pgwatch's own pgwatch.proto - #43
Merged
Conversation
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.
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.
Summary
rpc/go.mod's module path was stillgithub.com/destrex271/pgwatch3_rpc_server, a leftover from before this code was folded intopgwatch-contrib— no code actually depended on that repo, every reference was this module importing itself under the stale name.sinks/pb/pgwatch.protowas a hand-copied duplicate of pgwatch's ownapi/pb/pgwatch.proto, with nothing keeping the two in sync.github.com/cybertec-postgresql/pgwatch-contrib/rpcand added a real dependency ongithub.com/cybertec-postgresql/pgwatch/v6. A new generator (sinks/pb/gen) resolves that dependency's on-disk location viago list -mon everygo generate ./sinks/pb, copies itspgwatch.protoin locally, and generates the Go/gRPC bindings from that copy — so the schema this repo builds against always matches upstream.sinks/pb/pgwatch.protois now a generated artifact (gitignored) instead of checked-in source.go get -u github.com/cybertec-postgresql/pgwatch/v6 && go generate ./sinks/pb.Note for reviewers
Pinned to
github.com/cybertec-postgresql/pgwatch/v6'smasterpseudo-version rather than thev6.0.0-betatag: that tag'sgo.modstill declares module path.../v5, so Go's module resolver can't treat it as a valid/v6version. Worth a follow-up tag fix on thepgwatchrepo itself, but that's a separate change in a different repository.Test plan
go generate ./sinks/pb— confirmed it fetches and matches pgwatch's upstreampgwatch.protobyte-for-bytego build ./...andgo vet ./...— cleango test -short ./...— all packages pass except a pre-existing Windows-only DuckDB file-locking flake induckdb_receiver, unrelated to this change (thesinkspackage that actually uses the generatedpbtypes passes)