Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The test labeled for unknown statuses only exercises a missing memory entry, leaving the unknown-status fallback unverified.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
What changed in this PR
Adds an advisory platform check before RAM downscaling, warning users when usage may exceed the target package.
Changes:
- Added downscale-risk API support to the test fake.
- Implemented timeout-bounded risk checks and warnings.
- Added tests and updated generated command documentation.
| File | Description |
|---|---|
internal/testutil/fake_cluster.go |
Adds fake RPC support. |
internal/cmd/cluster/scale.go |
Performs risk checks and prints warnings. |
internal/cmd/cluster/scale_test.go |
Covers warning and scale behavior. |
docs/reference/qcloud_cluster_scale.md |
Documents downscale warnings. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+598
to
+600
| env.Server.GetClusterDownscaleRiskCalls.Returns( | ||
| &clusterv1.GetClusterDownscaleRiskResponse{DownscaleRisks: []*clusterv1.ClusterDownscaleRiskInfo{}}, | ||
| nil, |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What changed
qcloud cluster scalenow asks the platform whether the target package still holds what the cluster is using, and prints a warning above the confirmation prompt when it does not. Until now the CLI submitted every downscale without comment, because the platform stopped refusing them in CCL-1549. The warning is advisory: it never blocks a scale, and--forceskips the prompt but still prints the warning, so a scripted downscale leaves the reason in its log.What the platform answers, and what the CLI does with it:
NO_RISKUSAGE_EXCEEDS_TARGETUSAGE_UNKNOWN, an unknown status, or a failed callWhy
The memory check no longer sits on the submit path, so the platform accepts a downscale that leaves a cluster with less RAM than its data needs. The Cloud UI already warns before that happens. The CLI did not, which made it the one surface where a user could scale a cluster into an out-of-memory condition without ever being told.
Screenshot of usage
Notes
-o jsonon stdout is unchanged.--nodes,--diskand CPU-only scales cost no extra round trip.--debugprints the verdict, or the reason the check was skipped. Silence is the correct output forNO_RISK, and that is the only way to tell it apart from a check that never ran.GetClusterDownscaleRiskhas been in the generated client sinceqdrant-cloud-public-api0.168.0 and this repo pins 0.176.0.docs/reference/qcloud_cluster_scale.mdis regenerated output frommake docs.scale_test.go. Not yet exercised against a live cluster: hybrid packages in dev start at the size the test cluster already runs, so there is no smaller package to scale to.