feat(preprod): Add insight comparison#103774
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #103774 +/- ##
===========================================
- Coverage 80.62% 80.52% -0.11%
===========================================
Files 9357 9353 -4
Lines 402540 400614 -1926
Branches 25700 25700
===========================================
- Hits 324549 322581 -1968
- Misses 77523 77565 +42
Partials 468 468 |
5c83064 to
75fccb0
Compare
a81a6eb to
b88ca52
Compare
| raise ValueError("Both head and base insights are None") | ||
|
|
||
| if head_insight is None: | ||
| # Should never happen, but here for mypy passing |
There was a problem hiding this comment.
Yeah very weird, was failing until I added these 🤷
| continue | ||
|
|
||
| # Determine status and create diff item | ||
| if head_insight is not None and base_insight is None: |
There was a problem hiding this comment.
Is this necessary? It seems like you could just do a single:
insight_diff_item = _diff_insight(insight_type, head_insight, base_insight)
if insight_diff_item:
insight_diff_items.append(insight_diff_item)
since _diff_insight() handles the params being None.
There was a problem hiding this comment.
Good catch, meant to do that but forgot to remove this. Done
| download_size: int | ||
| install_size: int | ||
| treemap: TreemapResults | None | ||
| insights: AndroidInsightResults | AppleInsightResults | None |
There was a problem hiding this comment.
Making a note that we might want to start a shared repo for all these models since now almost everything is ported over.
ea0a162 to
d24fb45
Compare
| continue | ||
|
|
||
| # Always add group-level diff for groups that exist in both | ||
| diff_type = DiffType.INCREASED if size_diff > 0 else DiffType.DECREASED |
There was a problem hiding this comment.
Bug: Zero size diff incorrectly labeled as DECREASED
When size_diff is exactly zero but there are file-level changes within a group (files added and removed with offsetting sizes), the diff_type is incorrectly assigned DiffType.DECREASED because 0 > 0 evaluates to False. A group with no overall size change contains changes but is misleadingly labeled as "decreased" instead of being handled as a distinct case (e.g., unchanged at the aggregate level).
Adds backend code for insight comparison. Only produces diffs of insights or content within insights (files/groups), per offline chat with Trevor we're going against the designs to show "unresolved" files/insights. --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>

Adds backend code for insight comparison. Only produces diffs of insights or content within insights (files/groups), per offline chat with Trevor we're going against the designs to show "unresolved" files/insights.