fix(firebase): gate google-services.json behind committed template (E01.S01)#11
Open
abdout wants to merge 1 commit into
Open
fix(firebase): gate google-services.json behind committed template (E01.S01)#11abdout wants to merge 1 commit into
abdout wants to merge 1 commit into
Conversation
…01.S01) `app/google-services.json` is gitignored (real Firebase config never enters version control), so fresh checkouts fail AGP's `:app:processDebugGoogleServices` task — silent stub #5 from epic-prod-overview. Implements the AC's escape hatch (gate behind Gradle property + ship a template): - Commits `app/google-services.json.template` with stub but structurally valid values: `project_id=hogwarts-android-stub`, all-zero `mobilesdk_app_id`s, dummy API key. Client entries cover both `org.hogwarts.android` (release) and `org.hogwarts.android.debug` (the .debug applicationIdSuffix variant). - Adds a configuration-time hook in `app/build.gradle.kts` that materialises `app/google-services.json` before AGP needs it: 1. If the real file already exists, no-op. 2. Else if `-Pfirebase.config.path=/abs/path` is passed, copy from there (validates path exists). 3. Else copy the template with a `logger.warn` so devs know they're running on stub config. 4. Else hard-fail with an actionable message pointing at the README. The materialised file stays gitignored — copy happens on every fresh checkout, real Firebase calls fail loud via AppStartupInitializer.confirmFirebase (E01.S07) instead of silently no-op'ing. - README gets a "Firebase setup" section under Getting Started showing both supply paths (drop file directly vs `-Pfirebase.config.path`). Deferred from this PR: "staging and release flavors point to separate Firebase projects" — there's no staging productFlavor today; adding flavors is larger than 2 pts and folds into E27 release pipeline work. Closes #10 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
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
app/google-services.json.templatewith structurally valid stub values that pass AGP's parser; real Firebase config stays gitignoredapp/build.gradle.ktsthat materialisesapp/google-services.jsonfrom either-Pfirebase.config.path=/abs/pathor the templateStory
E01.S01 (Phase 1 Pilot v1, Sprint P1, 2 pts) — clears blocker #5 from
epic-prod-overview.md's "10 silent stubs" list.Test plan
app/google-services.jsonpresent) →./gradlew :app:processDebugGoogleServicessucceeds; logger.warn prints the template-fallback messageapp/google-services.json→ the hook no-ops and uses your file./gradlew :app:processDebugGoogleServices -Pfirebase.config.path=/tmp/fake.jsonfails with a clear "does not exist" errorgit check-ignore app/google-services.jsonreturns the rule on line 70;git check-ignore app/google-services.json.templatereturns nothingFirebaseApp.getInstance()succeeds (passes the stub parser); FCM token rotation calls fail with a recognisable error and log via the gracefully-handled path inAppStartupInitializer.confirmFirebase(E01.S07)Deferred (out of P1 scope)
"Staging and release flavors point to separate Firebase projects" — needs a staging productFlavor that doesn't exist today. Adding flavors is larger than 2 pts and folds into E27 release-pipeline work.
Coexistence
Stacks cleanly on top of PRs #5/#7/#9 — touches
app/build.gradle.ktsonly in a new top-level configuration block (not the productFlavors / buildTypes that PR #7 edited).Closes #10
Generated with Claude Code