feat: add resourceVersion to Freight, Stage, Warehouse list and watch endpoints#6311
Draft
jacobboykin wants to merge 8 commits into
Draft
feat: add resourceVersion to Freight, Stage, Warehouse list and watch endpoints#6311jacobboykin wants to merge 8 commits into
jacobboykin wants to merge 8 commits into
Conversation
… endpoints Signed-off-by: Jesse Suen <[email protected]> (cherry picked from commit 0a0b864)
✅ Deploy Preview for docs-kargo-io ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Signed-off-by: Jacob Boykin <[email protected]>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6311 +/- ##
==========================================
+ Coverage 58.05% 58.36% +0.30%
==========================================
Files 499 501 +2
Lines 41743 42023 +280
==========================================
+ Hits 24235 24526 +291
+ Misses 16048 16011 -37
- Partials 1460 1486 +26 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Jacob Boykin <[email protected]>
Signed-off-by: Jacob Boykin <[email protected]>
Signed-off-by: Jacob Boykin <[email protected]>
Signed-off-by: Jacob Boykin <[email protected]>
Signed-off-by: Jacob Boykin <[email protected]>
Signed-off-by: Jacob Boykin <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Supersedes #6156.
This adds resourceVersion-aware list/watch initialization for the large collection streams used by the UI: Stages, Warehouses, Promotions, and Freight via
QueryFreight.The practical effect is that after the UI performs the initial list request, the follow-up watch starts from that list's Kubernetes resourceVersion instead of replaying the same existing resources as individual watch events. This avoids a startup replay storm that can make large project pages and Promotion-heavy stage pages feel frozen.
Implementation
Why direct reads here?
The controller-runtime cached client can return list resourceVersion
0, and using the max item resourceVersion from a cached list is not reliable because it can be older than the apiserver watch window. In testing against a real akuity kargo instance, that caused expired-resourceVersion retry loops.This PR keeps direct reads scoped to the list+watch seed paths where the returned resourceVersion is immediately used to start a watch. The direct reader is constructed once at server startup, not per request.
Performance Testing
This branch removes a major source of duplicate work during UI startup for large projects. After the UI performs its initial list calls, follow-on watch streams now start from the listed resourceVersion instead of replaying every existing object as a fresh watch event. In large-project validation with roughly 1k Stages and 1.3k Freight resources, this avoided about 15.6 MB of duplicate decoded watch payload on project open and reduced graph stabilization time from about 11.6s to 3.9s, a roughly 66% improvement.
The user-facing impact is that large project pages become usable much sooner and avoid the “page is loaded but feels frozen/slow” behavior caused by processing thousands of redundant watch events. In e2e stage-level validation with 1k Promotions, the Promotions page became usable about 4.6s sooner, worst-case hover stalls dropped from nearly 10s to about 65ms, and frame cadence improved from severe frame drops to normal responsiveness. This directly addresses our reported issues where opening large Kargo views or interacting with menus could grind the browser to a halt during initial watch startup.