Disney Streaming · Partnerships & Devices
Firebase web app for generating weekly and monthly KPI reports for the ADK Program meeting.
Replaces 30–45 minutes of manual Monday-morning work with a 5-minute upload-and-copy workflow.
| Workflow | Frequency | Source | What it generates |
|---|---|---|---|
| Playback Performance | Weekly | Conviva CSV | VSF-T, VPF-T, Attempts, Unique Devices charts + narrative |
| ADK Version Share | Weekly | Conviva CSV | Latest-snapshot pie chart, 30-day trend, % breakdown per ADK version |
| Partner Migration | Weekly | Sentry CSV | Partner migration table, configurable legacy threshold, notes block |
| Platform & Regional KPIs | Monthly | Looker ZIP / CSV | Platform MAU, MAD, Playback Hours, HPV plus estimated regional MAU, MAD, and Playback Hours |
| ADK Version Manager | Admin | Firestore | Add/edit ADK version → core_version mappings |
| Partner Region Mapping | Admin | Google Sheet CSV + Firestore | Import Sheet 1 partner/country/region mapping used by the regional estimation model |
| Legacy Workbook Sync | Admin | Excel + Firestore | Import historical Google Sheets workbooks and export merged replacement .xlsx files |
| Field | Value |
|---|---|
| Project name | NCP ADK Program Weekly KPIs |
| Project ID | device-platform-reporting |
| Project number | 741928725277 |
| Auth | Google Sign-In — @disney.com and @disneystreaming.com only |
| Analytics | Google Analytics (enabled) |
Node.js 18+
npm 9+
Firebase CLI: npm install -g firebase-tools
Google Cloud SDK (`gcloud`) for deploy auth bootstrap / ADC refresh
cd adk-kpi-app
npm install
cp .env.example .env
Open .env and fill in your values from:
Firebase Console → Project Settings → General → Your apps → SDK setup → Config
Required values:
REACT_APP_FIREBASE_API_KEYREACT_APP_FIREBASE_APP_IDREACT_APP_FIREBASE_MEASUREMENT_ID
The other values (auth domain, project ID, etc.) are pre-filled for device-platform-reporting.
.env is gitignored. Keep real values there, not in tracked source files.
Firebase Console → Firestore Database → Create database → Production mode → choose a region (us-central1 recommended).
Firebase Console → Storage → Get started → Production mode.
# Install the canonical helper scripts once per machine
mkdir -p ~/.local/bin
cp ../mergepath/scripts/gcloud/gcloud ~/.local/bin/gcloud
cp ../mergepath/scripts/firebase/op-firebase-deploy ~/.local/bin/
cp ../mergepath/scripts/firebase/op-firebase-setup ~/.local/bin/
chmod +x ~/.local/bin/gcloud ~/.local/bin/op-firebase-deploy ~/.local/bin/op-firebase-setup
hash -r
# One-time per maintainer/machine
# Make sure 1Password CLI can read Private/GCP ADC -> credential
# One-time per project for deploy maintainers
op-firebase-setup device-platform-reporting
set -a
source .env
set +a
npm run build
npm run deployThe app will be live at: https://device-platform-reporting.web.app
npm run deploy uses op-firebase-deploy, which now creates a short-lived impersonated credential for firebase-deployer@device-platform-reporting.iam.gserviceaccount.com from a 1Password-backed GCP ADC source credential or another explicit GOOGLE_APPLICATION_CREDENTIALS file instead of requiring firebase login.
The 1Password-first deploy-auth model is intentional for this repo. Do not switch it back to ADC-first or deploy-key-based guidance unless a human explicitly requests that change.
set -a
source .env
set +a
npm start
# → http://localhost:3000Note: Google Sign-In requires the domain to be in the authorized list.
Add localhost in Firebase Console → Authentication → Settings → Authorized domains.
- Deploy maintainers should install
firebase-tools,gcloud, and the canonical helper scripts from../mergepath/scripts/. - The normal maintainer flow reads the shared
Private/GCP ADCsource credential through the 1Password CLI, so routine deploy work does not need browser login once that item exists. op-firebase-setup device-platform-reportingcreates the deployer service account, grants deploy roles, and grants the current maintainer impersonation rights.npm run deploy/npm run deploy:hostingcallop-firebase-deploy, which creates a temporary impersonated credential forfirebase-deployer@device-platform-reporting.iam.gserviceaccount.com.- For future APIs or services, keep committed templates only, for example
.env.tplorconfig.runtime.tpl, withop://Private/<item>/<field>references. Resolve them at deploy time withop inject -i <template> -o <gitignored-file> -f.
- Client-only React app hosted on Firebase Hosting
- CSV and ZIP processing happens in the browser
- Firebase Authentication + Firestore provide auth and persistence
- No Cloud Functions or backend ingestion pipeline in this repo
- Navigate to ADK Version Manager in the sidebar.
- Click Seed Initial Data to load all known ADK versions (3.0 through 3.1.1).
- When ADK 4.0 ships (GA: 23 Mar 2026), click + Add ADK Version:
- ADK Version:
ADK 4.0 - core_version strings: paste the exact string from the Sentry export (check Sentry after GA ships)
- Release Date:
2026-03-23 - Notes:
Current GA
- ADK Version:
Time: ~5 minutes, before the 10:00 AM PT meeting
- Playback Performance — Export CSV from Conviva Playback Performance (last 30 days) → upload → review the four metric sections and generated narrative → copy to Confluence.
- ADK Version Share — Export CSV from Conviva ADK Version Comparisons (last 30 days) → upload → review latest pie chart and 30-day trend → copy to Confluence.
- Partner Migration — Export CSV from Sentry ADK Partner–Device Combinations (last 24h, tabular view) → upload → adjust thresholds if needed → copy notes to Confluence.
Run at the end of each month
- Partner Region Mapping — Open the shared Partner Country + Region mapping sheet, update Sheet 1, export Sheet 1 as CSV, and upload it in the app whenever the mapping changes. The optional
dashboard_aliasescolumn is the approved way to map non-1:1 Looker partner labels. - Platform & Regional KPIs — Download the zip from Looker D+ Device Health Dashboard (Device Family=rust, last 12 complete months) and upload it directly. The page still supports manual upload of
active_accounts.csv,active_devices.csv, andplayback_hours.csvas a platform-only fallback. - The combined monthly page saves the platform KPI snapshot to
monthlySnapshotsand, when the zip also includesactive_accounts_(data).csv/active_accounts.csv,playback_hours_(data).csv/playback_hours.csv,regional_device_distribution.csv, andaverage_daily_active_devices.csv, it also derives estimated regional MAU, MAD, and Playback Hours from the same import. - Regional output is an estimation model, not a ground-truth geographic attribution model. Directly region-coded partners stay assigned to those regions. Global or unmapped partners are redistributed proportionally from the observed mix of directly mapped partners, which can bias results if the unmapped/global partner base has a different regional footprint.
- If the Looker export only contains one month, the page compares the current month against the most recent saved platform snapshot and the most recent saved regional estimate history available in Firestore.
Use Legacy Workbook Sync in the sidebar when you need to keep the historical Google Sheets up to date for teams that still rely on them.
- Import the current copies of:
NCP+ADK Program Weekly KPIs.xlsxADK Adoption Burn Down 2025.xlsx
- Continue importing data through the normal app workflows. Weekly and monthly imports save automatically.
- Export merged replacement workbooks whenever you need to refresh the legacy Google Sheets.
Notes:
- Imported workbook sheets are stored in Firestore as the historical baseline. New workbook imports are versioned so the latest baseline can be rolled back to the previous import within 90 days.
- Workflow auto-saves dedupe by dataset content, not filename, so re-exporting the same source data under a new filename is still treated as already imported.
- Import only trusted internal workbook exports. The app reads each spreadsheet locally in the browser and stores sheet contents in Firestore as the export baseline.
- New Partner Migration saves now retain the raw Sentry rows needed to recreate Discover tabs in the burn-down workbook.
- New Platform & Regional KPI saves retain the partner-level workbook row data needed to rebuild the legacy monthly tabs, and newer saves embed the regional estimation payload used to rebuild the legacy regional tab.
- Older platform snapshots saved before this feature do not contain that partner-level workbook payload, so import the legacy workbook first if you need complete monthly history.
adkVersions/ — ADK version reference table (editable in app)
partnerRegionMappings/ — Imported Sheet 1 partner/country/region mapping rows keyed by normalized partner identity
partnerRegionMappingMeta/ — Metadata for the currently active mapping import
weeklySnapshots/ — Playback Performance uploads + generated narrative snapshot
adkVersionShare/ — Weekly ADK version share history and saved trend data
partnerMigration/ — Weekly partner migration snapshots + thresholds used
monthlySnapshots/ — Computed monthly platform KPI series plus embedded regional estimate payloads for newer combined saves
importBatches/ — Auto-save batch metadata used for duplicate detection and rollback
legacyWorkbookImports/ — Workbook import manifests (latest imported source file + sheet list)
legacyWorkbookImportBatches/ — Versioned legacy workbook import metadata used for rollback
legacyWorkbookSheets/ — Sheet-level historical workbook baseline used for export
npm test
npm run buildNotes:
npm testnow runs Jest coverage for the core utility layer plus initial DOM tests forUploadZoneandPlatformKpis.- The broader rollout plan still lives in
specs/Automated_Test_Suite_Plan.md. - Production builds currently emit webpack bundle-size warnings, but they complete successfully.
This repo now ships a small automated unit test harness, and the remaining rollout is documented in specs/Automated_Test_Suite_Plan.md.
Summary:
- Start with Jest because the app already uses Babel and webpack.
- The current suite covers the highest-risk pure utilities first (
importHistory,looker,partnerRegionMapping,regionalEstimates) and now includes initial DOM behavior coverage forUploadZoneandPlatformKpis. - Add page-level workflow tests next with mocked Firebase modules.
- Add a small Playwright smoke suite only after the fast test layer is stable, ideally against Firebase emulators or a test-only auth seam instead of live Google Sign-In.
Planned pull-request gate once implemented:
npm run build
npm test- Firestore and Storage rules restrict all access to authenticated @disney.com and @disneystreaming.com users.
- Domain enforcement happens both in the Firebase Auth layer (client-side) and in Firestore security rules (server-side).
- Auto-saved workflow imports, legacy workbook baselines, and rollback metadata are creator-owned for delete/rollback paths. The shared 90-day rollback window is enforced from Firestore server timestamps.
- No data is publicly readable.
- The Firebase Web API key is not the auth boundary, but it still should not live in tracked source or public bundles longer than necessary. Public exposure creates abuse and alerting risk.
- Keep live Firebase values in local
.envonly.src/firebase.jsshould contain code paths and defaults, not real keys. - Keep browser-key restrictions enabled in Google Cloud Credentials.
- If the key is exposed: remove it from source/history, create a replacement key with the same referrer/API restrictions, update
.env, source the file, rebuild/redeploy, verify the live bundle, then delete the old key. npm testnow includes a tracked-file secret scan so committed API keys, OAuth tokens, and private keys fail the normal test run.
- API integrations with Conviva Pulse, Looker, and Sentry — replacing CSV uploads with automated ingestion.
- Scheduled Sunday-night data pull so the report is ready before 9:00 AM PT Monday.
- Executive deck data (PlayStation, Xbox, BBD, Roku) for P&D quarterly decks.
- Confluence API write-back.