-
Notifications
You must be signed in to change notification settings - Fork 950
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
Fixes secret params resolution in functions emulator #7443
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM! Tested the PR using https://github.com/aalej/issues-7401?tab=readme-ov-file#pr-test. Could you add a changelog entry?
src/deploy/functions/build.ts
Outdated
@@ -279,13 +279,15 @@ export async function resolveBackend( | |||
userEnvOpt: UserEnvsOpts, | |||
userEnvs: Record<string, string>, | |||
nonInteractive?: boolean, | |||
isEmulator = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: this list of args is quite long, and it would be easy to transpose nonInteractive and isEmulator. Consider switching to a parameter object. ie:
export async function resolveBackend( args: {
build: Build,
firebaseConfig: FirebaseConfig,
userEnvOpt: UserEnvsOpts,
userEnvs: Record<string, string>,
nonInteractive?: boolean,
isEmulator?: boolean,
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, with a suggestion
The functions emulator will try to resolve secrets twice - we disable the secret resolution in deploy flow's
resolveBackend
(which is reused by the emulator to discover functions triggers) so the emulator can access handle emulator-specific secret resolution (i.e. prioritizing .secret.local).Fixes #7401.