Repository navigation
Conversation
Automated Reviewer SuggestionsBased on the
|
|
/request-review @Yicong-Huang |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8629 +/- ##
============================================
+ Coverage 92.05% 92.10% +0.05%
- Complexity 5039 5040 +1
============================================
Files 1286 1286
Lines 55928 55928
Branches 7138 7138
============================================
+ Hits 51483 51515 +32
+ Misses 2693 2663 -30
+ Partials 1752 1750 -2
*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:
|
|
/request-review @Ma77Ball |
Ma77Ball
left a comment
There was a problem hiding this comment.
Review summary
Test-only PR: it adds 22 specs for the heat-map overlay wiring in workflow-editor.component.ts (view painting, overlay-off restore, the #6213 disable/enable repaint, and the hover tooltip), with no production change. I traced every assertion back to the production code it exercises and they line up. The approach of driving the real WorkflowStatusService and real JointUIService and asserting concrete rect.body/fill values, rather than spying on applyHeatmapColor, is the right call: it is what actually catches the disable/enable regression that a spy would miss. No blocking issues, and nothing I would hold merge on.
Action items: Nothing blocking; no changes requested. The notes below are verification only.
Findings
0 total: 0 P0, 0 P1, 0 P2, 0 P3.
No correctness, contract, or coverage problems found. No inline comments.
Verification
Checked statically against the fork head (4327053); I did not run the suite locally, so the pass counts and the delete-to-fail checks in the description are the author's. What I confirmed by reading the sources the specs touch:
- Hard-coded fills match production exactly.
ENABLED_FILL/DISABLED_FILL("#FFFFFF"/"#E0E0E0") are the two valuesJointUIService.getOperatorFillColorreturns (joint-ui.service.ts:982), set onrect.body/fillby bothrestoreOperatorFill(:551) andchangeOperatorDisableStatus(:531). So the restore-respecting-disabled-state and disable/enable specs assert the real values, not guesses. - Heat and no-data colors cannot drift from production casing.
HOT/COLD/HEATMAP_NO_DATA_COLORin the specs come from the samescoreToColor/HEATMAP_NO_DATA_COLORthatapplyHeatmapColoruses (joint-ui.service.ts:542), so a lowercase-hex vs uppercase mismatch is impossible. publishStatisticsdrives the real derivation.statisticsSubject.next(...)flows throughbuildPerformanceMetricsinto theperformanceMetricsSubjectBehaviorSubject (workflow-status.service.ts:52,:120), which is exactly what the overlay'scombineLatestrepaint andgetCurrentPerformanceMetrics()read. The "repaint on new metrics" and "no view leaves fills untouched" specs therefore exercise the real stream, not a shortcut.- The Runtime numbers check out. Control time defaults to 0 (
performance-metrics.ts), so Runtime raw =dataNs= 1e9, giving the"1.00 s"metric and a100%heat label for the hottest operator. - The no-data and em-dash paths are genuine.
rawMetricForViewreturns undefined for I/O imbalance wheninputRows === 0(heatmap-scoring.ts:66), which is what makes both the "painted as no-data" and the "em-dash metric" specs assert the not-measurable branch rather than a measured zero. An operator absent from the metrics map is likewise scored undefined, so it does not anchor the scale minimum (the point the "no metrics as no-data rather than coldest" spec pins). - The tooltip-position spec is not brittle under jsdom. It reads the same
editor.getBoundingClientRect()the handler reads (workflow-editor.component.ts:563), so a zero rect in jsdom cancels on both sides.
One observation, not a request: this describe block has no afterEach destroying the fixture, but that is the block's existing pattern (resetTestingModule() in beforeEach with a fresh paper per test), not something this PR introduces, so the hover-event listeners added here do not leak across tests.
Yicong-Huang
left a comment
There was a problem hiding this comment.
🟡 0 must-fix · 1 advisory · 0 polish: solid test-only PR with real-collaborator specs; one optional assertion tightening.
Simplifications (1)
workflow-editor.component.spec.ts:2517: negated check would also pass on an unpainted operator (advisory, see inline)
Yicong-Huang
left a comment
There was a problem hiding this comment.
🟢 1 resolved · 0 open · 0 new (0 new = 0 newly introduced · 0 late catches)
Verification trace
The prior advisory is addressed in the tree: the measurable operator's fill in the unmeasurable-view spec is now pinned exactly with toEqual(HOT). In that spec the scan operator is unmeasurable for I/O imbalance (zero input rows), so it drops out of normalization, and the result operator is the sole measurable one with a positive raw metric, so it scores 1 and paints scoreToColor(1). The new assertion fails if the operator goes unpainted or no-data, which the old negated check could not catch. The two removed negated checks were implied by their adjacent toEqual(HOT) assertions.
What changes were proposed in this PR?
The heat-map overlay's pure logic is well covered, but the editor-side wiring shipped without specs in #6213. This adds them. Test-only: no production code changes, so no behaviour change and nothing to screenshot.
22 tests covering
handleHeatmapOverlay,repaintHeatmapColors,restoreAllOperatorFillsandhandleHeatmapHover, in four groups:.heatmap-activetoggled, an open tooltip clearedThe tests drive the real paper and the real
JointUIServiceand assert actualrect.body/fillvalues againstscoreToColorandHEATMAP_NO_DATA_COLOR. A spy onapplyHeatmapColorwould pass even whenchangeOperatorDisableStatusoverwrites the fill afterwards, which is the exact failure the disable/enable regression exists to catch. Metrics are published throughstatisticsSubjectrather than pushed onto the derived stream, so the scoring under test is the one the service actually derives.The
ngOnDestroyview reset already has a spec and is not duplicated here.Any related issues, documentation, discussions?
Closes #7491. Follow-up from #6213. Part of umbrella #5772.
How was this PR tested?
The specs are the change. Each one was verified to fail for its own reason by deleting the behaviour it covers and re-running:
workflow-editor.component.tsgetDisabledOperatorsChangedStreamrepaintrestoreAllOperatorFills()on overlay off.heatmap-activeclass togglehasOperatorguard139 passing, up from 117. Statement coverage of the wiring (lines 429-564) is 46/46, and the file overall is 626/627.
Full frontend suite: 6203 passing, 1 skipped.
tsc --noEmit(strict),eslint ./srcand Prettier are clean.Was this PR authored or co-authored using generative AI tooling?
This PR was co-authored by Claude, in compliance with ASF.