fix(extensions): revert ext:export option name change and fix bugs - #10982
Merged
Conversation
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try the Wiz Code extension for VS Code, JetBrains, or Visual Studio. |
Contributor
There was a problem hiding this comment.
Code Review
This pull request reverts the --extension-instance option back to --instance in the ext:export command, removes the unused kits mode, and fixes path resolution bugs by using resolve instead of join. The review feedback suggests throwing a FirebaseError if a specified --kit-instance is not found in firebase.json to prevent silent fallbacks, and simplifying the directory creation logic by directly using the already-resolved writeLocation.configDir path.
Berlioz
approved these changes
Aug 25, 2026
ajperel
force-pushed
the
ajp/fix-export-to-kit
branch
from
August 25, 2026 02:22
de364d8 to
53407b6
Compare
ajperel
enabled auto-merge (squash)
August 25, 2026 02:23
… bugs ### Description This commit addresses issues in the `ext:export` command options and fixes a path resolution bug: 1. Reverts the `--extension-instance` option back to `--instance` (and removes the `-e` short flag). 2. Fixes a bug in option registration where `extension-instance` and `kit-instance` options were defined incorrectly as separate arguments to `.option()`, causing Commander to treat them as boolean flags and throw "Too many arguments" errors. 3. Fixes a typo in the kit instance option name from `---kit-instance` to `--kit-instance`. 4. Simplifies the export mode check by removing the undocumented and unused `kits` mode. 5. Renames loop variables in `kitExportTarget` to `kitInstanceId` and `configDirPath` for better readability and to avoid shadowing. 6. Fixes a path resolution bug in `fnHandler` where joining `projectDir` and already-absolute `configDir` caused `mkdirSync` to fail. Ensured `kitExportTarget` always returns absolute paths and used `path.resolve` for directory creation. 7. Throws a `FirebaseError` if a specified `--kit-instance` is not found in `firebase.json` instead of silently falling through. 8. Removes redundant `console.log` dump of exported environment variables from `fnHandler`. ### Scenarios Tested - Built the project successfully (`npm run build`). - Verified `--help` output shows options correctly formatted and documented. - Verified running `ext:export` with `--mode functions --instance <id>` parses correctly and does not throw "Too many arguments" errors. - Verified running with multiple `-k` options (e.g. `-k id -k id`) parses correctly. - Ran unit tests using `npm run tests`. - Verified exporting extension config locally writes to the correct directory without unexpected path resolution errors. - Verified running `ext:export` with non-existent `--kit-instance` throws a clear error. - Verified exporting extension config does not print env variables dump to console. ### Sample Commands * `firebase ext:export --mode functions --instance firestore-bigquery-export` * `firebase ext:export --mode functions --instance firestore-bigquery-export --kit-instance firestore-bigquery-export` TAG=agy CONV=4603ef45-7e00-4639-b91a-2e65853ba34d
ajperel
force-pushed
the
ajp/fix-export-to-kit
branch
from
August 25, 2026 17:57
53407b6 to
16e2d47
Compare
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.
Description
This commit addresses issues in the
ext:exportcommand options and fixes a path resolution bug:--extension-instanceoption back to--instance(and removes the-eshort flag).extension-instanceandkit-instanceoptions were defined incorrectly as separate arguments to.option(), causing Commander to treat them as boolean flags and throw "Too many arguments" errors.---kit-instanceto--kit-instance.kitsmode.kitExportTargettokitInstanceIdandconfigDirPathfor better readability and to avoid shadowing.fnHandlerwhere joiningprojectDirand already-absoluteconfigDircausedmkdirSyncto fail. EnsuredkitExportTargetalways returns absolute paths and usedpath.resolvefor directory creation.Scenarios Tested
npm run build).--helpoutput shows options correctly formatted and documented.ext:exportwith--mode functions --instance <id>parses correctly and does not throw "Too many arguments" errors.-koptions (e.g.-k id -k id) parses correctly.npm run tests.Sample Commands
firebase ext:export --mode functions --instance firestore-bigquery-exportfirebase ext:export --mode functions --instance firestore-bigquery-export --kit-instance firestore-bigquery-exportTAG=agy
CONV=4603ef45-7e00-4639-b91a-2e65853ba34d
Description
Scenarios Tested
Sample Commands