fix(proto)!: relocate relationships.proto under proto/glaz/ to avoid descriptor collision
What
Move crates/glaz-proto/proto/relationships/relationships.proto to crates/glaz-proto/proto/glaz/relationships/relationships.proto and update the import in service.proto accordingly.
Why
Go's (and other languages') global proto registries key registered file descriptors by the module-relative file path, not by the proto package name. GLAZ's relationships proto previously shared the descriptor path proto/relationships/relationships.proto with IAM's own relationships contract (gitlab-org/auth/iam), which is vendored by consumers such as the Artifact Registry. Any binary linking both the GLAZ client and the IAM client panicked at init:
panic: proto: file "proto/relationships/relationships.proto" is already registeredThe Artifact Registry worked around this downstream by staging an ephemeral copy of the proto at a different path before running buf generate (see artifact-registry!951). This MR fixes the root cause upstream in GLAZ.
Closes #
Changes
- Renamed
crates/glaz-proto/proto/relationships/relationships.proto→crates/glaz-proto/proto/glaz/relationships/relationships.proto - Updated the
importstatement incrates/glaz-proto/service.protofromproto/relationships/relationships.prototoproto/glaz/relationships/relationships.proto - Updated
crates/glaz-proto/proto/README.mdto reflect the new path and document the reason for the namespacing
Out of scope / unchanged
- The proto package name (
relationships.v1), all message definitions, and all field numbers are unchanged build.rsin bothglaz-protoandglaz-servicerequired no changes: both use include paths that resolve the new file location correctly (.and../glaz-protorespectively)- No Rust source files reference the old file path; they reference the Rust module path (
glaz_proto::relationships::v1) which is derived from the proto package name, not the file path
⚠️ Breaking change for GLAZ consumers
Existing consumers that generate stubs from this proto (e.g. via buf generate or protoc) will see the generated module/package path shift:
| Before | After | |
|---|---|---|
| Descriptor path | proto/relationships/relationships.proto |
proto/glaz/relationships/relationships.proto |
| Go generated package (if regenerated) | relationships/ |
glaz/relationships/ |
Consumers must regenerate their stubs and update their import paths. The Artifact Registry's existing workaround in artifact-registry!951 can be removed once this lands and AR updates its stub generation to point at the new path.
Testing
-
cargo test --workspacepasses -
cargo clippy --workspace --all-targetsis clean -
cargo fmt --all --checkis clean
Author checklist
- Title follows Conventional Commits and breaking changes are flagged
- Docs / comments updated where behaviour changed
- No unrelated changes swept in