Files
firebase/CHANGELOG.md
Rene Nochebuena 3ef30c2354 feat(firebase): initial stable release v0.9.0
Firebase App component with launcher lifecycle and health check integration.

What's included:
- Config with ProjectID (FIREBASE_PROJECT_ID env var); credentials via ADC
- Provider interface exposing native *firebase.App directly
- Component interface: launcher.Component + health.Checkable + Provider
- New(logger, cfg) constructor for lifecycle registration via lc.Append
- Health check via GetUser("health-probe-non-existent") + auth.IsUserNotFound at LevelCritical
- No-op OnStop (Firebase Admin SDK has no Close method)

Tested-via: todo-api POC integration
Reviewed-against: docs/adr/
2026-03-19 13:35:40 +00:00

2.1 KiB

Changelog

All notable changes to this module will be documented in this file.

The format is based on Keep a Changelog, and this module adheres to Semantic Versioning.

0.9.0 - 2026-03-18

Added

  • Config struct — Firebase connection settings loaded from environment variables: FIREBASE_PROJECT_ID (required, Google Cloud project ID); credentials are resolved via Application Default Credentials (ADC)
  • Provider interface — App() *firebase.App; for consumers that only need the Firebase Admin SDK entry point
  • Component interface — embeds launcher.Component, health.Checkable, and Provider; the full lifecycle-managed surface registered with the launcher
  • New(logger logz.Logger, cfg Config) Component — constructor; returns a Component ready for lc.Append
  • OnInit — validates ProjectID, then calls fb.NewApp to construct the Admin SDK *firebase.App
  • OnStart — no-op beyond logging; connectivity is verified by HealthCheck
  • OnStop — no-op log statement; the Firebase Admin SDK exposes no Close method
  • HealthCheck(ctx context.Context) error — calls GetUser("health-probe-non-existent") on the Auth client; treats auth.IsUserNotFound as healthy (confirms the service is reachable); any other error is a health failure
  • Name() string — returns "firebase"
  • Priority() health.Level — returns health.LevelCritical; a Firebase Auth outage is treated as a critical failure

Design Notes

  • The native *firebase.App is exposed directly via App(); callers obtain service-specific clients themselves (e.g. app.Auth(ctx), app.Firestore(ctx)), keeping this module free of service proliferation.
  • The health check uses a sentinel UID ("health-probe-non-existent") rather than string-matching error messages, making it robust against Firebase error message changes.
  • Provider / Component split follows the framework pattern: inject Provider into services that only need App(), inject Component only at the lifecycle registration site.