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 registered

The 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.protocrates/glaz-proto/proto/glaz/relationships/relationships.proto
  • Updated the import statement in crates/glaz-proto/service.proto from proto/relationships/relationships.proto to proto/glaz/relationships/relationships.proto
  • Updated crates/glaz-proto/proto/README.md to 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.rs in both glaz-proto and glaz-service required no changes: both use include paths that resolve the new file location correctly (. and ../glaz-proto respectively)
  • 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 --workspace passes
  • cargo clippy --workspace --all-targets is clean
  • cargo fmt --all --check is clean

Author checklist

  • Title follows Conventional Commits and breaking changes are flagged
  • Docs / comments updated where behaviour changed
  • No unrelated changes swept in
Edited by Bojan Marjanovic

Merge request reports

Loading
Loading