Add explicit field_mask to Data Connect getConnector call#10799
Add explicit field_mask to Data Connect getConnector call#10799fredzqm wants to merge 4 commits into
Conversation
Co-authored-by: fredzqm <9068391+fredzqm@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Code Review
This pull request updates the getConnector function in src/dataconnect/client.ts to limit the returned fields to "name,source" using query parameters. The reviewer pointed out that this restriction will omit other fields defined in the types.Connector interface, such as client_cache, which may be required by callers of this function. They suggested including client_cache in the fields mask to prevent potential issues.
| const res = await dataconnectClient().get<types.Connector>(name); | ||
| const res = await dataconnectClient().get<types.Connector>(name, { | ||
| queryParams: { | ||
| fields: "name,source", |
There was a problem hiding this comment.
The types.Connector interface (defined in src/dataconnect/types.ts) includes a client_cache field. By explicitly limiting the fields query parameter to "name,source", the client_cache field (and potentially other fields like createTime or updateTime from BaseResource) will be omitted from the response. If these fields are needed by any callers of getConnector, they should be included in the fields mask.
| fields: "name,source", | |
| fields: "name,source,client_cache", |
Co-authored-by: fredzqm <9068391+fredzqm@users.noreply.github.com>
Co-authored-by: fredzqm <9068391+fredzqm@users.noreply.github.com>
Updated
getConnectorinsrc/dataconnect/client.tsto explicitly specify thefieldsparameter ("name,source"), resolving an issue where thegetcall for Connectors used the default*instead of detailing the required fields explicitly.PR created automatically by Jules for task 4339466892693943361 started by @fredzqm