Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(trace) split trace node class #78306

Merged
merged 18 commits into from
Oct 9, 2024
Merged

ref(trace) split trace node class #78306

merged 18 commits into from
Oct 9, 2024

Conversation

JonasBa
Copy link
Member

@JonasBa JonasBa commented Sep 28, 2024

Fall cleaning time has come. The previous trace node class contained all of the trace definitions, which at ~2k loc started to get annoying to work in. This change breaks up that class into separate files as well as does some minor renaming of type -> shape so that the naming is consistent across usage.

The PR got large as that class had grown big, however 99% of the changes are just moving code to its new location

@JonasBa JonasBa requested review from a team as code owners September 28, 2024 01:36
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Sep 28, 2024
Copy link

codecov bot commented Sep 28, 2024

Codecov Report

Attention: Patch coverage is 62.46649% with 140 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...newTraceDetails/traceModels/traceTreeTestUtils.tsx 47.82% 24 Missing ⚠️
...ils/traceDrawer/details/span/sections/ancestry.tsx 0.00% 17 Missing ⚠️
...performance/newTraceDetails/traceTreeAnalytics.tsx 30.00% 14 Missing ⚠️
.../performance/newTraceDetails/traceRow/traceBar.tsx 33.33% 12 Missing ⚠️
...ts/interfaces/spans/newTraceDetailsSpanDetails.tsx 0.00% 11 Missing ⚠️
...raceDetails/traceModels/traceTree.measurements.tsx 75.55% 11 Missing ⚠️
...ewTraceDetails/traceModels/parentAutogroupNode.tsx 80.48% 8 Missing ⚠️
...erformance/traceDetails/newTraceDetailsContent.tsx 0.00% 7 Missing ⚠️
...p/views/performance/newTraceDetails/traceIcons.tsx 14.28% 6 Missing ⚠️
...ic/app/views/performance/newTraceDetails/index.tsx 42.85% 4 Missing ⚠️
... and 17 more
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #78306       +/-   ##
===========================================
+ Coverage   51.10%   78.25%   +27.15%     
===========================================
  Files        7073     7115       +42     
  Lines      311814   313061     +1247     
  Branches    50925    51085      +160     
===========================================
+ Hits       159342   244999    +85657     
+ Misses     151494    61649    -89845     
- Partials      978     6413     +5435     

Splits helpers away from the trace tree model and move the logic so that
it is logically grouped. I've removed some helpers that didnt make sense
and I'll simplify the trace generating logic with better snapshotting as
I dont like how convoluted it's become over time
It was super annoying to have to deal with both spanChildren and
children from the pov of the tree model. This has bothered me as it made
a lot of things annoying wrt how the tree was actually constructed. The
second part was that the children getter was causing a lot of errors and
made it annoying to track what children we are actually rendering.

From the pov of testing, the new tree model is serializable, which means
we can just use snapshot testing to assert the tree is the shape that we
expect it to be. The diff is partially large as I renamed the old test
file which had 3k loc tests. I plan on porting over those tests to
simpler snapshot tests gradually in the coming weeks.
@JonasBa
Copy link
Member Author

JonasBa commented Oct 8, 2024

Stacked a few PRs into this, but the tests are now split and I managed to get rid of the technical debt around the tree representation that made this uber annoying to work with. Should have just done that from the start instead of being smart.

Going to wait for codecov report and check if there are some critical lines I should cover too, but ~70% test coverage is pretty good for now

@JonasBa JonasBa merged commit 6082b7f into master Oct 9, 2024
44 checks passed
@JonasBa JonasBa deleted the jb/ref/tracetree branch October 9, 2024 14:47
@github-actions github-actions bot locked and limited conversation to collaborators Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants