Skip to content
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

Merged
merged 5 commits into from
Aug 6, 2024

Conversation

blidd-google
Copy link
Contributor

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.

@blidd-google blidd-google self-assigned this Jul 12, 2024
Copy link
Contributor

@aalej aalej left a 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?

@blidd-google blidd-google enabled auto-merge (squash) July 15, 2024 19:55
@blidd-google blidd-google requested a review from aalej July 15, 2024 19:55
@@ -279,13 +279,15 @@ export async function resolveBackend(
userEnvOpt: UserEnvsOpts,
userEnvs: Record<string, string>,
nonInteractive?: boolean,
isEmulator = false,
Copy link
Contributor

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,
  })

Copy link
Contributor

@joehan joehan left a 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

@blidd-google blidd-google merged commit 4839dcb into master Aug 6, 2024
41 checks passed
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.

Functions emulator should not requires authenticated secret manager calls if .secret.local is defined
3 participants