Skip to content

feat: Add global dataDir for emulator persistence #8782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

christhompsongoogle
Copy link
Contributor

Implements a global emulators.dataDir setting in firebase.json to allow users to easily persist and re-load emulator data across sessions.

Key changes:

  • Added emulators.dataDir to firebase.json schema.
  • Updated firebase init emulators to prompt for dataDir configuration.
  • Added --ephemeral flag to emulators:start and emulators:exec to ignore dataDir for a single run.
  • Emulators now automatically import data from dataDir on startup if it exists and contains valid export metadata.
  • Emulators now automatically export data to dataDir on clean shutdown if dataDir is configured (and not overridden by --export-on-exit flag).
  • Handled deprecation of emulators.dataconnect.dataDir, preferring the global emulators.dataDir with warnings.
  • Added unit tests for the new functionality.

Description

Scenarios Tested

Sample Commands

Implements a global `emulators.dataDir` setting in `firebase.json` to allow users to easily persist and re-load emulator data across sessions.

Key changes:
- Added `emulators.dataDir` to `firebase.json` schema.
- Updated `firebase init emulators` to prompt for `dataDir` configuration.
- Added `--ephemeral` flag to `emulators:start` and `emulators:exec` to ignore `dataDir` for a single run.
- Emulators now automatically import data from `dataDir` on startup if it exists and contains valid export metadata.
- Emulators now automatically export data to `dataDir` on clean shutdown if `dataDir` is configured (and not overridden by `--export-on-exit` flag).
- Handled deprecation of `emulators.dataconnect.dataDir`, preferring the global `emulators.dataDir` with warnings.
- Added unit tests for the new functionality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant