Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@itsbalamurali
Copy link
Contributor

@itsbalamurali itsbalamurali commented Oct 31, 2025

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.

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring

Testing

  • Unit tests pass
  • Integration tests pass
  • Manual testing completed

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Build Artifacts

Additional Notes

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.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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

  • Extended App Configuration: The core App struct now supports two new fields: webhooks to store webhook configurations and enable_watchlist_events to toggle watchlist event functionality.
  • Database Schema Migrations: Schema migrations have been introduced for MySQL and PostgreSQL to add the webhooks and enable_watchlist_events columns to the respective apps tables, ensuring data persistence for these new features.
  • Cross-Database Support: Full serialization and deserialization logic has been implemented across DynamoDB, MySQL, and PostgreSQL app managers, allowing seamless storage and retrieval of the new webhooks and enable_watchlist_events data.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Updated warn! macro calls in MySQLAppManager and PgSQLAppManager to use single-line formatting for consistency and improved readability.
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.
@itsbalamurali
Copy link
Contributor Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

itsbalamurali and others added 4 commits October 31, 2025 12:46
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>
@countradooku
Copy link
Collaborator

I will review it

@itsbalamurali
Copy link
Contributor Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.
@itsbalamurali
Copy link
Contributor Author

@countradooku done. Please review

@countradooku countradooku merged commit 5f96ddd into RustNSparks:master Nov 5, 2025
3 of 4 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.

2 participants