Skip to content

feat(firestore-send-email): migrate to v2 cloud function #2359

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

Merged
merged 14 commits into from
Apr 22, 2025

Conversation

CorieW
Copy link
Contributor

@CorieW CorieW commented Mar 28, 2025

Resolves #2002

need to test

@cabljac cabljac requested a review from Copilot March 31, 2025 10:40
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates the firestore-send-email extension to use the v2 Cloud Function trigger and supports non-default Firestore databases. The changes include updates to type definitions, modifications in index.ts to adopt Firestore v2 APIs, and corresponding updates in configuration, documentation, and changelog.

Reviewed Changes

Copilot reviewed 7 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
functions/src/types.ts Added new config fields for Firestore instance identification and region.
functions/src/index.ts Modified Firestore API usages and trigger setup to support v2 functions and types.
functions/src/config.ts Added new configuration properties for database and databaseRegion.
extension.yaml Updated function type to firebaseextensions.v1beta.v2function, version bump, and config.
README.md Updated documentation to reflect new Firestore instance configuration parameters.
POSTINSTALL.md Updated instructions for accessing non-default Firestore databases post-installation.
CHANGELOG.md Documented version bump and migration to v2 Firestore trigger.
Files not reviewed (3)
  • project/.firebaserc: Language not supported
  • project/.gitignore: Language not supported
  • project/firebase.json: Language not supported

@CorieW CorieW force-pushed the @invertase/firestore-send-email-v2 branch 3 times, most recently from a719342 to b75d88a Compare March 31, 2025 12:59
@cabljac cabljac force-pushed the @invertase/firestore-send-email-v2 branch 2 times, most recently from 4298229 to 3c2e04f Compare April 10, 2025 11:27
@cabljac cabljac marked this pull request as ready for review April 17, 2025 09:57
@cabljac cabljac requested a review from a team as a code owner April 17, 2025 09:57
@cabljac cabljac requested a review from Copilot April 22, 2025 13:02
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates the Firestore trigger to use Cloud Functions v2 and adds support for non-default Firestore instances. Key changes include:

  • Adding new configuration options (database and databaseRegion) in types and config.
  • Updating Cloud Function initialization and trigger setup to use the new Firebase Admin modular API and Firestore v2 trigger.
  • Adjusting tests, documentation, and extension parameters to accommodate the new Firestore configuration.

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
firestore-send-email/functions/src/types.ts Added new configuration properties for Firestore instance ID and region.
firestore-send-email/functions/src/index.ts Migrated to modular Firebase Admin API and updated Firestore trigger and transaction handling.
firestore-send-email/functions/src/config.ts Added defaults and environment variable parsing for new firestore configuration fields.
firestore-send-email/functions/tests/helpers.test.ts Updated tests to include the new database and region configuration.
firestore-send-email/functions/tests/config.test.ts Updated tests to include new firestore configuration keys.
firestore-send-email/extension.yaml Increased version; updated trigger configuration and parameters for identifying non-default databases.
firestore-send-email/README.md Expanded configuration documentation for Firestore instance ID and location.
firestore-send-email/POSTINSTALL.md Updated post-install instructions to reference non-default Firestore databases.
firestore-send-email/CHANGELOG.md Updated changelog to reflect the new version and feature additions.
Files not reviewed (1)
  • firestore-send-email/functions/package.json: Language not supported

Copy link
Contributor

@cabljac cabljac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

fix: add defaults to config.ts to make tests run
@cabljac cabljac force-pushed the @invertase/firestore-send-email-v2 branch from 4bd843a to 4cfffc2 Compare April 22, 2025 13:35
@cabljac cabljac merged commit 92d89ab into next Apr 22, 2025
10 checks passed
@cabljac cabljac deleted the @invertase/firestore-send-email-v2 branch April 22, 2025 13:43
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.

🐛 firestore-send-email Migrate to v2 cloud function
2 participants