refactor(frontend): separate operator state and statistics in WorkflowStatusService - #8301
Open
PG1204 wants to merge 2 commits into
Open
refactor(frontend): separate operator state and statistics in WorkflowStatusService#8301PG1204 wants to merge 2 commits into
PG1204 wants to merge 2 commits into
Conversation
Contributor
Automated Reviewer SuggestionsBased on the
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8301 +/- ##
============================================
- Coverage 94.09% 94.09% -0.01%
Complexity 4806 4806
============================================
Files 1193 1193
Lines 48493 48512 +19
Branches 5858 5860 +2
============================================
+ Hits 45631 45646 +15
- Misses 1420 1421 +1
- Partials 1442 1445 +3
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
/request-review @Yicong-Huang |
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.
What changes were proposed in this PR?
WorkflowStatusServicecurrently bundles two different concepts in one object:OperatorStatisticscarries both the operator's execution state (Running, Completed, …) and its statistics (row counts, sizes, timing). This PR splits them into separate sub-concepts, so the service now exposes three cleanly separated things: state, statistics, and performance metrics (the third was already separate, from #5834).WorkflowStatusServicenow has a stream + snapshot pair per concept:getStateUpdateStream()/getCurrentState()for state, andgetStatisticsUpdateStream()/getCurrentStatistics()for statistics (metrics only). The performance-metrics API is unchanged.OperatorStatisticsno longer containsoperatorState. The combined shape the engine still sends over the websocket is typed asOperatorRuntimeStatus, and the service splits each update into the two maps. No backend or wire-format changes.JointUIService.changeOperatorStatisticsrenders statistics only — state rendering stays inchangeOperatorState(its two long-unusedisSource/isSinkparams are dropped along the way).WorkflowGraph.getAllOperatorIDs()accessor keeps the per-update rendering path from materializing full operator predicates when only IDs are needed.The change is behavior-preserving. One deliberate exception: the old code applied the "Recovering" display state by mutating the shared emitted map, which leaked masked states to other subscribers depending on subscription order. That accident is removed, and the override is now applied explicitly where state is rendered.
Rebased on top of the merged heat-map overlay (#6213), which consumes only the unchanged performance-metrics stream; its editor wiring is untouched by this refactor.
Any related issues, documentation, discussions?
Closes #5919. Part of umbrella #5772. Follow-up from the review discussion in #5834; follows RFC discussion #5216.
How was this PR tested?
The
WorkflowStatusServicespec now asserts state and statistics are exposed and update independently, and that statistics never leakoperatorState. Consumer specs were updated to the new API, plus new tests for the state-rendering rules in the workflow editor (Uninitialized fallback, Recovering override, state label restored after navigation).Full frontend suite passes (5,350 tests, 209 files);
tsc --noEmit,eslint ./src, and Prettier are all clean.Was this PR authored or co-authored using generative AI tooling?
This PR was co-authored using Claude in compliance with ASF.