Skip to content
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

Add missing changed InventoryBundle service to UPGRADE-2.0 #17595

Merged
merged 2 commits into from
Jan 3, 2025
Merged

Conversation

diimpp
Copy link
Member

@diimpp diimpp commented Dec 23, 2024

Q A
Branch? 2.0
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets
License MIT

Service sylius.availability_checker is no longer exists in sylius 2.0, but service renaming is not mentioned at UPGRADE-2.0 file.

1.14
https://github.com/Sylius/SyliusInventoryBundle/blob/ee67e934c5dcb739329220f6385ee19462e67c36/DependencyInjection/SyliusInventoryExtension.php#L33

Error message is specific to my project, but nevertheless.

In CheckExceptionOnInvalidReferenceBehaviorPass.php line 116:
                                                                                                               
  The service "Sylius\Bundle\ApiBundle\Serializer\ProductVariantNormalizer" has a dependency on a non-existen  
  t service "sylius.availability_checker". 

Summary by CodeRabbit

  • New Features

    • Enhanced customization capabilities with the introduction of new left and right sections in Twig hooks.
    • Modernized frontend components by transitioning to Bootstrap and removing jQuery.
  • Improvements

    • Simplified language selection by removing language flags.
    • Streamlined migration process by consolidating previous migration files.
    • Updated routing configurations with new resource paths and modified prefixes.
  • Deprecations

    • Dropped support for Symfony 5.4; now supports Symfony 6.4 and 7.1.
  • Bug Fixes

    • Addressed various constructor signature changes for improved type definitions.

@diimpp diimpp requested review from a team as code owners December 23, 2024 22:50
@probot-autolabeler probot-autolabeler bot added the Maintenance CI configurations, READMEs, releases, etc. label Dec 23, 2024
Copy link

coderabbitai bot commented Dec 23, 2024

Walkthrough

The pull request details a comprehensive upgrade of the Sylius framework from version 2.0.2 to 2.0.3. It includes the addition of left and right sections to Twig hooks, removal of language flags, and significant updates to configurations in the config/packages directory. The migration process has been simplified, and the minimum supported PHP version is now 8.2, with support for Symfony 6.4 and 7.1. Numerous constructor signatures have been updated, emphasizing explicit type definitions and service encapsulation.

Changes

File/Path Change Summary
Twig Extensions Multiple constructor signatures updated, removing helper/legacy interfaces and consolidating type definitions
Admin Controllers Refined constructor signatures, removing nullable dependencies
Core Components Updated method signatures in factories, processors, and calculators
Form Types Removed nullable type hints and standardized constructor parameters
Configuration Files New imports and resource definitions added, existing configurations modified or removed
API Firewalls Renamed API firewalls, explicit configuration for user checkers
Routing Configurations Updated resource paths and prefix changes

Suggested labels

Admin

Suggested reviewers

  • NoResponseMate

Possibly related PRs

Poem

🐰 Hop, hop, upgrade we go!
Code refactored, clean and neat
Sylius 2.0.3 takes the stage
Nullable types now obsolete
A framework's dance of pure delight! 🚀


🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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.

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 (4)
UPGRADE-2.0.md (4)

1931-1932: Fix the table formatting issue.

The table in the InventoryBundle section is missing proper column alignment and has inconsistent cell counts.

-| **InventoryBundle**                                                                                                 |     
-| `sylius.availability_checker`                                                                                       | `sylius.checker.inventory.availability`                                                             |
+| **InventoryBundle**                                                                                                 |                                                                                                     |
+| `sylius.availability_checker`                                                                                       | `sylius.checker.inventory.availability`                                                             |
🧰 Tools
🪛 Markdownlint (0.37.0)

1931-1931: Expected: 2; Actual: 1; Too few cells, row will be missing data
Table column count

(MD056, table-column-count)


Line range hint 1-24: Critical upgrade information: Initial setup requirements.

This section outlines essential initial changes needed before running the application. Pay special attention to:

  • Package configuration changes in _sylius.yaml
  • Security firewall renames and user checker configurations
  • Routing changes for shop and API

Ensure all these changes are applied before attempting to run the application, as they are foundational for Sylius 2.0 functionality.

🧰 Tools
🪛 Markdownlint (0.37.0)

