Skip to content

Conversation

norkunas
Copy link
Collaborator

@norkunas norkunas commented Oct 18, 2025

Pull Request

Related issue

Fixes #399

What does this PR do?

  • Adds support for doctrine bundle v3

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Summary by CodeRabbit

Release Notes

  • Chores
    • Extended Doctrine bundle compatibility to support versions 2.x and 3.x
    • Expanded integration test coverage across multiple PHP and Symfony version combinations

@norkunas norkunas added the enhancement New feature or request label Oct 18, 2025
Copy link

coderabbitai bot commented Oct 18, 2025

Warning

Rate limit exceeded

@norkunas has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 32 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 6957c77 and 51f442c.

📒 Files selected for processing (10)
  • .github/workflows/tests.yml (4 hunks)
  • .php-cs-fixer.dist.php (1 hunks)
  • composer.json (1 hunks)
  • tests/Kernel.php (2 hunks)
  • tests/baseline-ignore (1 hunks)
  • tests/config/doctrine.yaml (1 hunks)
  • tests/config/doctrine_old_proxy.yaml (0 hunks)
  • tests/config/doctrine_php7.yaml (0 hunks)
  • tests/config/doctrine_v2.yaml (0 hunks)
  • tests/config/framework.yaml (1 hunks)

Walkthrough

Added Doctrine Bundle v3 support while maintaining v2 compatibility. Updated composer.json constraint to allow both versions. Refactored test configuration to detect and load version-specific configs dynamically. Expanded CI matrix to test multiple PHP and Symfony versions with different dependency constraints.

Changes

Cohort / File(s) Summary
CI Configuration
.github/workflows/tests.yml
Adds four matrix configurations for integration tests covering PHP 7.4/8.4 with Symfony 5.4/7.3 and both lowest and highest dependencies. Replaces hard-coded dependency version with dynamic matrix variable.
Dependency Management
composer.json
Updates doctrine/doctrine-bundle constraint from ^2.10 to ^2.10 || ^3.0 to allow both v2 and v3 releases.
Version Detection & Config Loading
tests/Kernel.php
Implements runtime Doctrine version detection via BlacklistSchemaAssetFilter class check. Refactors configuration loading paths based on version and PHP version, introducing conditional logic for v2 vs v3 configurations and PHP 7 fallbacks.
Doctrine v2 Configuration
tests/config/config_doctrine_v2.yaml
New file defining Doctrine v2-specific ORM settings including enable_native_lazy_objects, auto_generate_proxy_classes, and report_fields_where_declared.
Shared Framework Configuration
tests/config/framework.yaml
New file extracting shared framework test configuration (test, secret, http_method_override).
Configuration Refactoring
tests/config/config.yaml, tests/config/config_old_proxy.yaml, tests/config/doctrine_php7.yaml
Removes Doctrine-specific ORM options and framework blocks from these configs, delegating them to version-specific and framework files.

Sequence Diagram(s)

sequenceDiagram
    participant Kernel as Kernel.php
    participant ClassLoader as PHP Runtime
    participant ConfigLoader as Config Loader
    
    Kernel->>ClassLoader: Check if BlacklistSchemaAssetFilter exists
    ClassLoader-->>Kernel: class_exists result
    
    alt Doctrine v3 Active (class does not exist)
        Kernel->>ConfigLoader: Load framework.yaml
        Kernel->>ConfigLoader: Load config.yaml
    else Doctrine v2 (class exists)
        Kernel->>ConfigLoader: Load framework.yaml
        alt PHP 8+ with LegacyReflectionFields
            Kernel->>ConfigLoader: Load config_doctrine_v2.yaml
        else PHP 8+ or PHP 7
            Kernel->>ConfigLoader: Load config_old_proxy.yaml or doctrine_php7.yaml
        end
    end
    
    ConfigLoader-->>Kernel: Configuration loaded
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Doctrine dances in two versions now,
V2 and V3 take a bow!
Configuration splits with care and grace,
Version detection finds its place,
Backward compatible, tested with might,
The bundle hops forward, shining bright!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "Add support for doctrine bundle v3" directly and accurately reflects the main objective of the changeset. The changes across all modified files—including the composer.json constraint update, version detection logic in tests/Kernel.php, reorganized configuration files to support both Doctrine v2 and v3, and updated CI workflow—all work together to implement this single, clear goal. The title is concise, specific, and would allow a teammate scanning the history to immediately understand that this PR adds compatibility with DoctrineBundle v3.
Linked Issues Check ✅ Passed The PR successfully addresses the stated objective from issue #399 to add support for DoctrineBundle v3. The implementation includes updating the composer.json dependency constraint to allow both 2.x and 3.x versions (^2.10 || ^3.0), adding runtime version detection in tests/Kernel.php via the BlacklistSchemaAssetFilter class check, reorganizing test configuration files to support both versions with version-specific configurations, and updating the CI workflow to test multiple combinations. All coding-related requirements for supporting Doctrine v3 are met through these coordinated changes.
Out of Scope Changes Check ✅ Passed All changes in this PR are directly related to adding support for DoctrineBundle v3. The modifications include updating the dependency constraint, implementing version detection, reorganizing test configuration files to support both v2 and v3, and updating the CI workflow for comprehensive testing. Each change serves the core objective either by enabling v3 compatibility, maintaining v2 support, or ensuring proper testing of both versions. No unrelated code changes or features outside the scope of Doctrine v3 support are present.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@norkunas norkunas force-pushed the doctrinebundlev3 branch 2 times, most recently from 0a4e91a to 9c4efad Compare October 18, 2025 20:23
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 752afde and 6957c77.

