Repository navigation
feat(secrets): xcconfig + info.plist substitution for admob ids (pr1) - #265
Merged
Merged
Conversation
Migrates Sudoku + Minesweeper AdMob configuration from
hardcoded-with-fatalError-gate to build-time xcconfig substitution.
Mechanism (mirrors existing Tuist/Signing.xcconfig precedent):
- Tuist/AdMob.xcconfig (gitignored) — local real values
- Tuist/AdMob.xcconfig.example (committed) — Google sandbox + docstring
explaining both XCC env var source + local fill flow
- Tuist/Config-{Debug,Release}.xcconfig wrappers — #include? both
Signing + AdMob (optional include keeps fresh clone buildable)
- Project.swift per-target xcconfig wiring (Sudoku + Minesweeper)
- Both Info.plist files use $(ADMOB_APP_ID) + $(ADMOB_BANNER_UNIT_ID)
substitution (latter is a custom key we invented for app-side reads)
- Live.swift both apps: removed #if DEBUG / #else fatalError gate;
reads GADBannerUnitID via Bundle.main.object(forInfoDictionaryKey:)
through a guard that catches missing/empty/unresolved tokens
- ci_post_clone.sh: appended AdMob.xcconfig generation step that
selects per-workflow env vars from $CI_PRODUCT / $CI_XCODE_SCHEME
(fail-loud if missing)
Safety net (3 layers):
1. Smoke tests (InfoPlistAdMobKeysTests.swift) verify both keys exist
in each app's source Info.plist — catches accidental key deletion
2. Runtime guard in both Live.swift — preconditionFailure on missing,
empty, or literal $() token. Catches unresolved substitution at
app launch before AdMob SDK rejects.
3. Subsequent PRs will add a build-phase substitution-resolution check
to catch earlier than runtime
Tooling secrets (ASCRegister CLI, scope: scaffolding only):
- secrets/.env.example (committed) — KEY=VALUE structure + docstring
- secrets/ gitignore deny-by-default: * + !*.example + !README.md
- secrets/ASCAPI_AuthKey_*.p8 — user moves cert here post-merge
- ASCRegister CLI unchanged; user pattern: source secrets/.env
before invoking, then pass via existing flags
Sudoku byte-identicality:
- DEBUG: literal banner-unit value unchanged (sandbox both before + after)
- Release: behavior changed from fatalError crash → preconditionFailure
crash + smoke test pre-archive. Equivalent fail-loud safety.
AdMob SDK isolation audit: still exactly 1 import GoogleMobileAds
(LiveAdMobBridge.swift).
Tests:
- SudokuKit: 211/211 (existing 209 + 2 new smoke)
- MinesweeperKit: 33/33 (existing 31 + 2 new smoke)
Out of scope (subsequent PRs):
- Build-phase substitution-resolution check (Open Q1)
- gitleaks rule for prod AdMob IDs
- ADR / foundations.md update
- Removing precondition guard after one full prod release cycle
User-side post-merge (one-time):
1. cp Tuist/AdMob.xcconfig.example Tuist/AdMob.xcconfig + fill real
values from project memory admob-production-ids +
minesweeper-admob-ids
2. mv ~/GitHub/ASCAPI_AuthKey_*.p8 secrets/
3. ASC → Xcode Cloud → Workflow → Environment Variables: add
SUDOKU_ADMOB_APP_ID / _BANNER_UNIT_ID +
MINESWEEPER_ADMOB_APP_ID / _BANNER_UNIT_ID (mark Secret)
Refs:
- meetings/2026-06-03_admob-secret-injection-architect-review.md
- meetings/2026-06-03_admob-secret-injection-pr1.impl-notes.md
- .claude/skills/build-time-secret-injection/ (new project skill)
Co-Authored-By: Claude Opus 4.7 <[email protected]>
Round 2 inline fixes from PR #265 CR (verdict: ACCEPT with cosmetics): 1. `.gitignore` `secrets/*` → `secrets/**` — covers subdirectory contents (e.g. a future `secrets/p8/` or `secrets/keys/`); current `*` form only matches top-level files. 2. `secrets/README.md` created — the .gitignore allowlist `!secrets/README.md` was forward-looking to a missing file; the README now exists with one-time setup + daily-use instructions pointing at memory `asc-api-credentials`. 3. Collapsed duplicate comment paragraphs in both Live.swift files (subagent had paste-stacked two adjacent explanations of the same substitution chain). Now a single tight paragraph mentioning smoke-test (`InfoPlistAdMobKeysTests`) + runtime guard role. CR Important #1 (pre-existing prod-ID leaks in docs/ and meetings/) + Important #2 (`AppInfo.plist` drift risk) deferred to follow-up backlog issues — file separately. Build: clean on both packages. Co-Authored-By: Claude Opus 4.7 <[email protected]>
This was referenced Jun 3, 2026
wei18
added a commit
that referenced
this pull request
Jun 3, 2026
…et injection Captures 5 PRs merged today (#256 grace inversion / #257 .minesweeper CK config / #258 multi-app IAP / #259 MS AppComposition wire / #263 U15 LiveAdMobAdProvider + banner + toast / #264 prod-ID comment scrub / #265 AdMob secret injection PR1) plus 5 issues filed for follow-up (#260 #261 #262 #266 #267). Records decisions, rejected alternatives, Architect review hand-off, and the spec inversion (7-day grace removed). Notes Iron Law violation on skill writing + remediation via post-hoc CR. Co-Authored-By: Claude Opus 4.7 <[email protected]>
This was referenced Jun 3, 2026
wei18
added a commit
that referenced
this pull request
Jun 3, 2026
Per issue #267 (PR #265 CR Important #2), document option (c): accept the verbatim-copy drift risk in InfoPlistAdMobKeysTests since the test only guards the two AdMob keys (not plausibly deleted by accident). Escalate to a byte-for-byte sync sentinel only on a real drift incident. Co-authored-by: Claude Opus 4.8 <[email protected]>
wei18
added a commit
that referenced
this pull request
Jun 3, 2026
…ncy (#272) * docs(v2): refresh v2.5-readiness for xcconfig injection + grace removal Surfaced by docs-currency CR (2026-06-03). v2.5-readiness.md lagged two shipped changes: #265 (AdMob build-time xcconfig injection — replaced the LiveAdMobBridge fatalError Release branch that no longer exists) and #256 (gracePeriodDays = 0 — banner shows from first launch, no 7-day window, including the App-Review-facing test path). Also notes the xcconfig + Info.plist $() pattern in foundations.md §7. Co-Authored-By: Claude Opus 4.8 <[email protected]> * chore(telemetry): add swiftLanguageModes: [.v6] for manifest consistency Surfaced by config CR: TelemetryKit was the only one of 9 package manifests omitting `swiftLanguageModes: [.v6]`. Functionally near-equivalent under swift-tools-version 6.2 (defaults to v6), but aligns with the other 8 so the language mode is explicit everywhere. Build verified. Co-Authored-By: Claude Opus 4.8 <[email protected]> --------- Co-authored-by: Claude Opus 4.8 <[email protected]>
wei18
added a commit
that referenced
this pull request
Jun 3, 2026
…al (#273) Surfaced by docs-currency CR (2026-06-03). v2.5-readiness.md lagged two shipped changes: #265 (AdMob build-time xcconfig injection — replaced the LiveAdMobBridge fatalError Release branch that no longer exists) and #256 (gracePeriodDays = 0 — banner shows from first launch, no 7-day window, including the App-Review-facing test path). Also notes the xcconfig + Info.plist $() pattern in foundations.md §7. Co-authored-by: Claude Opus 4.8 <[email protected]>
wei18
added a commit
that referenced
this pull request
Jun 3, 2026
README framed the repo as a single Sudoku app with 4 packages. Updated to reflect current state: two app shells (Sudoku + Minesweeper), 9 local SPM packages (Persistence/GameCenter/GameShell extracted from SudokuKit; Minesweeper Core/Kit added), GameShellKit as the shared UI shell, Project.swift two-target Game umbrella, and Minesweeper v1 in the status section. Also notes production AdMob IDs now use build-time xcconfig injection (#265). Co-Authored-By: Claude Opus 4.8 <[email protected]>
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.
Summary
Migrates Sudoku + Minesweeper AdMob configuration from "hardcoded with fatalError gate" to build-time xcconfig substitution. Mirrors existing `Tuist/Signing.xcconfig` precedent.
Mechanism
Safety net (3 layers)
Test plan
Refs