-
-
Notifications
You must be signed in to change notification settings - Fork 62
feat: SDK size impact as part of Summary #2409
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
base: main
Are you sure you want to change the base?
Conversation
|
| $item = Get-Item $Path | ||
| if ($item.PSIsContainer) { | ||
| # Directory - sum all files | ||
| $size = (Get-ChildItem -Path $Path -Recurse -File | Measure-Object -Property Length -Sum).Sum |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Empty Data Yields Null Sums
When a directory contains no files, Measure-Object -Property Length -Sum returns an object where .Sum is $null rather than 0. This $null value propagates through arithmetic operations and formatting functions, potentially causing incorrect calculations or type errors in the build size comparison and summary generation.
| $percentChange = if ($size1 -gt 0) { ($diff / $size1) * 100 } else { 0 } | ||
|
|
||
| $diffFormatted = "$(if ($diff -gt 0) { '+' })$(Format-Size ([Math]::Abs($diff)))" | ||
| $percentFormatted = "$(if ($diff -gt 0) { '+' })$([Math]::Round($percentChange, 2))%" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Negative Values: Sign Missing, Clarity Lost
The formatted difference and percentage strings only add a + sign for positive values but omit the - sign for negative values. When the build with Sentry is smaller than without Sentry (negative difference), the console output shows the size/percentage without any sign, making it unclear whether the size increased or decreased.
| uses: actions/cache@v4 | ||
| with: | ||
| path: samples/IntegrationTest/Build-NoSentry | ||
| key: build-nosentry-${{ matrix.build_platform }}-${{ matrix.unity-version }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Stale Cache Distorts Build Size Metrics
The cache key for Build-NoSentry only includes platform and Unity version, not the source code state. When code changes between workflow runs on the same branch, the cache returns a stale build from old code, while Build is freshly built from new code. This causes size comparisons to measure both Sentry's impact and unrelated code changes, producing incorrect metrics. The same issue exists in the Android (line 52-57), iOS (line 58-63), and Windows (line 412-417) workflows.
Resolves #65
Relates to #2408
#skip-changelog