Skip to content

Create/Edit HPA - Don't fetch all workload types when SSP enabled#16400

Merged
richard-cox merged 1 commit intorancher:masterfrom
richard-cox:fix-hpa-edit-scaling
Jan 26, 2026
Merged

Create/Edit HPA - Don't fetch all workload types when SSP enabled#16400
richard-cox merged 1 commit intorancher:masterfrom
richard-cox:fix-hpa-edit-scaling

Conversation

@richard-cox
Copy link
Copy Markdown
Member

@richard-cox richard-cox commented Jan 20, 2026

Summary

Fixes #16346

Occurred changes and/or fixed issues

Remove the need to fetch all workload types to support the user just selecting one

Core Changes

  • Split selection of HPA target resource from label select with ALL workloads ---> separate per-resource label select
  • Use resource label select instead of label select
    • handles ssp case
  • Update metrics-row to fetch required resource instead of being passed in from cache
    • we no longer have the cache
  • Add transient mode to find (as per findPage)
    • Fetches resource but does not cache it, just returns it
  • This change also improves SSP disabled world, given we only fetch all of one TYPE

Improvements

  • Convert create/edit hpa component to TS
  • Much better typing and mapping between workload types and workload kinds

General Improvements

  • Pass through templates from ResourceLabeledSelect to LabeledSelect (wasn't needed in the end but should be included)
    • we don't currently use this anywhere in code

Areas or cases that should be tested

  • For both SSP Enabled and Disabled all the below tests
  • Create
    • User can select a namespace and target type and see the matching target resources
    • User can change namespace or target type, the target resource is reset and new resources are shown
  • Edit
    • Target tab Target Type and Target Reference is initially populated correctly (even if type is not deployment)
  • Create & Edit
    • Updating the target resource updates the reference found in the metrics tab
      • this should be possible to test by ensuring no warning message is shown(requires metrics server enabled)

Areas which could experience regressions

  • nothing outside of the above tests

Screenshot/Video

image

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes
  • The PR has been reviewed in terms of Accessibility
  • The PR has considered, and if applicable tested with, the three Global Roles Admin, Standard User and User Base

@richard-cox richard-cox added this to the v2.14.0 milestone Jan 20, 2026
@richard-cox richard-cox self-assigned this Jan 20, 2026
Core Changes
- Split selection of target workload from label select with ALL workloads to separate per type resource label select
- Update metrics-row to fetch required resource
- Add `transient` mode to find (as per findPage)
  - Fetches resource but does not cache it, just returns it
- This change also improves SSP disabled world, given we only fetch all of one TYPE...

Improvements
- Convert create/edit hpa component to TS
- Much better typing and mapping between workload types and workload kinds

General Improvements
- Pass through templates from ResourceLabeledSelect to LabeledSelect (wasn't needed in the end but should be included)
@richard-cox richard-cox marked this pull request as ready for review January 20, 2026 16:18
Copy link
Copy Markdown
Member

@codyrancher codyrancher left a comment

Choose a reason for hiding this comment

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

I don't know if you want to address it here or at all but even though I find this works and the code looks fine I found the UX to be annoying.

ssp.mp4

The dropdown closing, it not being in alphabetical order and we still just list all of them eventually. I'd think we'd want to keep the dropdown open and paginate. It might be worth getting UX to help.

@richard-cox
Copy link
Copy Markdown
Member Author

richard-cox commented Jan 23, 2026

The dropdown closing

This looks like a regression. The drop down used to stay open and the loading indicator shown again. Created #16451

it not being in alphabetical order

It does look like it's in alphabetical order? String sorts are 0 --> 1X --> 2 --> 2X etc

we still just list all of them eventually

i might have misunderstood, but the drop down originally had pagination controls and only showed a single page. UX decided that the load more approach was better.

Going on the pr approval, additional issue and comments above will merge. Just let me know if anything more should be done

@codyrancher
Copy link
Copy Markdown
Member

codyrancher commented Jan 23, 2026

The dropdown closing

This looks like a regression. The drop down used to stay open and the loading indicator shown again. Created #16451

it not being in alphabetical order

It does look like it's in alphabetical order? String sorts are 0 --> 1X --> 2 --> 2X etc

we still just list all of them eventually

i might have misunderstood, but the drop down originally had pagination controls and only showed a single page. UX decided that the load more approach was better.

Going on the pr approval, additional issue and comments above will merge. Just let me know if anything more should be done

No that's fine.

And you're right about the alphabetical. I just wasn't paying close enough attention to the numerical sorting.

It is still loading the entire list eventually, the first item is present after every load more invocation.

@richard-cox richard-cox merged commit f1d2ad2 into rancher:master Jan 26, 2026
68 of 70 checks passed
@richard-cox richard-cox deleted the fix-hpa-edit-scaling branch January 26, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HPA creation page loads all deployments causing significant performance degradation

2 participants