1931-1931: Expected: 2; Actual: 1; Too few cells, row will be missing data
Table column count

(MD056, table-column-count)


Line range hint 328-395: Critical architectural change: Frontend modernization.

Major frontend changes that require attention:

  1. Removal of jQuery in favor of SymfonyUX with Stimulus
  2. Transition from SemanticUI to Bootstrap
  3. Replacement of partial routes with Twig components
  4. Introduction of Sylius Twig Hooks system

Consider these steps for a smooth transition:

  1. Delete the node_modules directory and reinstall packages
  2. Update Node.js to version 20 or 22
  3. Review and update any custom JavaScript code to work with Stimulus
  4. Update CSS classes from SemanticUI to Bootstrap equivalents
🧰 Tools
🪛 Markdownlint (0.37.0)

1931-1931: Expected: 2; Actual: 1; Too few cells, row will be missing data
Table column count

(MD056, table-column-count)


Line range hint 396-677: Critical service changes: Service renaming and reorganization.

Extensive service renaming has occurred. Key points:

  1. Many services have been moved to more appropriate bundles
  2. Service visibility is now private by default
  3. New naming conventions have been implemented for better clarity

Action items:

  1. Update all service references in your custom code
  2. Review service visibility requirements and make necessary adjustments
  3. Update dependency injection configurations to use new service IDs
🧰 Tools
🪛 Markdownlint (0.37.0)

1931-1931: Expected: 2; Actual: 1; Too few cells, row will be missing data
Table column count

(MD056, table-column-count)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between dd339a5 and b6850f9.

📒 Files selected for processing (1)
  • UPGRADE-2.0.md (1 hunks)
🧰 Additional context used
🪛 Markdownlint (0.37.0)
UPGRADE-2.0.md

1931-1931: Expected: 2; Actual: 1; Too few cells, row will be missing data
Table column count

(MD056, table-column-count)

UPGRADE-2.0.md Outdated Show resolved Hide resolved
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

🧹 Nitpick comments (1)
UPGRADE-2.0.md (1)

Line range hint 1-24: Major architectural improvements that require careful migration planning

The upgrade introduces several significant architectural changes that improve maintainability and modernize the framework:

  1. API Bundle reorganization:

    • Normalizers and Denormalizers have been moved to dedicated subdirectories
    • Better organization of Filters and Query extensions by context (admin/shop/common)
  2. Frontend modernization:

    • Removal of jQuery dependency
    • Migration from SemanticUI to Bootstrap
    • Introduction of SymfonyUX with Stimulus
  3. Template system evolution:

    • Replacement of Sonata Blocks with Twig Hooks
    • More organized and maintainable template structure
    • Better separation of admin and shop contexts

These changes will require careful planning for migration, particularly:

  1. Review all custom API extensions for compatibility with the new structure
  2. Update frontend code to work without jQuery
  3. Migrate any custom template events to the new Twig Hooks system
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b6850f9 and 9a50131.

📒 Files selected for processing (1)
  • UPGRADE-2.0.md (1 hunks)

@@ -1929,6 +1929,7 @@ and maintainability of the application and also follows Symfony's best practices
| `sylius.currency_converter` | `sylius.converter.currency` |
| `sylius.currency_name_converter` | `sylius.converter.currency_name` |
| **InventoryBundle** | |
| `sylius.availability_checker` | `sylius.checker.inventory.availability` |
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Critical service rename that addresses the PR objective

This line documents the rename of sylius.availability_checker to sylius.checker.inventory.availability, which directly addresses the PR's main objective. This change explains why the service "Sylius\Bundle\ApiBundle\Serializer\ProductVariantNormalizer" was failing to find the non-existent sylius.availability_checker service.

The service has been reorganized to follow the new naming convention:

  • Old: sylius.availability_checker
  • New: sylius.checker.inventory.availability

Make sure to update all references to this service in your codebase, particularly in the ProductVariantNormalizer and any other services that might depend on it.

@mpysiak mpysiak merged commit a6f9587 into 2.0 Jan 3, 2025
25 checks passed
@mpysiak mpysiak deleted the diimpp-patch-1 branch January 3, 2025 05:28
@coderabbitai coderabbitai bot mentioned this pull request Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance CI configurations, READMEs, releases, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants