Skip to content

docs: expand handwritten client guidelines - #7462

Open
coryan wants to merge 2 commits into
googleapis:mainfrom
coryan:handwritten-client-guidelines
Open

coryan wants to merge 2 commits into
googleapis:mainfrom
coryan:handwritten-client-guidelines

Conversation

@coryan

@coryan coryan commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Document additional design and review guidelines for hand-written crates and proc-macro crates in AGENTS.md, ARCHITECTURE.md, .gemini/styleguide.md, and
doc/contributor/howto-guide-handwritten-client-api.md:

  • Give environment variables (such as *_EMULATOR_HOST, GOOGLE_CLOUD_UNIVERSE_DOMAIN, and GOOGLE_CLOUD_RUST_LOGGING) higher precedence than programmatic ClientBuilder options, and use anonymous credentials for emulators.
  • Omit Eq and Hash on open protocol enums, preserve REST/ProtoJSON string unknown enum values via wkt::internal::UnknownEnumValue, keep opaque Unknown variants on protocol oneof unions, and retain all proto response fields.
  • Clear sibling branches in mutually exclusive wire oneof setters and ensure all PartialEq fields on stub/model types have public accessors.
  • Coordinate multi-layer retries, test outer async fn Send bounds with async move closures, enforce 100% __private proc-macro hygiene and pairwise flatten overlap checks, and test spans with TestLayer.

Document additional design and review guidelines for hand-written crates
and proc-macro crates in AGENTS.md, ARCHITECTURE.md,
.gemini/styleguide.md, and
doc/contributor/howto-guide-handwritten-client-api.md:

- Give environment variables (such as *_EMULATOR_HOST,
  GOOGLE_CLOUD_UNIVERSE_DOMAIN, and GOOGLE_CLOUD_RUST_LOGGING) higher
  precedence than programmatic ClientBuilder options, and use anonymous
  credentials for emulators.
- Omit Eq and Hash on open protocol enums, preserve REST/ProtoJSON string
  unknown enum values via wkt::internal::UnknownEnumValue, keep opaque
  Unknown variants on protocol oneof unions, and retain all proto response
  fields.
- Clear sibling branches in mutually exclusive wire oneof setters and
  ensure all PartialEq fields on stub/model types have public accessors.
- Coordinate multi-layer retries, test outer async fn Send bounds with
  async move closures, enforce 100% __private proc-macro hygiene and
  pairwise flatten overlap checks, and test spans with TestLayer.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request comprehensively updates the SDK's developer guidelines and architecture documentation (including AGENTS.md, ARCHITECTURE.md, and the handwritten client API guide) to establish strict rules for proc-macro hygiene, open protocol enums, environment variable precedence, multi-layer retry coordination, and async Send bounds. The feedback suggests correcting the pseudo-code examples in the documentation where unsupported inline string interpolation is used in Rust string literals.

Comment thread AGENTS.md Resolved
@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.61%. Comparing base (bb112d0) to head (89af070).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7462   +/-   ##
=======================================
  Coverage   98.60%   98.61%           
=======================================
  Files         338      338           
  Lines      148237   148237           
=======================================
+ Hits       146172   146180    +8     
+ Misses       2065     2057    -8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coryan
coryan marked this pull request as ready for review November 13, 2026 21:34
@coryan
coryan requested a review from a team as a code owner November 13, 2026 21:34

This branch has not been deployed

No deployments
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