Add PubSubToAlloyDb Yaml template#3457
Add PubSubToAlloyDb Yaml template#3457wladabutenko wants to merge 8 commits intoGoogleCloudPlatform:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request delivers a new streaming Dataflow template designed to facilitate the ingestion and transformation of data from Google Cloud Pub/Sub into AlloyDB. It provides a flexible, YAML-driven approach to define data mappings and includes robust error handling to ensure data integrity and observability for failed records. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
R: @derrickaw |
There was a problem hiding this comment.
Code Review
This pull request introduces a new YAML template for streaming data from Pub/Sub to AlloyDB. A critical security vulnerability exists due to improper escaping of user-provided parameters in the Jinja2 YAML pipeline definition, which can lead to YAML injection and Remote Code Execution (RCE) on Dataflow workers. Furthermore, sensitive information like the database password is logged in plain text by the template launcher. Beyond these security concerns, there are several areas for improvement regarding documentation clarity and naming conventions, including incorrect documentation for windowing parameters in the README and misleading parameter names (e.g., location for the table name).
yaml/src/main/java/com/google/cloud/teleport/templates/yaml/PubSubToAlloyDbYaml.java
Show resolved
Hide resolved
yaml/src/main/java/com/google/cloud/teleport/templates/yaml/PubSubToAlloyDbYaml.java
Outdated
Show resolved
Hide resolved
yaml/src/test/java/com/google/cloud/teleport/templates/yaml/PubSubToAlloyDbYamlIT.java
Show resolved
Hide resolved
yaml/src/test/java/com/google/cloud/teleport/templates/yaml/PubSubToAlloyDBYamlIT.java
Outdated
Show resolved
Hide resolved
yaml/src/main/java/com/google/cloud/teleport/templates/yaml/PubSubToAlloyDbYaml.java
Show resolved
Hide resolved
5832616 to
523df40
Compare
Streaming YAML template reads messages from a Pub/Sub subscription, applies a user-defined mapping to extract and transform fields, and groups messages using the configured windowing. Successful records are written to an AlloyDB (Postgres) table via JDBC using the provided write statement and connection options. TransformData errors are published to a configured dead-letter Pub/Sub topic for separate inspection.