fix(gcp): remove the project from the number call#2231
Conversation
Signed-off-by: Hector Martinez <hemartin@redhat.com>
Site previewPreview: https://2e6c018d-site.fullsend-ai.workers.dev Commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
🤖 Finished Review · ✅ Success · Started 3:00 PM UTC · Completed 3:10 PM UTC |
ReviewFindingsLow
|
| resp, err := c.Client.DoRequest(ctx, http.MethodGet, reqURL, "") | ||
| // CRM is a global API — omit x-goog-user-project to avoid requiring | ||
| // the API to be enabled on the target project. | ||
| noQuotaClient := *c.Client |
There was a problem hiding this comment.
[low] struct-copying-pattern
The shallow copy noQuotaClient := *c.Client shares pointer fields (httpClient, tokenFunc) with the original. This is safe because those fields are read-only after initialization, but the pattern is novel in this codebase.
Suggested fix: Add a brief inline comment noting the shallow copy is intentional and safe because the shared pointer fields are read-only after initialization.
| url.PathEscape(projectID)) | ||
|
|
||
| resp, err := c.Client.DoRequest(ctx, http.MethodGet, reqURL, "") | ||
| // CRM is a global API — omit x-goog-user-project to avoid requiring |
There was a problem hiding this comment.
[low] design-fit
The comment explains what is done (omit x-goog-user-project) but does not explain the billing model implication -- that CRM API quota is billed to the callers ADC credentials, not the target project.
Suggested fix: Expand the comment to briefly note that CRM quota is billed to the callers credentials, not the target project.
ralphbean
left a comment
There was a problem hiding this comment.
If this works, then cloudresourcemanager still needs to be removed from 2-3 places in the cli and 4-5 places in the docs.
cloudresourcemanagerpermissions on the GCP project.