[PR #529] [MERGED] refactor: separate CI tests, and support pg bouncer #562

Closed
opened 2026-02-16 01:16:20 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-plugin-daemon/pull/529
Author: @Yeuoly
Created: 12/10/2025
Status: Merged
Merged: 12/17/2025
Merged by: @Yeuoly

Base: mainHead: feat/support-pg-bouncer


📝 Commits (8)

  • 5794bf2 feat: add support for PgBouncer in database initialization
  • 3b1e974 Merge branch 'main' into feat/support-pg-bouncer
  • b95b347 refactor: consolidate gorm configuration for database connection
  • d82e03a Add MySQL and multi-driver DB integration tests (#535)
  • ec1b284 feat: streamline integration tests by using a centralized docker-compose file
  • 3cbfbb3 fix: add timeout
  • 0dba402 refactor: replace inline service definitions with docker-compose action for integration tests
  • f649aa5 fix: update pgbouncer image and environment variable names for consistency

📊 Changes

16 files changed (+426 additions, -303 deletions)

View changed files

.github/workflows/claude.yml (+0 -64)
.github/workflows/tests-db-integration.yml (+50 -0)
.github/workflows/tests-plugin-integration.yml (+50 -0)
.github/workflows/tests-unit.yml (+48 -0)
.github/workflows/tests.yml (+0 -70)
integration/db/db_executor_integration_test.go (+127 -0)
integration/db/db_init_integration_test.go (+61 -0)
integration/docker/docker-compose.ci.yml (+64 -0)
📝 integration/plugin/agent_integration_test.go (+0 -0)
📝 integration/plugin/testdata/invoke_agent_strategy_json.json (+0 -0)
📝 integration/plugin/testdata/langgenius-agent_0.0.14.difypkg (+0 -0)
internal/db/executor_test.go (+0 -113)
📝 internal/db/init.go (+4 -1)
internal/db/init_test.go (+0 -38)
📝 internal/db/pg/pg.go (+19 -15)
📝 internal/types/app/config.go (+3 -2)

📄 Description

Description

This PR improves database compatibility and CI coverage:

  • Adds PgBouncer support as a database type (DB_TYPE_PG_BOUNCER) and adjusts PostgreSQL initialization to better work with PgBouncer (notably disabling GORM prepared statements under PgBouncer/transaction pooling).
  • Adds multi-driver database integration tests covering PostgreSQL, PgBouncer, and MySQL.
  • Refactors CI workflows by splitting unit vs integration tests, and centralizing service dependencies in a Compose file.

Closes #542

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Performance improvement
  • Other

Essential Checklist

Testing

  • I have tested the changes locally and confirmed they work as expected
  • I have added unit tests where necessary and they pass successfully

Bug Fix (if applicable)

  • I have used GitHub syntax to close the related issue (e.g., Fixes #123 or Closes #123)

Additional Information

  • DB-related changes: internal/db/init.go, internal/db/pg/pg.go, internal/types/app/config.go.
  • New DB integration tests: integration/db/*.
  • CI changes: split workflows and service startup via integration/docker/docker-compose.ci.yml.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify-plugin-daemon/pull/529 **Author:** [@Yeuoly](https://github.com/Yeuoly) **Created:** 12/10/2025 **Status:** ✅ Merged **Merged:** 12/17/2025 **Merged by:** [@Yeuoly](https://github.com/Yeuoly) **Base:** `main` ← **Head:** `feat/support-pg-bouncer` --- ### 📝 Commits (8) - [`5794bf2`](https://github.com/langgenius/dify-plugin-daemon/commit/5794bf2f962e2562cd7d4e5655772fda40b838c4) feat: add support for PgBouncer in database initialization - [`3b1e974`](https://github.com/langgenius/dify-plugin-daemon/commit/3b1e974d7aca227eb3c0f6fc765ef3de1bae673a) Merge branch 'main' into feat/support-pg-bouncer - [`b95b347`](https://github.com/langgenius/dify-plugin-daemon/commit/b95b347660361ed12e3c2bc98ae434d62391ae25) refactor: consolidate gorm configuration for database connection - [`d82e03a`](https://github.com/langgenius/dify-plugin-daemon/commit/d82e03ac9d7bf009b463f134963f3f04c80a3c9c) Add MySQL and multi-driver DB integration tests (#535) - [`ec1b284`](https://github.com/langgenius/dify-plugin-daemon/commit/ec1b2840740de48df1252431ac3e7398278c05ec) feat: streamline integration tests by using a centralized docker-compose file - [`3cbfbb3`](https://github.com/langgenius/dify-plugin-daemon/commit/3cbfbb30b5d7f2bea0830dbd27bcd0e98fcf14e5) fix: add timeout - [`0dba402`](https://github.com/langgenius/dify-plugin-daemon/commit/0dba4026885fc6dc3a867532834ec1b26bf6b310) refactor: replace inline service definitions with docker-compose action for integration tests - [`f649aa5`](https://github.com/langgenius/dify-plugin-daemon/commit/f649aa517c055aadcf8e1c0760e7a5b7f3104adc) fix: update pgbouncer image and environment variable names for consistency ### 📊 Changes **16 files changed** (+426 additions, -303 deletions) <details> <summary>View changed files</summary> ➖ `.github/workflows/claude.yml` (+0 -64) ➕ `.github/workflows/tests-db-integration.yml` (+50 -0) ➕ `.github/workflows/tests-plugin-integration.yml` (+50 -0) ➕ `.github/workflows/tests-unit.yml` (+48 -0) ➖ `.github/workflows/tests.yml` (+0 -70) ➕ `integration/db/db_executor_integration_test.go` (+127 -0) ➕ `integration/db/db_init_integration_test.go` (+61 -0) ➕ `integration/docker/docker-compose.ci.yml` (+64 -0) 📝 `integration/plugin/agent_integration_test.go` (+0 -0) 📝 `integration/plugin/testdata/invoke_agent_strategy_json.json` (+0 -0) 📝 `integration/plugin/testdata/langgenius-agent_0.0.14.difypkg` (+0 -0) ➖ `internal/db/executor_test.go` (+0 -113) 📝 `internal/db/init.go` (+4 -1) ➖ `internal/db/init_test.go` (+0 -38) 📝 `internal/db/pg/pg.go` (+19 -15) 📝 `internal/types/app/config.go` (+3 -2) </details> ### 📄 Description ## Description This PR improves database compatibility and CI coverage: - Adds **PgBouncer** support as a database type (`DB_TYPE_PG_BOUNCER`) and adjusts PostgreSQL initialization to better work with PgBouncer (notably disabling GORM prepared statements under PgBouncer/transaction pooling). - Adds **multi-driver database integration tests** covering PostgreSQL, PgBouncer, and MySQL. - Refactors CI workflows by splitting unit vs integration tests, and centralizing service dependencies in a Compose file. Closes #542 ## Type of Change - [ ] Bug fix - [x] New feature - [x] Refactor - [ ] Performance improvement - [x] Other ## Essential Checklist ### Testing - [ ] I have tested the changes locally and confirmed they work as expected - [ ] I have added unit tests where necessary and they pass successfully ### Bug Fix (if applicable) - [ ] I have used GitHub syntax to close the related issue (e.g., `Fixes #123` or `Closes #123`) ## Additional Information - DB-related changes: `internal/db/init.go`, `internal/db/pg/pg.go`, `internal/types/app/config.go`. - New DB integration tests: `integration/db/*`. - CI changes: split workflows and service startup via `integration/docker/docker-compose.ci.yml`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 01:16:20 -05:00
yindo closed this issue 2026-02-16 01:16:20 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-daemon#562