Skip to content

[New routing] Admin countries crud#18235

Merged
NoResponseMate merged 1 commit intoSylius:new-routingfrom
loic425:admin-country-crud
Jul 18, 2025
Merged

[New routing] Admin countries crud#18235
NoResponseMate merged 1 commit intoSylius:new-routingfrom
loic425:admin-country-crud

Conversation

@loic425
Copy link
Copy Markdown
Member

@loic425 loic425 commented Jul 18, 2025

Q A
Branch? new-routing
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets partially #18212
License MIT

Summary by CodeRabbit

  • New Features

    • Introduced fine-grained control over admin route compatibility layers, allowing global and per-route enablement or disablement.
    • Added new resource configurations for catalog promotions, countries, and products in the admin interface, supporting advanced CRUD and bulk operations.
    • Implemented a custom request context to manage compatibility layer routing.
  • Bug Fixes

    • Improved route matching logic in admin page resolution.
  • Chores

    • Updated dependencies to require newer development versions of resource packages.
  • Tests

    • Added and updated tests to cover new routing configuration options and request context behaviors.
    • Adjusted test cases for redirect path formatting.

@loic425 loic425 requested review from a team as code owners July 18, 2025 09:15
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jul 18, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update introduces a backward compatibility (BC) routing layer with global and per-route enablement, adds new resource metadata configurations for admin resources, and updates dependency constraints to allow development versions of the Sylius resource packages. Additional tests and service definitions support the new routing logic and configuration.

Changes

File(s) Change Summary
composer.json, src/Sylius/Component//composer.json, src/Sylius/Bundle//composer.json Updated "sylius/resource" and/or "sylius/resource-bundle" version constraints from ^1.12 to ^1.14@dev.
config/packages/_sylius.yaml Added BC routing layer configuration, per-route overrides, and resource mapping imports.
config/routes/sylius_resource.yaml Added new service-based route loader for Sylius resources.
src/Sylius/Bundle/AdminBundle/Resources/config/app/sylius/resources/catalog_promotion.php Added resource metadata for catalog promotion with CRUD and bulk delete operations.
src/Sylius/Bundle/AdminBundle/Resources/config/app/sylius/resources/country.php Added resource metadata for country resource with CRUD operations.
src/Sylius/Bundle/AdminBundle/Resources/config/app/sylius/resources/product.php Added resource metadata for product resource with multiple CRUD and custom operations.
src/Sylius/Bundle/AdminBundle/Resources/config/routing/catalog_promotion.yaml Added a condition for BC routing layer to the catalog promotion route.
src/Sylius/Bundle/AdminBundle/Resources/config/routing/country.yml Added a condition for BC routing layer to the country route.
src/Sylius/Bundle/AdminBundle/Resources/config/routing/product.yml Added a condition for BC routing layer to product-related routes.
src/Sylius/Behat/Service/Resolver/CurrentPageResolver.php Expanded route name matching to include prefixed underscores.
src/Sylius/Behat/tests/Service/Resolver/CurrentPageResolverTest.php Adjusted expected mock method call counts for route name retrieval.
src/Sylius/Bundle/CoreBundle/DependencyInjection/Configuration.php Added configuration nodes for BC routing layer and per-route enablement.
src/Sylius/Bundle/CoreBundle/DependencyInjection/SyliusCoreExtension.php Sets new container parameter for BC routing configuration.
src/Sylius/Bundle/CoreBundle/Resources/config/services.xml Added a service definition to decorate the router request context for BC layer logic.
src/Sylius/Bundle/CoreBundle/Routing/RequestContext.php Introduced a new final class to manage BC routing layer enablement logic.
src/Sylius/Bundle/CoreBundle/tests/DependencyInjection/ConfigurationTest.php Added tests for BC routing layer configuration defaults and overrides.
src/Sylius/Bundle/CoreBundle/tests/Routing/RequestContextTest.php Added tests for the new RequestContext class and BC routing layer logic.
tests/Twig/RedirectPathExtensionTest.php Updated test paths and assertions to remove trailing slashes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SymfonyRouter
    participant SyliusRequestContext
    participant Controller

    User->>SymfonyRouter: Requests admin route (e.g., /admin/product)
    SymfonyRouter->>SyliusRequestContext: Check if BC layer enabled for route
    SyliusRequestContext->>SyliusRequestContext: isSyliusRoutingBcLayerEnabled('admin_product')
    SyliusRequestContext-->>SymfonyRouter: Returns true/false
    alt BC layer enabled
        SymfonyRouter->>Controller: Route handled via legacy/BC logic
    else BC layer disabled
        SymfonyRouter->>Controller: Route handled via new resource metadata logic
    end
Loading

Suggested labels

Admin

Suggested reviewers

  • GSadee

Poem

In burrows deep, where configs dwell,
The routes now choose their path so well.
With BC layers toggled true or not,
And shiny resources freshly got.
Dependencies leap to versions new—
This rabbit hops and thanks the crew! 🐇✨


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.

@loic425 loic425 changed the base branch from 2.1 to new-routing July 18, 2025 09:15
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 18, 2025

❌ Preview Environment deleted from Bunnyshell

Available commands:

  • 🚀 /bns:deploy to redeploy the environment

@loic425 loic425 changed the title Admin country crud [New routing] Admin countries crud Jul 18, 2025
@loic425 loic425 force-pushed the admin-country-crud branch from 5912d6f to 7a2fe93 Compare July 18, 2025 12:16
@NoResponseMate NoResponseMate merged commit 170b60d into Sylius:new-routing Jul 18, 2025
27 of 31 checks passed
@loic425 loic425 deleted the admin-country-crud branch July 18, 2025 12:58
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