Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .claude/knowledge/gotchas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
why: The Xcode UI test template ships SavelyUITestsLaunchTests with XCTApplicationLaunchMetric which runs the app launch ~8 times measuring performance, taking ~5–10 min and flaking when one iteration exceeds the std-dev threshold. The template tests assert nothing meaningful — they only measure launch time, which is noisy on shared runners. Burning that many minutes for no signal is wasteful.
how-to-apply: Leave -skip-testing:SavelyUITests in .github/workflows/ci.yml's Test step until qa-tester writes real UI tests that exercise actual user paths. When real UI tests exist, drop the flag (or narrow it to skip only the template's launch-perf tests). Build step still compiles the bundle, so breaking changes to UI test code are still caught.

- id: ci-needs-placeholder-config-plist
summary: CI must generate a placeholder Config.plist before xcodebuild because the Xcode project lists it as a required build input.
why: Config.plist is gitignored, so a fresh checkout (incl. CI runners) does not have it. xcodebuild fails with "Build input file cannot be found" before compilation even starts. The OpenAI key itself is not needed — CI never makes the network call — only the file with the right shape.
how-to-apply: In .github/workflows/ci.yml, write a minimal plist with the OPENAI_API_KEY field before the Resolve SPM / Build steps. If GoogleService-Info.plist later stops being tracked, apply the same pattern (and use a real Firebase config from a GitHub secret if you ever need a working Firebase build on CI).
- id: ci-needs-placeholder-secrets
summary: CI generates placeholder Config.plist and GoogleService-Info.plist before xcodebuild because both are gitignored required build inputs.
why: Both plists are listed as required build inputs in project.pbxproj (Resources phase). On a fresh checkout (CI runners) they are absent and xcodebuild fails with "Build input file cannot be found" before compilation. Neither real key is needed — CI never calls OpenAI and FirebaseApp.configure() only runs from AppDelegate at app launch (we skip the UI test bundle, so the app is never launched in CI). Placeholders with the right plist shape are sufficient.
how-to-apply: The "Generate placeholder secrets" step in .github/workflows/ci.yml writes both files. If you ever need Firebase to actually initialize during CI (e.g. integration tests against the Firestore emulator), replace the GoogleService-Info.plist placeholder content with a base64-decoded GitHub secret. The BUNDLE_ID inside the placeholder must equal the app's PRODUCT_BUNDLE_IDENTIFIER (IvanLB.Savely) — Firebase's parser cross-checks against Info.plist.
47 changes: 41 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@ jobs:
# how to tighten this over time.
run: swiftlint lint --reporter github-actions-logging

- name: Generate placeholder Config.plist
# Config.plist holds the OpenAI API key locally and is gitignored.
# The Xcode project lists it as a required build input, so xcodebuild
# fails on a fresh checkout if the file is absent — even though CI
# never actually calls the OpenAI API. Write a placeholder with the
# right shape so the Resources copy phase succeeds.
- name: Generate placeholder secrets
# Both Config.plist (OpenAI) and GoogleService-Info.plist (Firebase)
# are gitignored locally, but the Xcode project lists them as
# required build inputs. xcodebuild fails on a fresh checkout if
# either is absent. CI never calls OpenAI or initializes Firebase
# (FirebaseApp.configure() runs from AppDelegate at app launch,
# and we skip the UI test bundle that would launch the app), so
# placeholders with the right shape are sufficient.
run: |
cat > Savely/Config.plist <<'PLIST'
<?xml version="1.0" encoding="UTF-8"?>
Expand All @@ -80,6 +82,39 @@ jobs:
</plist>
PLIST

cat > Savely/GoogleService-Info.plist <<'PLIST'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>API_KEY</key>
<string>AIzaSy_ci_placeholder_not_a_real_key</string>
<key>GCM_SENDER_ID</key>
<string>000000000000</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>IvanLB.Savely</string>
<key>PROJECT_ID</key>
<string>savely-ci-placeholder</string>
<key>STORAGE_BUCKET</key>
<string>savely-ci-placeholder.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false/>
<key>IS_ANALYTICS_ENABLED</key>
<false/>
<key>IS_APPINVITE_ENABLED</key>
<true/>
<key>IS_GCM_ENABLED</key>
<true/>
<key>IS_SIGNIN_ENABLED</key>
<true/>
<key>GOOGLE_APP_ID</key>
<string>1:000000000000:ios:0000000000000000000000</string>
</dict>
</plist>
PLIST

- name: Resolve SPM packages
run: |
xcodebuild \
Expand Down
30 changes: 0 additions & 30 deletions Savely/GoogleService-Info.plist

This file was deleted.

Loading