Skip to content

Conversation

Gustolandia
Copy link
Contributor

#1981

Description (issue 1981):
This PR introduces backward-compatible event types while adding new naming conventions for Firestore BigQuery Export. The changes ensure robust event handling across multiple versions of the extension. The following updates have been made:

Key Changes:
1. New Event Types:
• Introduced new events using the updated naming convention:
• firebase.extensions.firestore-bigquery-export.v1.onStart
• firebase.extensions.firestore-bigquery-export.v1.onSuccess
• firebase.extensions.firestore-bigquery-export.v1.onError
• firebase.extensions.firestore-bigquery-export.v1.onCompletion
2. Backward Compatibility:
• Maintains the existing events under the old naming convention:
• firebase.extensions.firestore-counter.v1.*
• Both old and new event types are published for each operation to ensure smooth migration.
3. Refactored Event Publishing:
• Updated event publishing logic to dynamically handle both old and new event types.
• Functions now publish events using Promise.all for better concurrency.
4. Unit Tests:
• Enhanced unit tests to verify:
• Events for both old and new naming conventions are correctly published.
• Proper handling of CREATE, DELETE, and UPDATE scenarios.
• Mocked Eventarc interactions for improved testing reliability.
5. Code Improvements:
• Refactored events.ts to dynamically generate both old and new event types for reuse.
• Added extensive documentation to clarify the event publishing logic and backward compatibility strategy.

Testing:
1.	Unit Tests:
•	Added test cases for CREATE, DELETE, and UPDATE scenarios.
•	Verified that both old (firestore-counter) and new (firestore-bigquery-export) event types are published.
2.	Local Testing:
•	Tested event publishing with mocked Eventarc to ensure consistency.
•	Verified performance and reliability with simulated Firestore data changes.

Checklist:
•	Code refactored for event compatibility.
•	Tests updated and passed successfully.
•	Documentation updated for event naming conventions.
•	Verified performance under high-load scenarios.

Notes:
•	This PR ensures compatibility while transitioning to the new naming convention.
•	Developers can gradually update their consumers to listen for new events.
•	Legacy systems will remain unaffected by these changes.

@Gustolandia Gustolandia added type: bug Something isn't working extension: firestore-bigquery-export Related to firestore-bigquery-export extension labels Dec 20, 2024
@Gustolandia Gustolandia self-assigned this Dec 20, 2024
@Gustolandia Gustolandia force-pushed the @invertase/Extensions/firestore-bigquery-export/1981 branch from aa614f5 to 925668e Compare December 20, 2024 18:23
@Gustolandia Gustolandia requested a review from CorieW December 20, 2024 18:34
@Gustolandia Gustolandia linked an issue Dec 20, 2024 that may be closed by this pull request
@cabljac cabljac changed the title fix(firestore-bigquery-export): @invertase: Add Backward Compatibility and New Event Types for Firestore BigQuery Export fix(firestore-bigquery-export): Add Backward Compatibility and New Event Types for Firestore BigQuery Export Dec 23, 2024
@Gustolandia Gustolandia force-pushed the @invertase/Extensions/firestore-bigquery-export/1981 branch 3 times, most recently from 9ddae40 to 3fcac8e Compare December 28, 2024 01:08
@Gustolandia Gustolandia requested a review from pr-Mais December 30, 2024 18:17
@cabljac cabljac requested a review from a team as a code owner January 6, 2025 11:21
@cabljac cabljac force-pushed the @invertase/Extensions/firestore-bigquery-export/1981 branch 2 times, most recently from 15cc2b0 to 26951aa Compare January 6, 2025 12:26
@Gustolandia Gustolandia force-pushed the @invertase/Extensions/firestore-bigquery-export/1981 branch from 26951aa to baab3d3 Compare January 10, 2025 02:40
@Gustolandia
Copy link
Contributor Author

@cabljac Do you have any final comments regarding this?

@Gustolandia Gustolandia dismissed pr-Mais’s stale review January 10, 2025 02:46

Changes applied in the last ammend

@cabljac cabljac force-pushed the @invertase/Extensions/firestore-bigquery-export/1981 branch 2 times, most recently from dd73667 to d56e77b Compare January 31, 2025 17:53
@cabljac cabljac force-pushed the @invertase/Extensions/firestore-bigquery-export/1981 branch from d56e77b to 7a34ad8 Compare January 31, 2025 17:55
@cabljac cabljac merged commit c14805d into next Jan 31, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension: firestore-bigquery-export Related to firestore-bigquery-export extension type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 [firestore-bigquery-export] Fix eventArc event types
3 participants