A place where Magento architectural discussions happen

Overview

This repository is created by initiative of Magento architects to discuss with the Magento community any open questions around Magento 2 architecture such as design documents, proposals, or any other architectural artifacts.


NOTE: We do not guarantee that approved changes will be delivered into Magento code base. The purpose of the repository is to start open discussions with the Magento community around architectural concepts of the Magento 2 platform.


Documents in the Repository

New documents are processed through PRs targeting the master branch. As a result, the master branch must contain content approved by Magento architects only.

The Workflow

  1. Fork the repository and add or edit a document in your branch. Contributions are expected from Magento core engineers mostly, although the community members are able to contribute as well.
  2. Create a PR with the new or updated document to discuss
    1. Use Design Document template for a new document
  3. Share the PR with internal team(s) and the Magento community through existing channels (Twitter, Slack, blog post, etc)
    1. Suggestion: include deadline for receiving feedback
  4. Get a feedback. We expect a feedback as:
    1. Comments into the PR thread
    2. Likes/dislikes/other emojis to the comments or the PR itself. We kindly encourage contributors to submit explanations about pros and cons that they have noticed.
  5. Update the PR to the received feedback accordingly or submit a reply if the proposed changes are not applicable with clear explanation.
    1. Add needs update label while the PR is in work
  6. When all participants of the discussion have come to agreement and confirmed their approval, a Magento core architect merges the PR.

Design Documents Review Requirements

  • Required reviewers are architects assigned to the affected components
  • Anybody else may join the review and provide feedback, but they're not obligated to review the entire document or to meet deadlines
  • For existing (running or about to run) projects, a minimum time frame given for one round of review is 2 business days from the notification notice. The author may specify due date. For documents that do not block any existing projects (proposals or design documents that describe features for unforeseeable future), no due date is guaranteed.

Assigned Reviewer Responsibilities

  • Review the entire document by specified due date (if any)
    • If it is impossible, find a replacement
    • If the due date is unreasonable for the size of the document, agree on another due date with the author
  • Include a detailed feedback
    • Ensure the feedback is objective
    • Ensure the feedback provides value to the document. Avoid side-notes and off-topics (or mention explicitly that this is just a note for future)
    • If the document is rejected, include clear and objective explanation for it. Rejection is final

The implementation process is out of scope in this project.

After approval of the document, a new discussion may be raised basing on the issues occurred during implementation. It is also possible in case of new informational updates that discover hidden sides of the future implementation. If it is the case, a new PR should be opened to update existing document. The PR should include explained reasons for the proposed change.