📒 Files selected for processing (8)
  • .github/workflows/tests.yml (2 hunks)
  • composer.json (1 hunks)
  • tests/Kernel.php (2 hunks)
  • tests/config/config.yaml (0 hunks)
  • tests/config/config_doctrine_v2.yaml (1 hunks)
  • tests/config/config_old_proxy.yaml (0 hunks)
  • tests/config/doctrine_php7.yaml (0 hunks)
  • tests/config/framework.yaml (1 hunks)
💤 Files with no reviewable changes (3)
  • tests/config/doctrine_php7.yaml
  • tests/config/config_old_proxy.yaml
  • tests/config/config.yaml
🧰 Additional context used
🧬 Code graph analysis (1)
tests/Kernel.php (1)
src/DependencyInjection/MeilisearchExtension.php (1)
  • load (19-64)
🪛 actionlint (1.7.8)
.github/workflows/tests.yml

101-101: property "dependencies" is not defined in object type {deps: string; php-version: number; sf-version: number}

(expression)

🔇 Additional comments (8)
tests/config/framework.yaml (1)

1-4: LGTM!

Standard framework configuration for test environment. The settings are appropriate for integration tests.

tests/config/config_doctrine_v2.yaml (1)

1-22: LGTM! Doctrine v2-specific configuration is well-structured.

The configuration correctly isolates v2-specific ORM options (enable_native_lazy_objects, report_fields_where_declared) that are not available or have different semantics in v3.

tests/Kernel.php (4)

11-11: LGTM! Appropriate version detection strategy.

Using BlacklistSchemaAssetFilter as a version marker is a pragmatic approach since this class was removed in DoctrineBundle v3.


33-33: LGTM! Framework config externalized correctly.

Loading framework configuration from a separate file improves maintainability and aligns with the version-specific config strategy.


35-44: LGTM! Version-aware config loading is well-structured.

The conditional logic correctly handles:

  • DoctrineBundle v3 (loads config.yaml)
  • DoctrineBundle v2 with PHP 8.4+ and LegacyReflectionFields (loads config_doctrine_v2.yaml)
  • Older setups (loads config_old_proxy.yaml)

46-53: LGTM! PHP 7 compatibility handled appropriately.

The PHP 7 branch correctly configures annotations and loads the PHP 7-specific Doctrine config.

composer.json (1)

23-23: The constraint is correct—no changes needed.

The ^2.10 || ^3.0 constraint properly handles version resolution across supported PHP versions. DoctrineBundle v2.10 requires PHP ^7.4 or ^8.0, covering all versions your package supports. DoctrineBundle v3 requires PHP ^8.4, so Composer will:

  • Install v2.x on PHP 7.4-8.3 (where v3 is unavailable)
  • Install v3.x on PHP 8.4+ (where both are available)

This is appropriate package design that supports multiple dependency versions across different PHP versions.

.github/workflows/tests.yml (1)

101-101: No action required—default behavior is safe and correct.

The ramsey/composer-install action defaults to "locked" when dependency-versions is empty, installing locked versions equivalent to running composer install. This is the intended behavior for matrix entries without an explicit dependencies property, and no verification or code changes are needed.

Likely an incorrect or invalid review comment.

@norkunas norkunas force-pushed the doctrinebundlev3 branch 6 times, most recently from be47be4 to 2db723c Compare October 18, 2025 20:40
Copy link

codecov bot commented Oct 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.40%. Comparing base (e479bc2) to head (2db723c).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #400   +/-   ##
=========================================
  Coverage     88.40%   88.40%           
  Complexity        1        1           
=========================================
  Files            20       20           
  Lines           888      888           
=========================================
  Hits            785      785           
  Misses          103      103           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@norkunas norkunas force-pushed the doctrinebundlev3 branch 4 times, most recently from 8229d43 to ae0b546 Compare October 18, 2025 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for doctrine bundle v3

1 participant