Skip to content

Conversation

@GSadee
Copy link
Member

@GSadee GSadee commented May 12, 2025

Q A
Branch? 2.1
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Related tickets partially #17837
License MIT

Summary by CodeRabbit

  • Chores

    • Removed PHPSpec-related configuration files and dependencies from multiple bundles.
    • Updated test autoloading and namespace structure for improved consistency.
    • Adjusted static analysis and test discovery settings to include additional test directories and exclude certain test paths.
  • Refactor

    • Renamed test namespaces and updated related import statements for better alignment with new directory structure.

@GSadee GSadee added DX Issues and PRs aimed at improving Developer eXperience. Maintenance CI configurations, READMEs, releases, etc. labels May 12, 2025
@coderabbitai
Copy link

coderabbitai bot commented May 12, 2025

Walkthrough

This update removes PHPSpec dependencies and configuration files from several bundles, consolidates and updates test autoloading namespaces, and adjusts PHPUnit configuration to include additional test directories. It also modifies test class namespaces and import paths to align with the new test directory structure. No production code or public API changes are introduced.

Changes

File(s) Change Summary
phpstan.neon.dist Added exclusion for **/Bundle/*/tests/**.php to static analysis ignore list.
src/Sylius/Bundle/CurrencyBundle/composer.json
src/Sylius/Bundle/CustomerBundle/composer.json
src/Sylius/Bundle/TaxonomyBundle/composer.json
Removed phpspec/phpspec from require-dev. Updated or removed test autoloading namespaces as appropriate.
src/Sylius/Bundle/CurrencyBundle/phpspec.yml.dist
src/Sylius/Bundle/CustomerBundle/phpspec.yml.dist
src/Sylius/Bundle/TaxonomyBundle/phpspec.yml.dist
Deleted PHPSpec configuration files, removing PHPSpec test suite definitions.
src/Sylius/Bundle/CurrencyBundle/phpunit.xml.dist Added ./tests/ directory to PHPUnit test suite configuration.
src/Sylius/Bundle/CurrencyBundle/tests/DependencyInjection/SyliusCurrencyExtensionTest.php Updated namespace and import to match new test directory structure.
src/Sylius/Bundle/CurrencyBundle/tests/Stub/CurrencyContextStub.php Changed namespace to align with new test organization.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant Composer
    participant PHPUnit
    participant Project

    Developer->>Composer: Remove PHPSpec dependency
    Developer->>Project: Update test namespaces and directories
    Developer->>PHPUnit: Run tests (now from ./test/ and ./tests/)
    PHPUnit->>Project: Discover and execute tests
Loading

Possibly related PRs

Suggested labels

Dependencies

Poem

A hop, a skip, a test suite trimmed,
PHPSpec’s old hat, its light now dimmed.
Namespaces tidy, autoloads neat,
PHPUnit welcomes new tests to greet.
With every change, the garden grows—
CodeRabbit smiles as order shows!
🐇✨

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@GSadee GSadee mentioned this pull request May 12, 2025
41 tasks
@GSadee GSadee force-pushed the SYL-4849-remove-phpspec-dependency-and-config branch from 72f93e2 to a905be2 Compare May 12, 2025 11:51
@github-actions
Copy link

github-actions bot commented May 12, 2025

❌ Preview Environment deleted from Bunnyshell

Available commands:

  • 🚀 /bns:deploy to redeploy the environment

@GSadee GSadee force-pushed the SYL-4849-remove-phpspec-dependency-and-config branch from a905be2 to defbc11 Compare May 12, 2025 11:57
@GSadee GSadee force-pushed the SYL-4849-remove-phpspec-dependency-and-config branch from 2f42b8a to ec56db0 Compare May 13, 2025 04:39
@GSadee GSadee marked this pull request as ready for review May 13, 2025 05:25
@GSadee GSadee requested review from a team as code owners May 13, 2025 05:25
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: 0

🧹 Nitpick comments (1)
src/Sylius/Bundle/CurrencyBundle/phpunit.xml.dist (1)

13-14: Consider removing legacy test/ directory mapping
If the old test/ directory is no longer in use, removing <directory>./test/</directory> will reduce confusion and speed up test discovery.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 62082aa and ec56db0.

📒 Files selected for processing (10)
  • phpstan.neon.dist (1 hunks)
  • src/Sylius/Bundle/CurrencyBundle/composer.json (1 hunks)
  • src/Sylius/Bundle/CurrencyBundle/phpspec.yml.dist (0 hunks)
  • src/Sylius/Bundle/CurrencyBundle/phpunit.xml.dist (1 hunks)
  • src/Sylius/Bundle/CurrencyBundle/tests/DependencyInjection/SyliusCurrencyExtensionTest.php (1 hunks)
  • src/Sylius/Bundle/CurrencyBundle/tests/Stub/CurrencyContextStub.php (1 hunks)
  • src/Sylius/Bundle/CustomerBundle/composer.json (0 hunks)
  • src/Sylius/Bundle/CustomerBundle/phpspec.yml.dist (0 hunks)
  • src/Sylius/Bundle/TaxonomyBundle/composer.json (0 hunks)
  • src/Sylius/Bundle/TaxonomyBundle/phpspec.yml.dist (0 hunks)
💤 Files with no reviewable changes (5)
  • src/Sylius/Bundle/CustomerBundle/phpspec.yml.dist
  • src/Sylius/Bundle/TaxonomyBundle/composer.json
  • src/Sylius/Bundle/TaxonomyBundle/phpspec.yml.dist
  • src/Sylius/Bundle/CurrencyBundle/phpspec.yml.dist
  • src/Sylius/Bundle/CustomerBundle/composer.json
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/Sylius/Bundle/CurrencyBundle/tests/DependencyInjection/SyliusCurrencyExtensionTest.php (1)
src/Sylius/Bundle/CurrencyBundle/tests/Stub/CurrencyContextStub.php (1)
  • AsCurrencyContext (19-26)
🔇 Additional comments (7)
src/Sylius/Bundle/CurrencyBundle/tests/Stub/CurrencyContextStub.php (1)

14-14: Aligns with PSR-4 autoload mapping
Namespace updated to Tests\Sylius\Bundle\CurrencyBundle\Stub matches the autoload-dev PSR-4 configuration in composer.json.

src/Sylius/Bundle/CurrencyBundle/phpunit.xml.dist (1)

13-15: Include new tests/ directory for PHPUnit
Adding <directory>./tests/</directory> ensures PHPUnit discovers tests in the consolidated tests/ folder.

phpstan.neon.dist (1)

19-19: Exclude new tests/ path from analysis
The pattern **/Bundle/*/tests/**.php correctly extends PHPStan exclusions to the consolidated test directory.

src/Sylius/Bundle/CurrencyBundle/composer.json (2)

67-67: Consolidate test PSR-4 autoloading
Mapping "Tests\\Sylius\\Bundle\\CurrencyBundle\\": "tests/" simplifies the dev autoload section by unifying specs and tests under one namespace.


69-71:

Details

✅ Verification successful

Verify classmap path for AppKernel
The classmap entry still points to test/app/AppKernel.php, but the directory may have been migrated to tests/app. Please confirm the file’s location or update this path accordingly.

Run:


🏁 Script executed:

#!/bin/bash
# Ensure AppKernel is found in the expected location
if [ -f test/app/AppKernel.php ]; then
  echo "Legacy AppKernel path found"
elif [ -f tests/app/AppKernel.php ]; then
  echo "AppKernel moved to tests/app/AppKernel.php – please update classmap"
else
  echo "AppKernel.php not found in test/app or tests/app"
  exit 1
fi

Length of output: 188


🏁 Script executed:

#!/bin/bash
# Locate AppKernel.php anywhere in the repository
echo "Searching for AppKernel.php in the repo..."
find . -type f -iname "AppKernel.php"

Length of output: 1230


classmap path for AppKernel is correct
The test/app/AppKernel.php file exists at src/Sylius/Bundle/CurrencyBundle/test/app/AppKernel.php, so the classmap entry in composer.json does not need updating.

src/Sylius/Bundle/CurrencyBundle/tests/DependencyInjection/SyliusCurrencyExtensionTest.php (2)

14-14: Align test namespace with PSR-4 mapping
Updated namespace to Tests\Sylius\Bundle\CurrencyBundle\DependencyInjection to match the autoload-dev configuration.


21-21: Update CurrencyContextStub import path
Adjusted import to Tests\Sylius\Bundle\CurrencyBundle\Stub\CurrencyContextStub, consistent with the stub’s new namespace.

Copy link
Contributor

Choose a reason for hiding this comment

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

PHPUnit schema location can be changed to the local vendor in order to avoid changing it for each updated version.

@GSadee GSadee merged commit 1f2dd79 into Sylius:2.1 May 15, 2025
69 of 71 checks passed
@GSadee GSadee deleted the SYL-4849-remove-phpspec-dependency-and-config branch May 15, 2025 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DX Issues and PRs aimed at improving Developer eXperience. Maintenance CI configurations, READMEs, releases, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants