Remove secrets from Tracks demo#371
Conversation
The `TracksDemo` project generated `Secrets.swift` at build time by copying `Secrets.example.swift` via an "Add Sample Secrets" shell-script phase, and gitignored the result. That indirection only earns its place when it guards something sensitive, and neither field is: the Sentry DSN is safe to expose by design, and the crash-logging `TracksUser` email is a shared demo alias, not personal PII. Commit `Secrets.swift` directly with `mobile+tracks-demo@automattic.com` and a `DSN_TBD` placeholder, delete the example template, drop the copy phase from the iOS and Mac targets, and remove the gitignore entry. --- Generated with the help of Claude Code, https://claude.com/claude-code Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The DSN is public by design (Sentry docs), so committing it directly is safe. --- Generated with the help of Claude Code, https://claude.com/claude-code Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`Secrets` no longer holds anything secret; both fields configure the demo's Sentry crash logging. --- Generated with the help of Claude Code, https://claude.com/claude-code Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The gitignored-local-file pitfall no longer exists — demo config is now tracked as `SentryConfig.swift`. --- Generated with the help of Claude Code, https://claude.com/claude-code Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
||
| struct CrashLoggingDataSource: CrashLoggingDataProvider { | ||
| var sentryDSN: String = Secrets.sentryDsn | ||
| var sentryDSN: String = SentryConfig.sentryDsn |
There was a problem hiding this comment.
Renamed this to SentryConfig because the contents are no longer secret.
There was a problem hiding this comment.
Pull request overview
Removes the demo app’s previously “secret” configuration (Sentry DSN + demo email) and checks in a non-secret configuration file so the Tracks demo builds without any locally-generated secrets files or build-phase scripting.
Changes:
- Replaces
Secrets.swift/Secrets.example.swiftwith a committedSentryConfig.swift. - Removes the Xcode build phase that copied
Secrets.example.swiftintoSecrets.swift. - Updates the demo crash logging data source and housekeeping docs/ignore rules accordingly.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| TracksDemo/TracksDemo.xcodeproj/project.pbxproj | Renames the source file reference to SentryConfig.swift and removes the “Add Sample Secrets” shell script build phase. |
| TracksDemo/Shared/SentryConfig.swift | Adds committed demo configuration for Sentry DSN and demo Tracks user. |
| TracksDemo/Shared/Secrets.example.swift | Removes the example secrets template file (no longer needed). |
| TracksDemo/Shared/CrashLoggingDataSource.swift | Switches from Secrets.* to SentryConfig.* for DSN and user data. |
| AGENTS.md | Removes the note about Secrets.swift being gitignored. |
| .gitignore | Stops ignoring Secrets.swift now that it’s no longer used. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| struct SentryConfig { | ||
| static let sentryDsn = "https://f60d42c1ce6c44cca339e4572feef2ef@o248881.ingest.sentry.io/5591863" | ||
| static let tracksUser = TracksUser(email: "mobile+tracks-demo@automattic.com") |
There was a problem hiding this comment.
@copilot open a PR stacked on top of this one to tidy the variable name. I agree that sentryDSN should be the one in use, but changing it is out of scope for this particular PR.
Remove "secrets" from the demo app because they consisted only of the Sentry DSN and of an email address. The DSN is safe to keep public and we can use an already public email address.
Removing the secrets simplify the build process and the repo management. Given what was tracked wasn't really that secret-worthy and that we're talking of a demo app, I think the trade is more than favorable.