firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

feat: Implement --ephemeral flag to prevent emulator data export

Open christhompsongoogle opened this issue 5 months ago • 0 comments

The --ephemeral flag for the emulators:start command ensures that no data is exported when the emulators stop, even if --export-on-exit is specified or if the emulators:export command is used during the session.

Import functionality remains unaffected when using --ephemeral with --import.

Changes include:

  • Modified controller.ts to check for options.ephemeral in exportOnExit and exportEmulatorData functions, preventing export and logging a message.
  • Added integration tests in scripts/emulator-import-export-tests/tests.ts to verify:
    • No export occurs with --export-on-exit in ephemeral mode.
    • Data import works, but subsequent export is prevented in ephemeral mode.
    • The emulators:export command does not export data if emulators were started with --ephemeral.

christhompsongoogle avatar Jun 25 '25 21:06 christhompsongoogle