Skip to content

feat(sidekick): refine resource identification heuristics#5299

Draft
haphungw wants to merge 7 commits into
googleapis:mainfrom
haphungw:demo-o11y-heuristic
Draft

feat(sidekick): refine resource identification heuristics#5299
haphungw wants to merge 7 commits into
googleapis:mainfrom
haphungw:demo-o11y-heuristic

Conversation

@haphungw
Copy link
Copy Markdown
Contributor

@haphungw haphungw commented Apr 10, 2026

Add message-based fallback heuristics to identify resource names.

Staged @ googleapis/google-cloud-rust#5561

Fixes #5384

Copy link
Copy Markdown
Contributor

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

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 introduces a fallback heuristic for resource identification, enabling the system to identify target resources from method input fields when path templates are missing. It also adds default path bindings for gRPC methods. The review feedback points out that the heuristic logic is currently unreachable for methods with a nil PathInfo and suggests a more idiomatic approach for accessing nested message fields by using the MessageType property directly instead of performing manual lookups.

Comment thread internal/sidekick/api/resource_identification.go Outdated
Comment thread internal/sidekick/api/resource_identification.go
@julieqiu
Copy link
Copy Markdown
Member

@haphungw it looks like this PR hasn't been updated in a week. Do you still plan to work on it?

@haphungw
Copy link
Copy Markdown
Contributor Author

Hi @julieqiu, yes, I still plan to work on this. We are deferring it until after the code freeze to avoid risk. I'll resume work then.

@julieqiu
Copy link
Copy Markdown
Member

julieqiu commented Apr 16, 2026

Thanks @haphungw! Since the code freeze is lasting for more than another week, would you mind closing this PR and then reopening it when it is ready for review, per https://github.com/googleapis/librarian/blob/main/CONTRIBUTING.md#keeping-the-pull-request-dashboard-clean?

haphungw added 7 commits May 12, 2026 17:00
When generating code for methods without http mappings, we create a synthetic path binding so that resource heuristics can be applied. However, the Rust transport template expects every binding to have an http verb.
This change sets a default value (POST) for the synthetic binding verb, preventing compilation errors in the generated Rust code.
@haphungw haphungw force-pushed the demo-o11y-heuristic branch from 24d3877 to d97e003 Compare May 12, 2026 17:06
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.

sidekick: Resource ID heuristic misses some RPCs

2 participants