Comments
  • Domain Whitelist for Configurable 3rd Party Redirects

    Domain Whitelist for Configurable 3rd Party Redirects

    Problem

    Given an implementation where Magento acts as a headless server, there are cases where Magento should accept redirect URLs from the client. These URLs should be validated in some way to prevent an open redirect vulnerability.

    Solution

    Introduce a new configuration where a list of trusted redirect domains can be specified. Implement a class top validate redirect URLs against this whitelist.

    Requested Reviewers

    @paliarush @joni-jones @AlexMaxHorkun

    proposal 
    opened by danielrenaud 29
  • Proposal: Deprecate Fotorama

    Proposal: Deprecate Fotorama

    Status (1/4/19): This proposal is still in an active state, but is currently held up on some other priorities. Before this can be closed out and worked, a new library with a comparable feature set needs to be decided on.

    Rendered Proposal

    I'd like to hear from Partners, SIs, and anyone else working on front-end for Magento stores on a day-to-day basis. I'd imagine there are some common slider/gallery libs in use - would love to hear suggestions.

    open discussion 
    opened by DrewML 27
  • Simplified module declaration

    Simplified module declaration

    The document describes changes to module registration and management implemented in scope of "Lighter application" POC for Service Isolation project.

    Clarification: the proposal does not discuss the removal of app/code folder or ability to keep project-specific code in the project folder.

    services isolation 
    opened by antonkril 22
  • Content Security Policies

    Content Security Policies

    Problem

    CSP not implemented in Magento

    Solution

    Implement CSP in Magento in a backward compatible way and allow extension developers to configure it

    Requested Reviewers

    @joni-jones @paliarush @melnikovi

    opened by AlexMaxHorkun 21
  • PWA-2110: [GraphQL] check_inventory parameter and redundant collectQuoteTotals() call (2.4.4)

    PWA-2110: [GraphQL] check_inventory parameter and redundant collectQuoteTotals() call (2.4.4)

    Problem

    PWA-2110: [GraphQL] check_inventory parameter and redundant collectQuoteTotals() call (2.4.4) Need to port changes from PWA-2098 to 2.4.4 and add automated tests and proper doc comments for the new optional parameter.

    Solution

    Add optional parameter "check_inventory" to GraphQL resolvers to override "Check inventory on cart load" admin setting

    Notes

    There are changes in this pull request that may not seem directly related to the check_inventory parameter. These changes are to provide more complete type definitions that had not been included in the architecture repo. In several cases, entirely new schema files were also added for this reason.

    GraphQL 
    opened by cspruiell 18
  • Magento Coding Standard Versioning Strategy

    Magento Coding Standard Versioning Strategy

    Problem

    The is no document that describes Magento Coding Standard versioning.

    Solution

    The proposal describes rules that need to be followed when making new Magento Coding Standard release.

    Requested Reviewers

    @buskamuza @paliarush @melnikovi

    opened by lenaorobei 18
  • [GraphQL] Customer Orders API

    [GraphQL] Customer Orders API

    Problem

    The current GraphQL customer orders API has limited functionality and is inconsistent with the Magento Luma theme.

    Solution

    Introduce changes in customer orders API with better customizability and extensibility while supporting the same set of data provided for Luma theme.

    Requested Reviewers

    @paliarush @akaplya

    opened by joni-jones 15
  • Login as customer

    Login as customer

    Requriements As a developer, I want to create a flexible login as a customer schema that can be added to the graph so a merchant or merchant admin can log into an end customer's account to assist them with their account.

    Additional Changes

    • Improved file structure of GraphQL-related proposals.
    • Updated repository's README.md
    GraphQL 
    opened by paliarush 14
  • Dependabot integration

    Dependabot integration

    Investigate a possibility to integrate Depenabot with Magento infrastructure.

    • Check PR creation to update composer dependencies
    • POC Dependabot notifications into the slack channel
    opened by joni-jones 14
  • Propose renaming id_v2 to something more permanent, and change type

    Propose renaming id_v2 to something more permanent, and change type

    This (if approved) impacts an in-flight PR: https://github.com/magento/magento2/pull/28210

    These changes are based on discussions I've had with @prabhuram93 and @nrkapoor.

    There were a few concerns I wanted to address:

    1. We should be using the ID type for IDs, because we don't want clients using them for anything but lookups. Mentioned in a separate design document

    2. The document mentioned that id_v2 was a temporary field until we start using UUIDs. If we use the ID type, though, we shouldn't need a temporary field. If a client deploys a new version of the GraphQL API (after we switch from base64 >> uuid) and a client has cache entries for the old IDs, those old entries just won't be looked up in the client-side cache anymore. No loss/corruption should happen

      I believe this matches the vision for every entity to have a globally unique ID, but with less downstream changes for clients. Please correct me if I'm wrong!

    3. @nrkapoor and I discussed various names for the field. I've gone with uid in the PR, but happy to change if we can reach consensus on a different name. Here's the names we discussed:

      • uuid: Bad because UUID is a specific encoding algorithm, and a client should not care about that
      • gid: "Global Identifier"
      • uid: "Unique Identifier"
      • _id: Just kind of ugly
      • identifier: Verbose, but accurate

    Note: It's worth knowing that popular GraphQL client libraries (Apollo/urql) have default cache configurations that look for the field name id or _id on Object Types. Whatever new field we choose, we should be consistent going forward, as each headless solution will now need to customize their client to use this new cache key. See https://www.apollographql.com/docs/react/caching/cache-configuration/#custom-identifiers

    GraphQL 
    opened by DrewML 13
  • Added replace or merge option for addRequisitionListItemToCart mutation

    Added replace or merge option for addRequisitionListItemToCart mutation

    Problem

    Whenever we add requisition list items to cart if the cart has items we have an option to replace or merge the requisition list items with the existing cart items. We don't have the option in the addRequisitionListItemToCart mutation.

    Solution

    Added a seperate parameter ( is_replace ) to the addRequisitionListItemToCart mutation.

    Requested Reviewers

    @nrkapoor @paliarush

    partners-contribution Partner: Zilker Technology GraphQL 
    opened by saravanansp96 13
  • Updated purchase order graphql schema

    Updated purchase order graphql schema

    Updated purchase order graphql schema

    • Split into separate purchase-order and purchase-order-rule schemas per module
    • Added created_at and updated_at fileds to PurchaseOrder
    • Added addPurchaseOrderItemsToCart mutation:q
    opened by sivaschenko 4
  • Introduce an alternative way to define fixtures using PHP8 Attributes

    Introduce an alternative way to define fixtures using PHP8 Attributes

    Problem

    Recently, we introduced parameterized fixture for integration and api-functional test that accepts parameters directly from @magentoDataFixture annotation.

    We enhanced @magentoDataFixture annotation format to support additional information that contains the parameters and the alias of a fixture. And we introduced a new annotation @magentoDataFixtureDataProvider for advanced fixture configuration.

    However, with the current implementation, fixture parameters have to be passed in JSON format which is hard to read and maintain. PHP 8.0 introduced a new feature (Attributes) that we can utilize to generate fixtures instead of DocBlock annotations which will enable us to use PHP build in syntax and increase the code readability.

    Example

    class AddSimpleProductToCartSingleMutationTest extends GraphQlAbstract
    {
        /**
         * @magentoApiDataFixture Magento\Catalog\Test\Fixture\Product as:product1
         * @magentoApiDataFixture Magento\Catalog\Test\Fixture\Product as:product2
         * @magentoApiDataFixture Magento\Catalog\Test\Fixture\Product as:product3
         * @magentoApiDataFixture Magento\Quote\Test\Fixture\GuestCart as:cart
         * @magentoApiDataFixture Magento\Quote\Test\Fixture\AddProductToCart as:cartItem1
         * @magentoApiDataFixture Magento\Quote\Test\Fixture\AddProductToCart as:cartItem2
         * @magentoDataFixtureDataProvider {"cartItem1":{"cart_id":"$cart.id$","product_id":"$product1.id$","qty":1}}
         * @magentoDataFixtureDataProvider {"cartItem2":{"cart_id":"$cart.id$","product_id":"$product2.id$","qty":1}}
         */
        public function testAddMultipleProductsToNotEmptyCart(): void
        {
            $product1 = $this->fixtures->get('product1');
            $product2 = $this->fixtures->get('product2');
            $product3 = $this->fixtures->get('product3');
            $cart = $this->fixtures->get('cart');
            //...
        }
    }
    

    Solution

    PHP 8.0 introduced a new feature (Attributes) that we can utilize to generate fixtures instead of DocBlock annotations.

    Implementation

    Create PHP attribute equivalent for all existing DocBlock annotations used in integration and functional tests

    • @magentoAppIsolation -> AppIsolation
    • @magentoDbIsolation -> DbIsolation
    • @magentoDataFixtureBeforeTransaction ->DataFixtureBeforeTransaction
    • @magentoDataFixture -> DataFixture (1)
    • @magentoApiDataFixture -> DataFixture (1)
    • @magentoIndexerDimensionMode-> IndexerDimensionMode
    • @magentoComponentsDir -> ComponentsDir
    • @magentoAppArea -> AppArea
    • @magentoCache -> Cache
    • @magentoAdminConfigFixture -> Config (2)
    • @magentoConfigFixture -> Config (2)

    (1) Both magentoDataFixture and magentoApiDataFixture can be replaced with DataFixture attribute. Currently we use magentoDataFixture in integration tests and magentoApiDataFixture in functional api tests (WebAPI). Both executes data fixtures except that magentoApiDataFixture does not trigger db transaction (db isolation) by default (without explicitly enabling db isolation with @magentoDbIsolation) whereas magentoDataFixture does.

    All it takes to make this work is to replace \Magento\TestFramework\Annotation\DataFixture with \Magento\TestFramework\Annotation\ApiDataFixture in WebapiDocBlock and override \Magento\TestFramework\Annotation\AbstractDataFixture::getDbIsolationState in \Magento\TestFramework\Annotation\ApiDataFixture (ApiDataFixture extends DataFixture which also extends AbstractDataFixture) to return [disabled] instead of NULL in case the db isolation is not explicitly defined. This will prevent the transaction from auto starting in \Magento\TestFramework\Annotation\DataFixture::startTestTransactionRequest unless explicitly enabled with @magentoDbIsolation.

    (2) Both magentoAdminConfigFixture and magentoConfigFixture can be replaced with Config attribute.

    Example:

    namespace Magento\TestFramework\Fixture;
    
    use Attribute;
    
    #[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)]
    class DataFixture
    {
        /**
         * @param string $type
         * @param array $data
         * @param string|null $as
         */
        public function __construct(
            public string $type,
            public array $data = [],
            public ?string $as = null
        ) {
        }
    }
    
    #[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)]
    class Config
    {
        /**
         * @param string $path
         * @param mixed $value
         * @param string $scopeType
         * @param string|null $scopeValue
         */
        public function __construct(
            public string $path,
            public mixed $value,
            public string $scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
            public ?string $scopeValue = null
        ) {
        }
    }
    
    class AddSimpleProductToCartSingleMutationTest extends GraphQlAbstract
    {
        #[
            Config(Configuration::XML_PATH_SHOW_OUT_OF_STOCK, 1, ScopeInterface::SCOPE_STORE, 'default'),
            DataFixture(ProductFixture::class, as: 'product1'),
            DataFixture(ProductFixture::class, as: 'product2'),
            DataFixture(ProductFixture::class, as: 'product3'),
            DataFixture(GuestCartFixture::class, as: 'cart'),
            DataFixture(AddProductToCartFixture::class, ['cart_id' => '$cart.id$', 'product_id' => '$product1.id$']),
            DataFixture(AddProductToCartFixture::class, ['cart_id' => '$cart.id$', 'product_id' => '$product2.id$']),
        ]
        public function testAddMultipleProductsToNotEmptyCart(): void
        {
            $product1 = $this->fixtures->get('product1');
            $product2 = $this->fixtures->get('product2');
            $product3 = $this->fixtures->get('product3');
            $cart = $this->fixtures->get('cart');
            //...
        }
    }
    

    Pros

    • Best time to make such changes as Parameterized Fixture is not released yet
    • Fixture classes can be imported and referenced using constant (Fixture::class)
    • PHP Native syntax
    • Easy to maintain and extend

    Cons

    • Require PHP >= 8.0 to run tests

    Thumbs up 👍 if you like this proposal

    opened by bubasuma 2
  • Port Architecture for module Development so Can use both inbuild custom feature development as well external integration

    Port Architecture for module Development so Can use both inbuild custom feature development as well external integration

    Problem

    we have various integration so need different module to add functionality and we have some functionality inbuilt so Need to create single module to add all possible integration domain wise like Reviews, Product Management , Carriers, Payment, Order, etc/

    Example: Customer need some third party review services from external source like google or trustpilot so need custom module to integrate & API Adapter to compatible with existing review system in-built.

    • Existing system doesn't support for DDD by use-case. As every customer have different use-case for same features/functionality

    Solution

    Main focus is to change module structure to ports architecture so module is more testable by use-case & domain oriented so we can use single module to add all possible integration for payment OR shipping in plug-n-play manner.

    • testable by use-case( can be test like unit test )
    • DDD (domain driven development)
    • Adapter test
    • Loosely couple

    Requested Reviewers

    opened by lalittmohan 0
  • ConfigurableWishlistItem.child_sku throws an internal error if customer wishlist has un-configured configurable product

    ConfigurableWishlistItem.child_sku throws an internal error if customer wishlist has un-configured configurable product

    Problem

    ACP2E-267: GraphQl - Issues with add Configurable product to Wishlist

    [2022-01-27T01:13:07.037742+00:00] report.ERROR: Call to a member function getProduct() on null
    
    GraphQL (20:13)
    19:           ... on ConfigurableWishlistItem  {
    20:             child_sku
                    ^
    21:             customizable_options {
    

    Solution

    Deprecate ConfigurableWishlistItem.child_sku and add a new field ConfigurableWishlistItem.configured_variant that returns child product details (ProductInterface) or NULL if the child product is not configured

    Requested Reviewers

    @cpartica

    opened by bubasuma 0
  • When will magento be microservice based?

    When will magento be microservice based?

    I have developed monolith for 10 years, the architecture becomes very hard to understand, no matther how many effort we put into the arhitecture design, I am wondering when and whether Magento will be microservice based? I see a picture Architectural diagrams, it looks like the magento is alreay microservices, apparently it is not. I am very loooking forward to this architecture, so I asked a question here.

    image

    opened by vidyli 1
Owner
Magento
Magento
A simple place to learn XSS

XSSPlayground A simple place to learn XSS. Made for myself to learn and to help others (please do use!) Disclaimer This is a works in progress and wil

ac1d 23 Jun 21, 2022
This is the official place where Nemesysco's LVA7 and QA7 dockers will be hosted and maintained

LVA-Dockers This is the official place where Nemesysco's LVA7 and QA7 dockers will be hosted and maintained - It is still under construction! We are w

null 2 Feb 17, 2022
A simple plugin to display a block name that player break or place in popup!

?? • Block Popup Version Status Date 1.0.0 stable-alpha 12/10/2022 ?? • General: Plugin Introduction: This is a simple plugin to add the function to d

HenryDM 3 Nov 2, 2022
This Kirby V3 Plugin brings snippets and blueprints together in one place. It includes useful tools that completely changing the way you work with Kirby: Fast and well organized.

Kirby Components Overview Do you love to make awesome projects with Kirby CMS? Do you also find it difficult to switch between snippets and blueprints

Roman Gsponer 6 May 31, 2023
A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2

Simple Import / Export tool A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2. Table data

EcomDev B.V. 51 Dec 5, 2022
This Magento 2 extension integrates EasyTranslate into Magento 2.

EasyTranslate Magento 2 Connector This Magento 2 extension integrates EasyTranslate into Magento 2. Mind that you need to have an account with EasyTra

Easytranslate ApS 0 Oct 7, 2022
Magento-Functions - A Resource of Magento Functions

Magento-Functions A Resource of Magento Functions Table of Contents Category Product User Cart Checkout General Account [Working w/ URL's] (#urls) Cat

Bryan Littlefield 28 Apr 19, 2021
Magento - Magento Community Editions

Magento Community Edition /// THIS REPOSITORY IS DEPREACTED /// 1.9.4.1 will be the last version update. Please switch over to OpenMage! Either to the

FireGento e. V. 107 Oct 17, 2022
Magento-Vagrant-Puppet-Nginx - Installs magento and a nginx server

Magento-Vagrant-Puppet-Nginx Installs Magento MySQL PHP PHP-FPM Nginx n98-magerun Setup git submodule init git submodule update vagrant up Modify pupp

Christian Münch 61 Aug 10, 2022
Docker-magento - Docker image for Magento 1.6 to 1.9

Docker image for Magento 1.x This repo creates a Docker image for Magento 1.x. Please note The primary goal of this repo is to create Docker images fo

Fu Cheng 144 Nov 18, 2022
Magento-composer-installer - Composer installer for Magento modules

!!! support the maintainer of this project via Patreon: https://www.patreon.com/Flyingmana Magento Composer Installer The purpose of this project is t

null 213 Sep 24, 2022
Chef-magento - Installs and Configures a Magento project

Description Requirements Chef 0.10.0 or higher required (for Chef environment use). Platform Debian, Ubuntu CentOS, Red Hat, Fedora Your basebox must

Inviqa 3 Jun 30, 2020
Cookbook-magento - Collection of recipes to build app stack for the Magento deployments with Chef

Magento Cookbook Collection of recipes to build app stack for the Magento deployments with Chef Installation With Berkshelf echo "cookbook 'magento',

Yevhen Viktorov 37 Sep 26, 2020
Magento-bulk - Bulk Import/Export helper scripts and CLI utilities for Magento Commerce

Magento Bulk Bulk operations for Magento. Configuration Copy config.php.sample to config.php and edit it. Product Attribute Management List All Attrib

Bippo Indonesia 23 Dec 20, 2022
Phpcs-magento-rules - A set of PHPCS rules used by made.com when hacking Magento

Made.com PHPCS Magento Rules A set of PHPCS rules used by made.com when hacking Magento. Pre-Requisites PHPCS Installation Short Version Clone this re

Made.com Tech Team 26 Jun 3, 2020
This Magento extension provides a Real Full Page Caching for Magento powered by Varnish with support of Session-Based information caching (Cart, Customer Accounts, ...) via ESI includes

This Magento extension provides a Real Full Page Caching (FPC) for Magento powered by Varnish with support of Session-Based information caching (Cart, Customer Accounts, ...) via ESI includes

Hugues Alary 95 Feb 11, 2022
Automatically load the next page of products in Magento. Easy to install and configure, this module works 100% out of the box with vanilla Magento 1.9.x and earlier.

Automatically load the next page of products in Magento. Easy to install and configure, this module works 100% out of the box with vanilla Magento 1.9.x and earlier.

Strategery 123 Nov 20, 2021