DNM: testing CI#829
Open
jamieQ wants to merge 3 commits into
Open
Conversation
Points SnapshotPreviews at getsentry/SnapshotPreviews@perf/snapshot-timing (which carries opt-in SNAPSHOT_TIMING diagnostics) and enables the flag in the iOS snapshot workflow, writing a per-preview timing CSV + phase-breakdown summary to a dedicated dir uploaded as the `snapshot-timings-<slug>` artifact. Diagnostic branch only — not for merge. Lets us see, from real CI, how much of the snapshot job is render vs. discovery/launch/drain overhead per device.
Comment on lines
+2
to
+12
| // GeneratedSyntheticPreviews.swift | ||
| // HackerNews | ||
| // | ||
| // DNM diagnostic ONLY — synthetic previews to measure how CI snapshot cost | ||
| // scales with preview count. Auto-included via the synchronized file group. | ||
| // Not for merge. | ||
| // | ||
|
|
||
| import SwiftUI | ||
|
|
||
| struct SyntheticPreviewCard: View { |
There was a problem hiding this comment.
Bug: The SyntheticPreviewCard struct is not wrapped in #if DEBUG, causing it to be included in release builds and increasing binary size.
Severity: LOW
Suggested Fix
Wrap the contents of GeneratedSyntheticPreviews.swift in a conditional compilation block, such as #if DEBUG ... #endif, to ensure the diagnostic code is excluded from production builds. Alternatively, explicitly exclude the file from the app target's "Compile Sources" build phase for release configurations in the Xcode project settings.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: ios/HackerNews/GeneratedSyntheticPreviews.swift#L1-L12
Potential issue: The file `GeneratedSyntheticPreviews.swift` defines a
`SyntheticPreviewCard` view struct for diagnostic purposes. This file is included in the
main application target without any conditional compilation guards like `#if DEBUG`.
While the Swift optimizer may strip the `#Preview` macro calls in release builds, the
`SyntheticPreviewCard` struct definition itself is not guaranteed to be removed through
dead-code elimination. This results in unused diagnostic code being compiled into the
production binary, unnecessarily increasing its size.
Did we get this right? 👍 / 👎 to inform future reviews.
Sentry Snapshot Testing
|
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.
No description provided.