Skip to content

DNM: testing CI#829

Open
jamieQ wants to merge 3 commits into
mainfrom
test/snapshot-ci-timing
Open

DNM: testing CI#829
jamieQ wants to merge 3 commits into
mainfrom
test/snapshot-ci-timing

Conversation

@jamieQ

@jamieQ jamieQ commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

jamieQ added 3 commits July 13, 2026 15:19
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 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

sentry Bot commented Jul 14, 2026

Copy link
Copy Markdown

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
com.emergetools.hackernews
com.emergetools.hackernews
1368 0 20 0 112 0 ⏳ Needs approval

⚙️ hackernews-ios Snapshot Settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant