Repository navigation
fix(settings): repair GCP rows holding an AWS payment and refuse an empty cache window - #1495
Conversation
…-only propagation Before the AWS-only payment propagation, a changed global default could copy an AWS token onto GCP rows, which GCP validation then rejects on every later save. GCP cards have no payment control, so treat a GCP row whose stored payment is not monthly like the normalised-payment case (#545): the next PUT of that row carries payment monthly. Also add an integration case for the "AWS accepts it" clause of propagateChangedDefaults: a default payment of monthly leaves AWS rows unchanged. Part of #539 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e window
An emptied Savings Plan coverage card was only caught by the Save toast.
Mark the card validators required so the inline error shows too.
An emptied cache-stale-hours input read as Number('') = 0 and saved as
"disable auto-refresh". 0 is a legal value (the backend accepts 0..8760),
so refuse only the empty string with the existing validation error.
Also pin that an unedited coverage card is never flagged by the Save-time
check, whatever its stored value.
Part of #539
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Required settings validation frontend/src/settings.ts, frontend/src/__tests__/settings.test.ts, frontend/src/__tests__/settings-service-payment.test.ts |
Cache-staleness and Savings Plan coverage inputs reject empty values. Save validation rejects an empty stale-hours value but accepts 0. Tests verify that untouched stored Savings Plan coverage does not block saving another setting. |
Service payment updates frontend/src/settings.ts, frontend/src/__tests__/settings-service-payment.test.ts, internal/config/store_postgres_payment_propagation_integration_test.go |
GCP service saves repair stored payment values when no payment control is present. Tests check the partial PUT payload and verify that a global default-payment update preserves an AWS service’s existing no-upfront value. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Possibly related PRs
- LeanerCloud/cloud-commitments-platform#1487: This PR extends the changed-service-field payment handling introduced in that PR to GCP rows without a payment control.
Suggested reviewers: iamjsd
Merge Risk: 
Minimal · up to f424e
-
No actionable issue remains from the supplied evidence; the change is ready to merge after normal checks.
Pre-merge checks: 
5
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
Independent review 1 (cold, fresh context): VERDICT: APPROVE f424efe Reviewed
|
|
Independent review 2 (claude-fleet, cold): APPROVE f424efe Findings:
Attacked:
Verified locally:
Reviewed by an independent agent with no author context (second reviewer). Review only: nothing was pushed, and the GitHub review state is unchanged. |
|
Local verification at
|
Part of #539. This follows up on #1487 with the points both of its reviews raised.
Changes:
all-upfrontonto GCP service rows. GCP validation accepts onlymonthly, and GCP cards have no payment control, so every later save of such a row failed with a 400. When Settings loads a GCP row whose stored payment isn'tmonthly, it now treats the row like the fix(settings): Save sends Azure/GCP payment values the service-config handler rejects #545 normalised-payment case: the next PUT of that row carriespayment: "monthly".monthly, which is valid globally but not for AWS, and checks that AWS rows are left unchanged. Without the "AWS accepts it" check inpropagateChangedDefaults, the test fails.0, which turns caching off. It's now refused with the existing validation error. An explicit0is still accepted, because the backend allows 0 to 8760 and treats 0 as off (validation.go:383).Tests:
all-upfrontsends{term, payment:"monthly"};monthlyGCP row sends only{term};requiredeach fails a test.Local:
go test -raceand the integration test pass on config.🤖 Generated with Claude Code
Summary by CodeRabbit
0remains valid.