-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Update mutation workflow to support PostgreSQL with docker setup.
#69
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
Conversation
|
Warning Rate limit exceeded@terabytesoftw has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 3 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughThe mutation test workflow was updated to run tests using a PostgreSQL 16 Docker container instead of SQLite, including adding required PHP extensions and environment variables. A new PHPUnit mutation test class for PostgreSQL was added to verify correct nested set tree traversal ordering. No public API changes were made. Changes
Possibly related PRs
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #69 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 134 134
===========================================
Files 4 4
Lines 525 525
===========================================
Hits 525 525 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (3)
.github/workflows/mutation.yml (3)
26-38: Add automatic container cleanup to avoid resource leaks & port clashes
docker run -dleaves thepostgres-testcontainer hanging around for the lifetime of the runner.
Adding--rm(and optionally a--name-less run) ensures the container is removed when stopped, preventing:• needless disk/memory usage on the runner
• port-5432 collisions when the step is re-executed (matrix / reruns)- docker run -d \ + docker run -d --rm \You could also wrap a
docker stop postgres-testin apostsection if the wrapper workflow supports it.
26-38: Consider using the built-inservices:feature instead of a manualdocker runGitHub Actions already supports service containers with automatic startup, health-checking and teardown:
services: postgres: image: postgres:16 env: POSTGRES_DB: yiitest POSTGRES_USER: root POSTGRES_PASSWORD: root ports: - 5432:5432This shrinks the
hook, removes manual polling, and guarantees clean disposal of the container.
48-50: Minor: quote DSN to guard against future special characters
$GITHUB_ENVallows unquoted strings today, but quoting shields against accidental newlines or#comments down the road:-echo "DB_DSN=pgsql:host=localhost;port=5432;dbname=yiitest" >> $GITHUB_ENV +echo 'DB_DSN=pgsql:host=localhost;port=5432;dbname=yiitest' >> $GITHUB_ENV
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/mutation.yml(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: terabytesoftw
PR: yii2-extensions/nested-sets-behavior#66
File: migrations/m250707_103609_tree.php:0-0
Timestamp: 2025-07-07T12:38:55.434Z
Learning: In the yii2-extensions/nested-sets-behavior project, terabytesoftw prefers application-level validation through the NestedSetsBehavior class rather than database-level constraints for nested set integrity. The migrations are meant to be flexible examples since developers may create their own tables.
Learnt from: terabytesoftw
PR: yii2-extensions/nested-sets-behavior#13
File: src/NestedSetsBehavior.php:145-145
Timestamp: 2025-06-29T11:22:41.889Z
Learning: The user terabytesoftw prefers to keep PRs focused and small, implementing enhancements in separate dedicated PRs rather than bundling multiple changes together.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
- GitHub Check: phpunit-compatibility / PHP 8.2-windows-latest
- GitHub Check: phpunit-compatibility / PHP 8.1-windows-latest
- GitHub Check: phpunit-compatibility / PHP 8.2-ubuntu-latest
- GitHub Check: phpunit-compatibility / PHP 8.1-ubuntu-latest
- GitHub Check: phpunit / PHP 8.2-ubuntu-latest
- GitHub Check: phpunit / PHP 8.3-windows-latest
- GitHub Check: phpunit / PHP 8.2-windows-latest
- GitHub Check: phpunit / PHP 8.1-windows-latest
- GitHub Check: PostgreSQL tests. / PHP 8.4-pgsql-15
- GitHub Check: PostgreSQL tests. / PHP 8.4-pgsql-16
- GitHub Check: PostgreSQL tests. / PHP 8.4-pgsql-17
- GitHub Check: Oracle tests. / PHP 8.4-oci-23
- GitHub Check: MySQL tests. / PHP 8.4-mysql-latest
- GitHub Check: MySQL tests. / PHP 8.4-mysql-8.0
- GitHub Check: SQL Server tests. / PHP 8.4-mssql-2022-latest
- GitHub Check: phpunit-compatibility / PHP 8.2-windows-latest
- GitHub Check: phpunit / PHP 8.4-windows-latest
- GitHub Check: Oracle tests. / PHP 8.4-oci-23
- GitHub Check: SQL Server tests. / PHP 8.4-mssql-2022-latest
🔇 Additional comments (1)
.github/workflows/mutation.yml (1)
24-25: 👍 Correct extension & PHPUnit group switchEnabling
pdo_pgsqland targeting thepgsqltest group is exactly what the job needs for PostgreSQL-backed tests.
…eout` is set in infection configuration.
… timeout setting from infection configuration.
…amework options and add MutationTest for tree traversal validation.
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
tests/pgsql/MutationTest.php (1)
13-16: Consider using environment variables for database configuration.The database connection parameters are hardcoded, which may conflict with the environment variables (
DB_DSN,DB_USERNAME,DB_PASSWORD) set up in the workflow. Additionally, the DSN has a trailing semicolon which is unnecessary.- protected string $driverName = 'pgsql'; - protected string|null $dsn = 'pgsql:host=localhost;dbname=yiitest;port=5432;'; - protected string $password = 'root'; - protected string $username = 'root'; + protected string $driverName = 'pgsql'; + protected string|null $dsn = 'pgsql:host=localhost;dbname=yiitest;port=5432'; + protected string $password = 'root'; + protected string $username = 'root';Consider leveraging environment variables or the parent TestCase configuration if available to make the tests more flexible across different environments.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/mutation.yml(1 hunks)tests/pgsql/MutationTest.php(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/mutation.yml
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: terabytesoftw
PR: yii2-extensions/nested-sets-behavior#66
File: migrations/m250707_103609_tree.php:0-0
Timestamp: 2025-07-07T12:38:55.434Z
Learning: In the yii2-extensions/nested-sets-behavior project, terabytesoftw prefers application-level validation through the NestedSetsBehavior class rather than database-level constraints for nested set integrity. The migrations are meant to be flexible examples since developers may create their own tables.
Learnt from: terabytesoftw
PR: yii2-extensions/nested-sets-behavior#13
File: src/NestedSetsBehavior.php:145-145
Timestamp: 2025-06-29T11:22:41.889Z
Learning: The user terabytesoftw prefers to keep PRs focused and small, implementing enhancements in separate dedicated PRs rather than bundling multiple changes together.
tests/pgsql/MutationTest.php (1)
Learnt from: terabytesoftw
PR: yii2-extensions/nested-sets-behavior#66
File: migrations/m250707_103609_tree.php:0-0
Timestamp: 2025-07-07T12:38:55.434Z
Learning: In the yii2-extensions/nested-sets-behavior project, terabytesoftw prefers application-level validation through the NestedSetsBehavior class rather than database-level constraints for nested set integrity. The migrations are meant to be flexible examples since developers may create their own tables.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (18)
- GitHub Check: phpunit-compatibility / PHP 8.1-windows-latest
- GitHub Check: phpunit-compatibility / PHP 8.4-ubuntu-latest
- GitHub Check: PostgreSQL tests. / PHP 8.4-pgsql-17
- GitHub Check: mutation / PHP 8.4-ubuntu-latest
- GitHub Check: PostgreSQL tests. / PHP 8.4-pgsql-16
- GitHub Check: PostgreSQL tests. / PHP 8.4-pgsql-15
- GitHub Check: MySQL tests. / PHP 8.4-mysql-8.0
- GitHub Check: MySQL tests. / PHP 8.4-mysql-8.4
- GitHub Check: MySQL tests. / PHP 8.4-mysql-latest
- GitHub Check: SQL Server tests. / PHP 8.4-mssql-2022-latest
- GitHub Check: PostgreSQL tests. / PHP 8.4-pgsql-16
- GitHub Check: PostgreSQL tests. / PHP 8.4-pgsql-15
- GitHub Check: SQL Server tests. / PHP 8.4-mssql-2022-latest
- GitHub Check: mutation / PHP 8.4-ubuntu-latest
- GitHub Check: phpunit-compatibility / PHP 8.1-windows-latest
- GitHub Check: phpunit / PHP 8.4-windows-latest
- GitHub Check: Oracle tests. / PHP 8.4-oci-23
- GitHub Check: phpunit / PHP 8.2-windows-latest
🔇 Additional comments (2)
tests/pgsql/MutationTest.php (2)
10-11: LGTM! Well-structured test class setup.The PHPUnit Group attribute and class declaration are properly configured for mutation testing with PostgreSQL.
18-37: Excellent test design for nested set ordering verification.The test effectively validates that the
children()method returns nodes in the correct nested set order (based onlftvalues) rather than insertion order. The test structure is well-designed:
- Creates children in a deliberately different order than expected
- Applies specific
lft/rgtvalues to establish proper nested set positioning- Verifies the traversal returns nodes in the correct order
This ensures the nested set ordering logic works correctly with PostgreSQL, which aligns with the mutation testing objectives.
Summary by CodeRabbit