Skip to content

Conversation

@Chris53897
Copy link
Contributor

@Chris53897 Chris53897 commented Nov 1, 2025

a try to fix the ci

Update: in conflict with https://github.com/meilisearch/meilisearch-symfony/pull/400/files#diff-78e2fc2f8d5a200028050f0fd3c14c23db81669e7816ad567c98aaa7a1044371R55

Summary by CodeRabbit

  • Tests
    • Made a compatibility flag conditional so it’s applied only when the environment supports the compatibility layer.
    • Removed the unconditional enabling of the old ORM reporting flag from legacy test configurations to align test behavior with modern runtimes.

@coderabbitai
Copy link

coderabbitai bot commented Nov 1, 2025

Walkthrough

Replaces unconditional insertion of report_fields_where_declared: true into Doctrine ORM config with a DoctrineBundle 2.x compatibility guard in tests/Kernel.php: the flag is now prepended only when the Doctrine Annotations infrastructure (AnnotationReader) is present. The YAML files remove the flag.

Changes

Cohort / File(s) Summary
Doctrine compatibility guard
tests/Kernel.php
Replaces unconditional injection of report_fields_where_declared => true with a conditional branch that prepends the flag only when the Doctrine annotations class (e.g., AnnotationReader) exists, preserving validate_xml_mapping behaviour in the original branch.
YAML configuration cleanup
tests/config/config.yaml, tests/config/config_old_proxy.yaml
Removes the report_fields_where_declared: true setting from Doctrine ORM YAML configurations.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Kernel
  participant Runtime as "PHP runtime (class_exists)"
  participant Config as "Doctrine ORM config"

  Note over Kernel,Runtime: Kernel prepares Doctrine ORM config during test bootstrap

  Kernel->>Runtime: class_exists('Doctrine\\Common\\Annotations\\AnnotationReader')?
  alt AnnotationReader exists
    Kernel-->>Config: prepend report_fields_where_declared: true
    Note right of Config: Flag applied (Doctrine 2.x compatibility path)
  else AnnotationReader missing
    Kernel-->>Config: do not set report_fields_where_declared
    Note right of Config: YAML files no longer include the flag
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review conditional (class_exists) correctness and exact class name/namespace used.
  • Verify that preserving validate_xml_mapping behavior is intentional across branches.
  • Confirm tests cover both annotation-present and annotation-absent scenarios.

Possibly related PRs

Suggested reviewers

  • curquiza

Poem

🐰 I nudged a flag from YAML to code,
Peeked for AnnotationReader down the road,
If it's there I say "hello, set it true",
If not, I leave the config through and through,
A hop, a tweak, now tests know what to do.

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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main changes: fixing ORM configuration for report_fields_where_declared compatibility, which is clearly reflected in all three modified files.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eda3c1f and e04b970.

📒 Files selected for processing (1)
  • tests/Kernel.php (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/Kernel.php

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.

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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 31db2b2 and eda3c1f.

📒 Files selected for processing (1)
  • tests/Kernel.php (1 hunks)

@codecov
Copy link

codecov bot commented Nov 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.38%. Comparing base (09f62a7) to head (e04b970).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #405   +/-   ##
=========================================
  Coverage     88.38%   88.38%           
  Complexity        1        1           
=========================================
  Files            20       20           
  Lines           878      878           
=========================================
  Hits            776      776           
  Misses          102      102           

☔ 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.

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