ux(recommendations): add SageMaker to Service filter dropdown#92
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
Merge conflict detected ( |
|
Heads-up: this PR may be obsolete. Attempted a rebase onto current Root cause: base commit Re-applying this PR (which re-adds the deleted If SageMaker is missing from the new column-header Service popover, that's a separate, smaller fix in |
The AWS recommendations parser emits `sagemaker` as a distinct service (see providers/aws/recommendations/parser_sp.go:153, mapping to SagemakerSp), but the Recommendations page Service filter dropdown omitted it — users could see SageMaker recommendations in the unfiltered list but could not narrow to them. Adds `<option value="sagemaker">SageMaker</option>` under the AWS optgroup in the static `<select id="service-filter">`, alphabetically positioned between `redshift` and `savingsplans`. The option participates automatically in provider-based show/hide via the existing `updateServiceFilterVisibility` (it iterates optgroups, no per-option wiring needed). Lambda is intentionally NOT added in this PR: - The AWS recommendations parser does not emit `service=lambda`. Lambda commitments are surfaced under the existing `savingsplans` (Compute Savings Plans) umbrella, which the dropdown already exposes. - SageMaker Savings Plans is a distinct AWS product from Compute Savings Plans (different commitment scope + pricing), which is why SageMaker warrants its own filter value while Lambda does not. - This decision is correct under both possible resolutions of the still-open PR #71 (separate purchasing-defaults cards) and the already-merged PR #53 (Savings Plans is the umbrella for SM/Lambda). Adds a regression test in `frontend/src/__tests__/html.test.ts` that parses the real index.html and asserts SageMaker is present under the AWS optgroup, alongside the existing optgroup-presence test. Verification: - `npx jest` — 1252/1252 pass across 35 suites - `npx tsc --noEmit` — clean - `npm run build` — webpack production build succeeds Closes #77
9b30879 to
f439463
Compare
|
Repurposed this PR from the old top-bar Service dropdown change into a regression test for the current recommendations UI. The old dropdown was removed upstream; the current implementation builds service filters from the column-header popover, so I added a test that seeds a SageMaker recommendation and asserts the Service popover includes it. Branch has been force-updated to the new single-commit diff. |
Summary
Closes #77.
The Recommendations page Service filter dropdown is missing SageMaker, even though the AWS recommendations parser emits
service=sagemaker(seeproviders/aws/recommendations/parser_sp.go:153, mapping toSagemakerSp). Users could see SageMaker recommendations in the unfiltered list but could not narrow to them.Changes
frontend/src/index.html: Adds<option value="sagemaker">SageMaker</option>under the existing<select id="service-filter">AWS optgroup, alphabetically positioned betweenredshiftandsavingsplans.frontend/src/__tests__/html.test.ts: Regression test that parses the realindex.htmland asserts SageMaker is present under the AWS optgroup. Sits alongside the existing optgroup-presence test for the same dropdown.The new option participates automatically in provider-based show/hide via the existing
updateServiceFilterVisibility(recommendations.ts:87) — it iterates optgroups, no per-option wiring needed.Why SageMaker only (not Lambda)
service=lambda. Lambda commitments are surfaced under the existingsavingsplans(Compute Savings Plans) umbrella, which the dropdown already exposes.service=lambda, adding the option is a one-line follow-up.Test plan
npx jest— 1252/1252 pass across 35 suitesnpx jest src/__tests__/html.test.ts— 95/95 pass (including the new sagemaker test)npx tsc --noEmit— cleannpm run build— webpack production build succeedsmerge-watchafter CI deploy.)Out of scope