-
-
Notifications
You must be signed in to change notification settings - Fork 22
Add webhooks and watchlist events to app managers #128
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
Add webhooks and watchlist events to app managers #128
Conversation
Introduces support for the `webhooks` and `enable_watchlist_events` fields in DynamoDB, MySQL, and PostgreSQL app managers. This includes schema migrations, serialization/deserialization, and mapping to the App struct, enabling storage and retrieval of webhook configurations and watchlist event toggles.
Summary of ChangesHello @itsbalamurali, 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 enhances the application management system by integrating support for webhook configurations and a toggle for watchlist events. It ensures that these new settings can be properly stored, retrieved, and managed across all supported database backends, including DynamoDB, MySQL, and PostgreSQL, by introducing necessary schema updates and data handling mechanisms. Highlights
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
|
Updated warn! macro calls in MySQLAppManager and PgSQLAppManager to use single-line formatting for consistency and improved readability.
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.
Code Review
This pull request introduces support for webhooks and enable_watchlist_events fields in the DynamoDB, MySQL, and PostgreSQL app managers. The changes are well-implemented, including schema migrations and updates to serialization/deserialization logic. The use of #[sqlx(json)] to simplify data handling in the MySQL and PostgreSQL managers is a nice improvement. My main feedback is focused on reducing code duplication in the database migration logic for both MySQL and PostgreSQL, for which I've provided suggestions to improve maintainability.
Introduces comprehensive integration tests for PgSQLAppManager, covering webhooks serialization, multiple webhooks, watchlist events, allowed origins, update and cache behavior, retrieval by key, health checks, error handling for non-existent apps, null/empty values, and Lambda webhook configuration. Also derives PartialEq for Webhook, WebhookFilter, WebhookHeaders, and LambdaConfig to facilitate test assertions.
Updated the `webhooks` and `allowed_origins` fields in both MySQL and PostgreSQL AppRow structs to use `#[sqlx(json(nullable))]`. This change clarifies that these JSON fields can be null in the database, improving compatibility and correctness with SQLx.
This commit adds a PostgreSQL test service to docker-compose.test.yml and a database initialization script for testing. The CI workflow is updated to wait for the PostgreSQL test instance and set relevant environment variables. PostgreSQL-related tests in pg_app_manager.rs are refactored to use a helper for test database configuration and are now enabled by default, improving test coverage and automation.
|
/gemini review |
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.
Code Review
This pull request effectively introduces support for webhooks and enable_watchlist_events across the DynamoDB, MySQL, and PostgreSQL app managers. The changes are well-structured, including schema migrations, serialization/deserialization logic, and updates to data mapping. The addition of a PostgreSQL test container and a comprehensive suite of integration tests for it is a significant improvement to the project's test coverage. The refactoring of schema migration logic in the SQL-based managers is also a welcome enhancement. I have one suggestion for the MySQL manager to improve the robustness of its error handling during migrations.
Extended both MySQLAppManager and PgSQLAppManager to support storing and updating 'webhooks' and 'allowed_origins' fields as JSON in the database. This change updates the relevant SQL queries and binding logic to handle these new fields.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
I will review it |
|
/gemini review |
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.
Code Review
This pull request effectively adds support for webhooks and enable_watchlist_events across the DynamoDB, MySQL, and PostgreSQL app managers. The changes include necessary schema migrations, robust serialization/deserialization logic, and an excellent suite of new tests for the PostgreSQL implementation. My feedback includes a suggestion to prevent silent data loss in the DynamoDB manager by handling serialization errors more strictly, a minor refactoring in the MySQL manager to simplify error handling, and a recommendation to improve test hygiene in the new PostgreSQL tests by cleaning up created tables. Overall, this is a high-quality contribution that thoughtfully extends the application's features.
In DynamoDbAppManager, serialization errors for webhooks now panic instead of logging a warning, indicating a bug. In MySQLAppManager, duplicate column errors are detected using the error code rather than downcasting, improving reliability.
|
@countradooku done. Please review |
Introduces support for the
webhooksandenable_watchlist_eventsfields in DynamoDB, MySQL, and PostgreSQL app managers. This includes schema migrations, serialization/deserialization, and mapping to the App struct, enabling storage and retrieval of webhook configurations and watchlist event toggles.Description
Type of Change
Testing
Checklist
Build Artifacts
Additional Notes