From e0260d2ed8c46a62c33f06a26e1a5e7c8066bd8e Mon Sep 17 00:00:00 2001 From: Cristian Magherusan-Stanciu Date: Sat, 25 Apr 2026 00:06:50 +0200 Subject: [PATCH] fix(commitmentOptions): align savingsplans key with SERVICE_FIELDS/dropdown/DB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CodeRabbit flagged a key mismatch on PR #30: `SERVICE_FIELDS` in `settings.ts` uses `service: 'savingsplans'`, while `commitmentConfigs` in `commitmentOptions.ts` registered the AWS entry under `'savings-plans'` (hyphenated). Any lookup via `isValidCombination`/`getCommitmentConfig` with the non-hyphenated identifier silently fell through to `_default` instead of hitting the Savings-Plans-specific config. Today both configs are identical so behaviour is unchanged, but any future restriction added to `'savings-plans'` would have been silently skipped. CodeRabbit's suggestion was to rewrite `SERVICE_FIELDS` to the hyphenated form, but `field.service` in `SERVICE_FIELDS` flows directly to `api.updateServiceConfig(provider, service, cfg)` (settings.ts:1443) which persists `service` as the primary key in the `service_configs` table — existing production rows are `('aws', 'savingsplans')`, and renaming SERVICE_FIELDS without a DB migration would have created duplicate rows and orphaned the old config. The dropdown at `index.html:112,703` (`