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

@haphungw haphungw commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Add message-based fallback heuristics to identify resource names.

Staged @ googleapis/google-cloud-rust#5561

Fixes #5384

@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 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

julieqiu commented Apr 16, 2026

Copy link
Copy Markdown
Member

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
@coryan

coryan commented May 27, 2026

Copy link
Copy Markdown
Contributor

This is still marked as draft. Do we still need it?

@haphungw

Copy link
Copy Markdown
Contributor Author

There's a change to the solution for this. I'm still working on it.

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

3 participants