Skip to content

fix: load balancer page review followups - #723

Merged
thegdsks merged 1 commit into
mainfrom
fix/lb-page-review-followups
Sep 26, 2026
Merged

thegdsks merged 1 commit into
mainfrom
fix/lb-page-review-followups

Conversation

@thegdsks

Copy link
Copy Markdown
Member

What this does

Fixes the open review findings from the load balancer page redesign (#721):

  • Export commands shell-quote the app name and filename; the CDK tab now says the file is a stack class to add to a CDK app.
  • "Create recommended setup" no longer enables a /healthz probe the app may not serve; the existing "No health check" suggestion offers it afterwards.
  • An explicit retry count of 0 is preserved (form load and save both dropped it).
  • Suggestion applies and form saves build from the latest cached config and are serialized, so quick successive applies cannot overwrite each other.
  • "Require 3 failures" is only suggested while the threshold is below 3, so it is idempotent.
  • Traffic shares for least-connections, hash and cookie policies are shown with a "~" and an "Estimated share" tooltip.
  • Configure section can be collapsed while a draft exists.
  • Latency tile trend averages across upstreams instead of using one.

What this does not do

No backend or API changes. No change to the export generator output itself.

Verification

tsc -b, eslint and prettier on the touched files, vitest for components/loadbalancer and lib/loadBalancer (66 pass), new tests for retries 0, flap idempotence, shell quoting and share labels. Not verified: a live browser run, the full web test suite, or concurrent saves against a real server.

…fault probe, retry 0, serialized saves, estimated shares)
@thegdsks
thegdsks enabled auto-merge (squash) September 26, 2026 06:42
@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 32 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: f204b78d-1677-442c-be66-3b9d73c929ff

📥 Commits

Reviewing files that changed from the base of the PR and between 62f8772 and b9649d9.

📒 Files selected for processing (13)
  • web/src/components/loadbalancer/ExportTabs.tsx
  • web/src/components/loadbalancer/LbEmptyState.tsx
  • web/src/components/loadbalancer/LbMetrics.tsx
  • web/src/components/loadbalancer/LbNodeDrawer.tsx
  • web/src/components/loadbalancer/LbTopology.tsx
  • web/src/components/loadbalancer/LbUpstreamTable.tsx
  • web/src/components/loadbalancer/LoadBalancerPage.test.tsx
  • web/src/components/loadbalancer/LoadBalancerPage.tsx
  • web/src/components/loadbalancer/logic.test.ts
  • web/src/components/loadbalancer/rollup.ts
  • web/src/components/loadbalancer/shellQuote.ts
  • web/src/components/loadbalancer/suggestions.ts
  • web/src/lib/loadBalancer.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions Bot added area/frontend web/ type/fix Bug fix size/l 200-499 lines changed labels Sep 26, 2026
@sonarqubecloud

Copy link
Copy Markdown

@greptile-apps

greptile-apps Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Load balancer UI and export formatting updates.

The PR should not merge until form saves and Undo are ordered with suggestion applies to prevent lost configuration changes.

Findings

  1. P1 Config writes can overwrite changes ▶
  2. P2 Short history hides latency trend ▶
  3. P2 Latency samples mix different times ▶

Summary

The PR updates load-balancer setup guidance, export commands, retry handling, suggestion applies, share labels, and latency presentation.

  • The suggestion queue does not yet cover form saves or Undo.
  • Latency aggregation can hide or misalign the trend when upstream histories differ.

Diagram

sequenceDiagram
  participant Operator
  participant Queue as Suggestion queue
  participant Form as Form save or Undo
  participant API as Full-config PUT
  Operator->>Queue: Apply suggestion
  Queue->>API: PUT config based on cached state
  Operator->>Form: Save form or Undo
  Form->>API: PUT another complete config
  Note over API: Writes are not ordered by the suggestion queue
Loading

Reviews (1) · Last reviewed commit: "fix: load balancer page review followups..."

Comment on lines +191 to +199
queue.current = queue.current
.catch(() => undefined)
.then(async () => {
const before =
queryClient.getQueryData<LoadBalancerResource>(
appLoadBalancerKeys.detail(appName),
)?.config ?? {}
try {
await save.mutateAsync(apply(before))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Config writes can overwrite changes

The queue orders suggestion applies, but form saves and Undo still send full-config PUTs outside it. If an operator saves the form while a suggestion is applying, whichever request finishes last can replace the other's settings. Clicking an earlier suggestion's Undo can also restore its old snapshot and discard later changes. These writes need the same ordering as suggestion applies.

Knowledge Base Used: Web console

Comment on lines +11 to +13
const all = [...history.values()].map((h) => h.series.latency_ms)
const len = Math.min(...all.map((s) => s.length))
if (all.length === 0 || len < 2) return undefined

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Short history hides latency trend

This takes the shortest latency series across every upstream. A new upstream, or one without active probe samples, can have fewer than two points, making the entire trend disappear even when other upstreams have enough history to show it.

Comment on lines +14 to +16
return Array.from({ length: len }, (_, i) => {
const vals = all.map((s) => s[s.length - len + i]?.value ?? 0)
return Math.round(vals.reduce((a, b) => a + b, 0) / vals.length)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Latency samples mix different times

The aggregate pairs samples by their position in each series, not by their available timestamps. When an upstream misses a probe, its remaining values can be averaged with values recorded at different times on other upstreams. The resulting trend can mislead operators about when latency changed.

@thegdsks
thegdsks merged commit 8221d18 into main Sep 26, 2026
21 checks passed
@github-actions
github-actions Bot deleted the fix/lb-page-review-followups branch September 26, 2026 06:48
thegdsks added a commit that referenced this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/frontend web/ size/l 200-499 lines changed type/fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant