Skip to content

fix(gcp): query the resource-based commitment recommender - #162

Merged
cristim merged 2 commits into
mainfrom
fix/gcp-usage-commitment-recommender
Sep 29, 2026
Merged

cristim merged 2 commits into
mainfrom
fix/gcp-usage-commitment-recommender

Conversation

@cristim

@cristim cristim commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Compute Engine recommendation requests currently select a nonexistent recommender. Use Google's documented google.compute.commitment.UsageCommitmentRecommender under the existing project and region parent so resource-based CUD recommendations can be returned.

The regression calls the public provider adapter through the real Google SDK against local HTTP and gRPC fixture services. It checks both regional parent paths, routing metadata, pagination, ACTIVE filtering, returned savings, empty results, all-region errors, and partial success. Existing failure aggregation remains unchanged.

Validation: the regression failed on the original ID with the wrong full parent and NotFound, then passed with the fix. GCP module race tests, build, vet, pinned golangci-lint 2.10.1 and normal commit hooks pass. Independent GPT-6 Astra review completed two implementation passes and reproduced the regression by reversing the ID.

Independent final verdict: APPROVED 6104f675db263c818760e3347cf2bb9ab3207a04, no actionable findings. This additive merge includes main e879f6ae5db035beefe6711de8120fe80ff0cfe0; the GCP diff is unchanged. Focused GCP, AWS daily coverage, and Azure pager regression race tests passed on the combined tree, along with GCP build, vet and pinned lint. The reviewer checked both merge parents and the full committed PR diff, then reran GOWORK=off GOTOOLCHAIN=go1.26.6 go test -race -count=1 -run TestComputeRecommendationsThroughSDK . from providers/gcp; it passed on macOS at the final SHA.

Evidence uses actual SDK clients with local fixture responses, not a live Google backend. No cloud credentials or mutations were used; purchase conversion and pricing are not changed.

References: Google recommender catalog, project-scoped list API.

Closes #134

Use the catalogued project-scoped UsageCommitmentRecommender ID.
Exercise regional discovery and recommendation pagination through the
real SDK with local fixture services, including failure aggregation.
@cristim cristim added triaged Item has been triaged urgency/this-sprint Within the current sprint priority/p1 Next up; this sprint severity/high Significant harm impact/many Affects most users effort/s Hours type/bug Defect labels Sep 29, 2026
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 22 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 68 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: LeanerCloud/cloud-commitments-go/.coderabbit.yaml

Review profile: CHILL

Plan: Essentials

Run ID: 5b00a5b1-1fae-40a6-b989-2bb59aaf69a3

📥 Commits

Reviewing files that changed from the base of the PR and between e879f6a and 6104f67.

📒 Files selected for processing (2)
  • providers/gcp/recommendations_sdk_test.go
  • providers/gcp/services/computeengine/client.go

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/s Hours impact/many Affects most users priority/p1 Next up; this sprint severity/high Significant harm triaged Item has been triaged type/bug Defect urgency/this-sprint Within the current sprint

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(gcp/computeengine): recommendations query a nonexistent recommender ID, so GCP CUD recs are always empty

1 participant