Skip to content

feat(settings): Azure and GCP create-override modal (closes #109) - #588

Merged
cristim merged 2 commits into
feat/multicloud-web-frontendfrom
feat/issue-109-azure-gcp-override-modal
May 27, 2026
Merged

feat(settings): Azure and GCP create-override modal (closes #109)#588
cristim merged 2 commits into
feat/multicloud-web-frontendfrom
feat/issue-109-azure-gcp-override-modal

Conversation

@cristim

@cristim cristim commented May 20, 2026

Copy link
Copy Markdown
Member

Summary

  • Drop the canCreate = provider === 'aws' gate in loadOverridesPanel; Azure and GCP accounts now get the "Add override" button and auto-open the create modal on empty state
  • Add AZURE_OVERRIDE_SERVICES and GCP_OVERRIDE_SERVICES lists; getOverrideServicesForProvider dispatches to the right list so the service dropdown is provider-aware
  • Remove o.provider === 'aws' inline-editing guards for Term, Payment, Coverage, and Enabled cells on existing override rows
  • Payment dropdown uses getCommitmentConfig(provider).payments as fallback; Azure shows upfront/monthly, GCP shows monthly-only
  • Remove now-unused AWS_PAYMENT_OPTIONS constant (superseded by getCommitmentConfig)

Test plan

  • npx tsc --noEmit passes
  • npx jest passes (1897/1897)
  • Three tests updated that previously asserted the read-only Azure/GCP behavior; new assertions verify Azure payment options, inline editing, and empty-state modal auto-open with correct service list
  • Manual: open Settings, add Azure account, open its overrides, verify "Add override" button appears, service dropdown shows Azure services (VM, SQL, Cosmos DB, Redis, Search), payment shows Upfront/Monthly
  • Manual: open GCP account overrides, verify service dropdown shows GCP services, payment shows Monthly only

Summary by CodeRabbit

  • New Features

    • Extended per-account service overrides to support Azure and GCP (previously AWS-only).
    • Inline editing enabled for Term, Payment, Coverage, and Enabled for all providers.
    • Override creation modal now lists provider-appropriate services and payment fallbacks so Azure/GCP accounts can add overrides immediately.
  • Tests

    • Updated tests to cover Azure account override behaviors, editable controls, and empty-state/create-flow.

Review Change Stack

Extend the per-account override create/edit flow to Azure and GCP accounts
(previously AWS-only, tracked as follow-up to issue #104).

- Drop `canCreate = provider === 'aws'` gate: all providers now render the
  "Add override" button and auto-open the create modal on empty state
- Add AZURE_OVERRIDE_SERVICES and GCP_OVERRIDE_SERVICES lists; dispatch via
  getOverrideServicesForProvider so the service dropdown is provider-aware
- Remove `o.provider === 'aws'` guards on term/payment/coverage table cells:
  all three get inline editing selects/inputs for every provider
- Remove the disabled+tooltip guard on the enabled checkbox for non-AWS rows
- buildPaymentOverrideSelect and syncOverridePaymentOptions now derive the
  fallback payment list from getCommitmentConfig(provider) instead of a
  hardcoded AWS-only constant, so Azure shows upfront/monthly and GCP shows
  monthly-only
- Remove now-unused AWS_PAYMENT_OPTIONS constant (superseded by
  getCommitmentConfig which already owns the same data)
- Tests: update three tests that asserted the old read-only behavior; add
  coverage for Azure payment options, Azure inline editing, and Azure
  empty-state modal auto-open with provider-correct service list
@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0ff4d313-014e-4655-b2ab-3944587b13df

📥 Commits

Reviewing files that changed from the base of the PR and between eb5641b and 95d1384.

📒 Files selected for processing (1)
  • frontend/src/settings.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/settings.ts

📝 Walkthrough

Walkthrough

This PR extends per-account service overrides from AWS-only to be provider-aware: adds Azure/GCP service lists and commitment-config payment fallbacks, enables inline editing and Enabled toggles for all providers, updates the override creation modal and empty-state behavior, and updates tests for Azure scenarios.

Changes

Provider-aware service overrides for Azure and GCP

Layer / File(s) Summary
Provider-aware service selection infrastructure
frontend/src/settings.ts
Consolidates imports to include getCommitmentConfig, adds AZURE_OVERRIDE_SERVICES and GCP_OVERRIDE_SERVICES, and adds getOverrideServicesForProvider(provider) dispatcher.
Provider-aware payment filtering and syncing
frontend/src/settings.ts
buildPaymentOverrideSelect and syncOverridePaymentOptions now use getCommitmentConfig(provider).payments as a fallback when term is unset while preserving getValidPaymentOptions when term is present.
Inline editing, Enabled toggle, and empty-state UX
frontend/src/settings.ts
Term/Payment/Coverage cells render as editable controls for all providers; the Enabled checkbox is no longer disabled for non-AWS rows; empty-state logic and header copy now allow Add override for Azure/GCP.
Override creation modal population
frontend/src/settings.ts
The create-override modal service dropdown is populated via getOverrideServicesForProvider(provider) (excluding already-overridden services) and related comments updated.
Test coverage for Azure override behavior
frontend/src/__tests__/settings-accounts.test.ts
Replaces prior non-AWS tests with Azure-specific tests asserting editable payment <select> with Azure options, editable Term/Coverage/Enabled controls, and Azure-only service dropdown in the empty-state create modal.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Possibly related issues

Possibly related PRs

  • LeanerCloud/CUDly#176: Modifies override UI payment <select> logic and tests; this PR extends payment-option handling and inline selectors from AWS to Azure/GCP.

Poem

🐰 I hopped through settings, bright and spry,
Found Azure clouds now sharing the sky,
Dropdowns bloom with provider cheer,
Edits enabled, no one left out here,
Tests applaud — three clouds ally! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 62.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main feature change: adding Azure and GCP support to the create-override modal, which is the primary objective across both modified files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/issue-109-azure-gcp-override-modal

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

@cristim cristim added priority/p2 Backlog-worthy severity/medium Moderate harm urgency/this-sprint Within the current sprint impact/many Affects most users effort/m Days type/feat New capability triaged Item has been triaged labels May 20, 2026
@cristim

cristim commented May 20, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented May 22, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented May 22, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim

cristim commented May 25, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
frontend/src/settings.ts (1)

1170-1172: ⚡ Quick win

Stale comment no longer reflects the implementation.

The comment states "AWS-editable, disabled (with tooltip) for non-AWS" but the code now renders an editable checkbox for all providers per issue #109. Update or remove this comment to avoid confusion.

📝 Suggested fix
-      // Enabled cell: per-row checkbox toggling account_service_overrides.enabled.
-      // AWS-editable, disabled (with tooltip) for non-AWS to keep the column
-      // alignment consistent across provider types. Issue `#110`.
+      // Enabled cell: per-row checkbox toggling account_service_overrides.enabled.
+      // Editable for all providers. Issue `#110`, extended to Azure/GCP in `#109`.
       const enabledTd = tr.insertCell();
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/src/settings.ts` around lines 1170 - 1172, The inline comment
describing the "Enabled cell: per-row checkbox toggling
account_service_overrides.enabled" is stale (says "AWS-editable, disabled (with
tooltip) for non-AWS") and should be updated or removed to match the current
behavior where the checkbox is editable for all providers per issue `#109`; edit
the comment in frontend/src/settings.ts near the enabled-cell logic that
mentions account_service_overrides.enabled (or remove it entirely) so it no
longer refers to AWS-only behavior or tooltips and instead accurately reflects
that the checkbox is editable for all providers.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@frontend/src/settings.ts`:
- Around line 1170-1172: The inline comment describing the "Enabled cell:
per-row checkbox toggling account_service_overrides.enabled" is stale (says
"AWS-editable, disabled (with tooltip) for non-AWS") and should be updated or
removed to match the current behavior where the checkbox is editable for all
providers per issue `#109`; edit the comment in frontend/src/settings.ts near the
enabled-cell logic that mentions account_service_overrides.enabled (or remove it
entirely) so it no longer refers to AWS-only behavior or tooltips and instead
accurately reflects that the checkbox is editable for all providers.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 53f7cb3e-742a-4190-ab5f-e71bcedc77cd

📥 Commits

Reviewing files that changed from the base of the PR and between bc8831b and eb5641b.

📒 Files selected for processing (2)
  • frontend/src/__tests__/settings-accounts.test.ts
  • frontend/src/settings.ts

… all-providers editability

The Enabled-cell comment described the pre-#109 behaviour (AWS-only
editable, disabled-with-tooltip for non-AWS). Since #109 made the
checkbox editable for Azure and GCP as well, the comment was stale.

Updated to CR's suggested wording per PR #588 review.
@cristim

cristim commented May 27, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim
cristim merged commit 6591bd9 into feat/multicloud-web-frontend May 27, 2026
6 checks passed
@cristim
cristim deleted the feat/issue-109-azure-gcp-override-modal branch May 27, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/m Days impact/many Affects most users priority/p2 Backlog-worthy severity/medium Moderate harm triaged Item has been triaged type/feat New capability urgency/this-sprint Within the current sprint

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant