Skip to content

feat(FR-2451): implement Prometheus Query Preset list table#7084

Open
agatha197 wants to merge 1 commit into04-27-feat_fr-2451_add_auto_scaling_rule_tab_scaffolding_to_adminservingpagefrom
04-27-feat_fr-2451_implement_prometheus_query_preset_list_table
Open

feat(FR-2451): implement Prometheus Query Preset list table#7084
agatha197 wants to merge 1 commit into04-27-feat_fr-2451_add_auto_scaling_rule_tab_scaffolding_to_adminservingpagefrom
04-27-feat_fr-2451_implement_prometheus_query_preset_list_table

Conversation

@agatha197
Copy link
Copy Markdown
Contributor

@agatha197 agatha197 commented Apr 27, 2026

Resolves #6357 (FR-2451)

Stacked on top of #7082.

Summary

Sub-task 2 of FR-2451. Replaces the placeholder body in the new "Auto Scaling Rule" admin tab with a real, paginated, filterable Prometheus Query Preset list (read-only). This is the second PR in a 5-PR stack delivering Prometheus Query Preset admin CRUD.

What ships now

  • AutoScalingRulePresetTab is now a query orchestrator that runs prometheusQueryPresets(filter, limit, offset) via useLazyLoadQuery, with parseAsJson URL state for filter and useBAIPaginationOptionStateOnSearchParamLegacy for offset/limit.
  • New PrometheusQueryPresetList component renders the BAITable and consumes a per-row PrometheusQueryPresetListFragment (@relay(plural: true) on QueryDefinition). Columns: Name, Metric Name, Query Template (truncated with tooltip), Time Window, Created At, Updated At.
  • Filter toolbar: BAIGraphQLPropertyFilter for the name field — the only filter QueryDefinitionFilter exposes today (verified against data/schema.graphql). Filter is flattened back to a flat object before sending so it matches the schema's flat QueryDefinitionFilter shape (mirrors AdminModelCardListPage's flattenGraphQLFilter pattern).
  • Reload via BAIFetchKeyButton, transition-driven loading via useDeferredValue.
  • Toolbar layout finalized: a disabled "Add Preset" primary button is in place — the create handler ships in Sub-task 3, so subsequent PRs avoid toolbar churn.
  • Fragment fields are over-included on purpose: description, rank, categoryId, options.{filterLabels,groupLabels}, and category are spread now even though the table doesn't render all of them yet, so Sub-tasks 3/4 (Create / Edit modal) can reuse the same fragment without refactoring this component.

i18n

Added prometheusQueryPreset.* namespace in resources/i18n/en.json with only the keys this PR actually uses: Name, MetricName, QueryTemplate, TimeWindow, CreatedAt, UpdatedAt, AddPreset. Subsequent sub-tasks will add the rest (Description, Category, Rank, FilterLabels, GroupLabels, modal copy, delete copy).

Out of scope (future PRs in the stack)

  • Sub-task 3: Create modal + adminCreatePrometheusQueryPreset mutation
  • Sub-task 4: Edit modal with live "Current value" preview + diff-based modify mutation
  • Sub-task 5: Delete flow (BAIConfirmModalWithInput + adminDeletePrometheusQueryPreset)
  • Sub-task 6 (optional): sorting, query template placeholder hint, copy polish

Verification

=== Relay ===
--- Relay: PASS ---
=== Lint ===
--- Lint: PASS ---
=== Format ===
--- Format: PASS ---
=== TypeScript ===
--- TypeScript: PASS ---
=== ALL PASS ===

@github-actions github-actions Bot added area:ux UI / UX issue. area:i18n Localization size:L 100~500 LoC labels Apr 27, 2026
Copy link
Copy Markdown
Contributor Author

agatha197 commented Apr 27, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
9.02% (-0.01% 🔻)
1859/20621
🔴 Branches
8.17% (-0.02% 🔻)
1187/14523
🔴 Functions
5.31% (+0.01% 🔼)
297/5592
🔴 Lines
8.75% (-0.01% 🔻)
1750/20005
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🔴
... / PrometheusQueryPresetList.tsx
0% 0% 0% 0%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🔴
... / AutoScalingRulePresetTab.tsx
0%
0% (-100% 🔻)
0% 0%

Test suite run success

865 tests passing in 40 suites.

Report generated by 🧪jest coverage report action from 0eebe06

Comment thread react/src/components/AutoScalingRulePresetTab.tsx
Comment thread react/src/components/AutoScalingRulePresetTab.tsx Outdated
Comment thread react/src/components/AutoScalingRulePresetTab.tsx Outdated
Comment thread react/src/components/AutoScalingRulePresetTab.tsx Outdated
Comment thread react/src/components/PrometheusQueryPresetList.tsx Outdated
Comment thread react/src/components/PrometheusQueryPresetList.tsx Outdated
@agatha197 agatha197 force-pushed the 04-27-feat_fr-2451_implement_prometheus_query_preset_list_table branch from ebd1d50 to 31cd4e2 Compare April 28, 2026 06:06
@agatha197 agatha197 requested a review from nowgnuesLee April 28, 2026 06:11
Copy link
Copy Markdown
Contributor

@nowgnuesLee nowgnuesLee left a comment

Choose a reason for hiding this comment

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

LGTM

@agatha197 agatha197 force-pushed the 04-27-feat_fr-2451_add_auto_scaling_rule_tab_scaffolding_to_adminservingpage branch from 6d0065a to e92805e Compare April 28, 2026 07:14
@agatha197 agatha197 force-pushed the 04-27-feat_fr-2451_implement_prometheus_query_preset_list_table branch from 31cd4e2 to c074b00 Compare April 28, 2026 07:14
@agatha197 agatha197 requested a review from nowgnuesLee April 28, 2026 07:38
@agatha197 agatha197 force-pushed the 04-27-feat_fr-2451_add_auto_scaling_rule_tab_scaffolding_to_adminservingpage branch from e92805e to e0a386e Compare April 28, 2026 11:38
@agatha197 agatha197 force-pushed the 04-27-feat_fr-2451_implement_prometheus_query_preset_list_table branch from c074b00 to 0eebe06 Compare April 28, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:i18n Localization area:ux UI / UX issue. size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants