Skip to content

Commit 0182b9d

Browse files
author
Oleksandr Gorkun
committed
Merge branch 'master' of https://github.com/magento/architecture into my-promises
2 parents 7fa6e00 + d075c0e commit 0182b9d

10 files changed

+326
-36
lines changed

.github/ISSUE_TEMPLATE/custom.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
name: Custom issue template
33
about: Just an empty template for any kind of issue
4+
title: ''
5+
labels: ''
6+
assignees: ''
47

58
---
69

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
---
22
name: Meeting Notes
33
about: Topic requests and meeting notes from meetings
4+
title: ''
5+
labels: meeting notes
6+
assignees: ''
47

58
---
69

710
_Please add your topic as a comment to the issue. Use following format:_
811
Topic description and link to PR, if any (duration in min)
912

10-
## Meeting Notes
11-
12-
* _note one..._
13-
1413
Recording: TBD

design-documents/cookies.md

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,30 @@ Original document: https://docs.magento.com/m2/ce/user_guide/stores/cookie-refer
55
The goal of this document is to align cookies existing in Magento to features relying on them, so a customer may choose to disable a feature and not populate a specific cookie.
66

77

8-
| Cookie | Module |
9-
| ------- | -------- |
10-
| `guest-view` | `Magento_Sales` |
11-
| `login_redirect` | `Magento_Customer`, `Magento_Checkout` |
12-
| `mage-messages` | `Magento_Theme` |
13-
| `mage-translation-storage` | `Magento_Translation` |
14-
| `mage-translation-file-version` | `Magento_Translation`. Description: Tracks version of translations in local storage. |
15-
| `product_data_storage` | `Magento_Catalog` |
16-
| `recently_compared_product` | `Magento_Catalog` |
17-
| `recently_compared_product_previous` | `Magento_Catalog` |
18-
| `recently_viewed_product` | `Magento_Catalog` |
19-
| `recently_viewed_product_previous` | `Magento_Catalog` |
20-
| `stf` | `Magento_SendFriend` |
21-
| `X-Magento-Vary` (note: original document has typo) | `Magento_PageCache` |
22-
| `amz_auth_err` | Amazon Pay CBE |
23-
| `amz_auth_logout` | Amazon Pay CBE |
24-
| `form_key` | Multiple modules. Any module that has forms should use it. |
25-
| `mage-cache-sessid` | `Magento_Customer`, `Magento_Persistent` |
26-
| `mage-cache-storage` | `Magento_Customer`, `Magento_Persistent`, `Magento_NegotiableQuote` |
27-
| `mage-cache-storage-section-invalidation` | `Magento_Customer` |
28-
| `persistent_shopping_cart` | `Magento_Persistent` |
29-
| `private_content_version` | `Magento_PageCache`, `Magento_Customer` |
30-
| `section_data_ids` | `Magento_Customer` |
31-
| `store` | `Magento_Store` |
32-
| `mage-banners-cache-storage` | `Magento_Banner` (Magento Commerce). Description: Local storage for Banner functionality. |
8+
| Cookie | Is Secure | HTTP Only | Expiration Policy | Module | Related configuration |
9+
| ------- | --------- | --------- | ----------------- | -------- | ------------- |
10+
| `guest-view` | No | Yes | Session | `Magento_Sales` | Guest orders view. Used in "Orders and Returns" widget. |
11+
| `login_redirect` | No | No | Session | `Magento_Customer`, `Magento_Checkout` | Used in minicart for logged in customers if "Shopping Cart Sidebar" > "Display Shopping Cart Sidebar" is set to "Yes" |
12+
| `mage-messages` | No | No | Duration: 1 year. Cleared on frontend when the message is displayed to the user. | `Magento_Theme` | No option to disable |
13+
| `mage-translation-storage` (local storage) | No | No | Per local storage rules | `Magento_Translation` | Used when "Translation Strategy" configured as "Dictionary (Translation on Storefront side)". |
14+
| `mage-translation-file-version` (local storage) | No | No | Per local storage rules | `Magento_Translation`. | Tracks version of translations in local storage. Used when "Translation Strategy" configured as "Dictionary (Translation on Storefront side)". |
15+
| `product_data_storage` (local storage) | No | No | Per local storage rules | `Magento_Catalog` | |
16+
| `recently_compared_product` (local storage) | No | No | Per local storage rules | `Magento_Catalog` | |
17+
| `recently_compared_product_previous` (local storage) | No | No | Per local storage rules | `Magento_Catalog` | |
18+
| `recently_viewed_product` (local storage) | No | No | Per local storage rules | `Magento_Catalog` | |
19+
| `recently_viewed_product_previous` (local storage) | No | No | Per local storage rules | `Magento_Catalog` | |
20+
| `stf` | Yes | Yes | Session | `Magento_SendFriend` | |
21+
| `X-Magento-Vary` (note: original document has typo) | Yes | Yes | Based on PHP setting `session.cookie_lifetime` | `Magento_PageCache` | |
22+
| `amz_auth_err` | No | No | 1 year | Amazon Pay CBE | Used if "Enable Login with Amazon" is enabled. |
23+
| `amz_auth_logout` | No | No | 86400s (24h) | Amazon Pay CBE | Used if "Enable Login with Amazon" is enabled. |
24+
| `form_key` | No | No | PHP: based on PHP setting `session.cookie_lifetime`. JS: session | Page Cache | |
25+
| `mage-cache-sessid` | No | No | Session | `Magento_Customer`, `Magento_Persistent` | |
26+
| `mage-cache-storage` (local storage) | No | No | Per local storage rules | `Magento_Customer`, `Magento_Persistent`, `Magento_NegotiableQuote` | |
27+
| `mage-cache-storage-section-invalidation` (local storage) | No | No | Per local storage rules | `Magento_Customer` | |
28+
| `section_data_ids` | No | No | Session | `Magento_Customer` | |
29+
| `persistent_shopping_cart` | Yes | Yes | Based on Admin configuration in `Persistent Shopping Cart > General Options > Persistence Lifetime (seconds)` | `Magento_Persistent` | |
30+
| `private_content_version` | Yes (based on the request)/No | No | PHP: 1 year/315360000s (10 years); JS: 1 day; JS local storage: per local storage rules (forever) | `Magento_PageCache`, `Magento_Customer` | It is set in multiple places: in PHP, in JS as a cookie, and in JS to local storate |
31+
| `store` | No | Yes | 1 year | `Magento_Store` | |
32+
| `mage-banners-cache-storage` (local storage) | No | No | Per local storage rules | `Magento_Banner` (Magento Commerce). Description: Local storage for Banner functionality. | |
33+
34+
HTTP Only = "Yes (based on the request)" means that the cookie is secure if set during HTTPS request, and unsecure if set during HTTP request.

design-documents/dependabot-slack.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Dependabot + Slack
2+
3+
[Dependabot](https://dependabot.com/) provides a functionality to track dependencies from `composer.json` and create PRs to the tracked repositories.
4+
But it does not provide a notification mechanism. As [Slack](https://slack.com/) is the most popular corporate messenger and Magento uses it, and has a lot of customizations like bots and applications, it make sense to integrate a notification mechanism about newly created PRs.
5+
Fortunately, Github already has a [mechanism](https://slack.github.com/) for Slack notifications.
6+
7+
In general this schema works like this:
8+
9+
![Dependabot+Slack](img/dependabot_slack.png)
10+
11+
Dependabot creates a PR with updated dependencies (one PR for one dependency), Github sends a notification to a Slack channel. As Dependabot and Slack are integrated with Github and don't depend on each other, they can be replaced/extended by other tools like [Greenkeeper](https://greenkeeper.io/) and
12+
[Jira](https://marketplace.atlassian.com/apps/1219592/github-for-jira?hosting=cloud&tab=overview).
13+
14+
## General workflow
15+
16+
The next diagram shows how the more detailed workflow looks like:
17+
18+
![Dependabot+Slack Schema](img/dependabot_slack_schema.png)
19+
20+
- Dependabot tracks `composer.json` dependencies for a specified repository
21+
- For a new versions of dependencies it creates a PR
22+
- Github built-in mechanism tracks newly created PRs and send a notification to Slack app
23+
- Github Slack app publishes a message in a channel according to the subscription rules (see Slack Integration section)
24+
- Custom labels (the default label is `dependencies`) or review assignees
25+
26+
## Dependabot Integration
27+
28+
Dependabot requires Github authorization and permissions to the needed repositories. Each tracked repository has own configuration. The configuration settings include:
29+
30+
- Update schedule settings: live, daily, weekly, monthly
31+
- Branch to track
32+
- Filters, like security updates, top-level dependencies
33+
- Different updating strategies for `composer.json`
34+
35+
## Github Slack Integration
36+
37+
Github Slack integration also requires authorization and permissions to tracked repositories. Also, Github app should be installed for Slack workspace. More installation details can be found in the [documentation](https://github.com/integrations/slack#installing-the-github-integration-for-slack).
38+
39+
Github app provides the following commands to track interested repositories:
40+
41+
- issues - Opened or closed issues
42+
- pulls - New or merged pull requests
43+
- statuses - Statuses on pull requests
44+
- commits - New commits on the default branch (usually master)
45+
- deployments - Updated status on deployments
46+
- public - A repository switching from private to public
47+
- releases - Published releases
48+
- reviews - Pull request reviews
49+
- comments - New comments on issues and pull requests
50+
- branches - Created or deleted branches
51+
- commits:all - All commits pushed to any branch
52+
53+
To track PRs with updated dependencies the following command might be used:
54+
55+
```bash
56+
/github subscribe magento/magento pulls
57+
```
58+
59+
Github app will notify about all newly created PRs in subscribed repository. Unfortunately, there is [no a possibility](https://github.com/integrations/slack/issues/384) to track PRs only with specific labels. A separate repository might be used as a temporal solution.
60+
61+
## Summary
62+
63+
Such schema covers tracking all dependencies from `composer.json`, automatically creates a PR with updated dependency and sends notification to a Slack channel. Also, this solution does not require custom tool or application and hardware resources. The solution does not cover indirect dependencies like MySql, ElasticSearch, etc. which are not specified in `composer.json`.
64+
65+
As tracking and notification mechanisms are independent, the more sources can be added in the future (like npm dependencies) and notifications can be send to different sources (like Jira).
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Distributed deployment
2+
3+
## Problem
4+
5+
We want support distributed deployment of Magento: admin UI, cron, storefront UI, web API, and CLI.
6+
7+
Benefits
8+
* Splitting modules decreases number of dependencies
9+
* When deploying area specific instances, unnecessary dependencies not loaded and it should improve performance
10+
* We don't have private interfaces (admin UI, cron) exposed, should improve security
11+
* It's a step towards splitting monolith into services
12+
13+
This proposal solves problem of adding necessary configuration to allow distributed deployment.
14+
15+
## Design
16+
17+
To distinguish between different instances, we have these options
18+
19+
1. Don't add any special information on instances, developer always knows which instance is which.
20+
2. Introduce marker component packages to mark instances (`magento/admin-ui`, `magento/storefront-ui`, `magento/cron`, etc).
21+
3. Use projects, if we publish different projects, we can just use them _recommended_.
22+
23+
Approaches to specify where extension parts need to be installed
24+
1. Reuse existing type field in composer configuration. Will need to add more types (`magento2-admin-ui-module`, `magento2-storefront-ui-module`, `magento2-cron-module`, etc).
25+
26+
Cons
27+
* Will not work for specifying on which services extension parts need to be installed
28+
* Might need require adding configuration on instances to track which extensions installed on the system
29+
30+
2. Extend composer configuration _recommended_
31+
32+
Modules would define on which instances they need to be installed.
33+
34+
CatalogExtensionAdminUi/composer.json
35+
```
36+
{
37+
"name": "vendor/catalog-extension-admin-ui",
38+
...
39+
"extra": {
40+
"instances": [
41+
"admin-ui"
42+
]
43+
}
44+
}
45+
```
46+
47+
To track which extensions installed on distributedly deployed Magento, developer can add metapackage names in composer.json files on instances.
48+
49+
admin-ui-instance/composer.json
50+
```
51+
{
52+
"name": "magento/admin-ui-project",
53+
"type": "project",
54+
"require": {
55+
"vendor/catalog-extension-admin-ui": "*",
56+
...
57+
},
58+
...
59+
"extra": {
60+
"extensions": [
61+
"vendor/catalog-extension"
62+
]
63+
}
64+
}
65+
```
66+
67+
Pros
68+
* The same approach can be used later to define on which services which extension parts need to be installed.
69+
70+
3. If packages named by convention (`vendor/catalog-extension-admin-ui`, `vendor/catalog-extension-storefront-ui`, `vendor/catalog-extension-cron`, etc), developer can figure out where extension parts should be installed by package names.
71+
72+
Cons
73+
* Will not work for specifying on which services extension parts need to be installed
74+
* Potentially not reliable
75+
* Might need require adding configuration on instances to track which extensions installed on the system
13.4 KB
Loading
41.8 KB
Loading

design-documents/testing/functional/versioning-and-backward-compatibility-policy.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ An approach of defining what each release should include was taken from [Semanti
4747
3. Introduce publication functionality for publishing `magento2-test-module` package type.
4848
4. Create metapackage with test packages only for each Magento edition.
4949

50-
## Entity's id attributes
50+
## Entity's attributes
5151
Changing any of this attribute will cause Backward Incompatible change.
5252

5353
**Test entity:**
5454

55-
|xPath|idAttribute|
55+
|xPath|attribute|
5656
|---|---|
5757
|`/tests/test`|name|
5858
|`/tests/test/<ACTION> ⃰`|stepKey|
@@ -61,15 +61,16 @@ Changing any of this attribute will cause Backward Incompatible change.
6161

6262
**Action Group entity:**
6363

64-
|xPath|idAttribute|
64+
|xPath|attribute|
6565
|---|---|
6666
|`/actionGroups/actionGroup`|name|
6767
|`/actionGroups/actionGroup/arguments/argument`|name|
68+
|`/actionGroups/actionGroup/arguments/argument`|type|
6869
|`/actionGroups/actionGroup/<ACTION> ⃰`|stepKey|
6970

7071
**Data entity:**
7172

72-
|xPath|idAttribute|
73+
|xPath|attribute|
7374
|---|---|
7475
|`/entities/entitie`|name|
7576
|`/entities/entitie/data`|key|
@@ -79,7 +80,7 @@ Changing any of this attribute will cause Backward Incompatible change.
7980

8081
**Metadata entity:**
8182

82-
|xPath|idAttribute|
83+
|xPath|attribute|
8384
|---|---|
8485
|`/operations/operation`|name|
8586
|`/operations/operation/field`|key|
@@ -91,14 +92,14 @@ Changing any of this attribute will cause Backward Incompatible change.
9192

9293
**Page entity:**
9394

94-
|xPath|idAttribute|
95+
|xPath|attribute|
9596
|---|---|
9697
|`/pages/page`|name|
9798
|`/pages/page/section`|name|
9899

99100
**Section entity:**
100101

101-
|xPath|idAttribute|
102+
|xPath|attribute|
102103
|---|---|
103104
|`/sections/section`|name|
104105
|`/sections/section/element`|name|

0 commit comments

Comments
 (0)