You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
predeploy hooks for every codebase run when --only lists multiple functions in the same codebase #11475
Two functions in different codebases do not hit this, because each codebase marks its own first filter. Two or more functions in the same codebase do.
Suggested fix
When a codebase matches, mark every --only filter with that codebase prefix, not only the first find result. If every filter's codebase is known, keep onlyConfigs limited to those codebases.
Thanks for the detailed report and for taking the time to look through the source code, @samuel-pp! I think your observations are correct, because we use Array.find() in getReleventConfigs, it stops at the first match. The subsequent targets are left as false, triggering the fallback that runs all hooks.
I am able to reproduce the issue, deploying a single function in a codebase or a single codebase works as expected. However, as you mentioned, deploying multiple functions on the same codebase triggers this issue
Running a command with multiple filters like firebase deploy --dry-run --only "functions:codebase-a:helloWorldA_1" --project PROJECT_ID, will trigger the predeploy script of another codebase
$ firebase deploy --dry-run --only "functions:codebase-a:helloWorldA_1,functions:codebase-a:helloWorldA_2" --project PROJECT_ID
=== Deploying to 'PROJECT_ID'...
i deploying functions
Running command: echo "hello from codebase-a"
hello from codebase-a
✔ functions: Finished running predeploy script.
Running command: echo "hello from codebase-b"
hello from codebase-b
However a single codebase or function does not trigger this behavior
$ firebase deploy --dry-run --only "functions:codebase-a:helloWorldA_1" --project PROJECT_ID
=== Deploying to 'PROEJCT_ID'...
i deploying functions
Running command: echo "hello from codebase-a"
hello from codebase-a
✔ functions: Finished running predeploy script.
I'll check this with our engineering team and mark this as reproducible. Since it looks like you've identified the cause, if you're interested, feel free to submit a PR for this! Otherwise someone from our engineering team should be able to take a look shortly
Activity
aalej commentedon Nov 10, 2026
Thanks for the detailed report and for taking the time to look through the source code, @samuel-pp! I think your observations are correct, because we use
Array.find()ingetReleventConfigs, it stops at the first match. The subsequent targets are left as false, triggering the fallback that runs all hooks.I am able to reproduce the issue, deploying a single function in a codebase or a single codebase works as expected. However, as you mentioned, deploying multiple functions on the same codebase triggers this issue
Running a command with multiple filters like
firebase deploy --dry-run --only "functions:codebase-a:helloWorldA_1" --project PROJECT_ID, will trigger the predeploy script of another codebaseHowever a single codebase or function does not trigger this behavior
I'll check this with our engineering team and mark this as reproducible. Since it looks like you've identified the cause, if you're interested, feel free to submit a PR for this! Otherwise someone from our engineering team should be able to take a look shortly
sharing mcve here - https://github.com/aalej/issues-11475