Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit f5caa98

Browse files
MC-35509: Updated the software update guide module with the safe upgrade tool documentation (#8314)
* Added SUT topics * Added dev topic for sut * Added diagram workflow SUT * Fixed issues * Created use guide and divided install and welcome guide * Reviewed topic and fixed issues * Reviewed topic and fixed issues * Fixed url * Reviewed dev topic and fixed issues * fixed in toc url * Added sut tracking page and reorganized pages * Reviewed topic sut tracking and added audience in welcome guide * Reviewed topics * Reviewed topics and added page for SUT * Fix linting issues * Fix linting issues * Fix linting issues 3 * Fix linting issues 4 * Fix linting issues 5 * Fix linting issues * Fix linting issues * Fix linting issues * Fix linting issues * Fix linting issues * Fix linting issues rule md30 * Fix linting issues rule md30 * Fix linting issues rule md06 & md36 * Fix linting issues rule md36 * Added link to the sut section in the main software update guide topic * moved SUT section under guides to keep it versionless * Added link to the sut section in the main 2.3 software update guide topic * moved sut folder and modified urls as per peer review * Added versionless:true to TOC as per peer review * Modified files for sut after peer review * Fixed linting issue MD029 * continue modifying files after peer review * continue modifying files after peer review - include H3 or H4 for examples * added links to composer and new relic * added links to composer and new relic * fixed linting rule issues md009 * fixed topics after peer review * fixed linting rule issues md029 * Removed acronym from directory path * Applied suggestions from initiall peer review * Copy edited files that were not part of innitial peer review * reviewed topics and pages after discussion with ENG about SUT public docs. Removed tracking topic * Fixed linting issue MD029 * Added a banner in page-header.html * Added a banner in page-header.html * Modified banner as ALPHA * Updated topic after peer review * Updated topic after peer review - continue * Removed entry in TOC about tracking * Reviewed comments in PR * Added memory limits as per technical review * Updated introduction with correct tool name from Ampersand * Updated information for memory limitations and complexity formula * Fixed url in page-header html * Fixed pages and toc with commerce-only banner * Fixed toc with commerce-only banner * Added changes as per MC-40435 * Updated PR after product review * Updated PR after linting review * Updated PR after product review * Updated PR after product review - 2 * Updated PR after slack/email information requested by product * Updated PR after slack/email information requested by product * Updated PR after slack/email information requested by product * Modified contact section Co-authored-by: Jeff Matthews <[email protected]>
1 parent a0b7bc6 commit f5caa98

File tree

12 files changed

+435
-0
lines changed

12 files changed

+435
-0
lines changed

src/_data/toc/software-update-guide.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,28 @@ pages:
2121
- label: Update and upgrade checklist
2222
url: /comp-mgr/prereq/prereq_compman-checklist.html
2323

24+
- label: Safe Upgrade Tool
25+
url: /safe-upgrade-tool/introduction.html
26+
versionless: true
27+
edition: ee-only
28+
children:
29+
30+
- label: Prerequisites
31+
url: /safe-upgrade-tool/prerequisites.html
32+
versionless: true
33+
34+
- label: Install
35+
url: /safe-upgrade-tool/install.html
36+
versionless: true
37+
38+
- label: Run the tool
39+
url: /safe-upgrade-tool/run.html
40+
versionless: true
41+
42+
- label: Developer information
43+
url: /safe-upgrade-tool/developer.html
44+
versionless: true
45+
2446
- label: Magento Marketplace example
2547
url: /comp-mgr/marketplace/marketplace.html
2648
include_versions: ["2.3"]

src/_includes/layout/page-header.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,10 @@ <h2 class="page-subtitle no_toc">{{ page.subtitle }}</h2>
4242
</div>
4343
{% endif %}
4444

45+
{% if page.url contains "safe-upgrade-tool/" %}
46+
<div class="message-banner">
47+
This tool is still in ALPHA with limited scope. If you are a Magento Commerce user you can download it at <a href="https://repo.magento.com/">Magento repo</a>.
48+
</div>
49+
{% endif %}
50+
4551
</section>

src/guides/v2.3/comp-mgr/bk-compman-upgrade-guide.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ Related topics
5353

5454
Complete the tasks discussed in [Prerequisites].
5555

56+
{:.bs-callout-info}
57+
See the [Safe Upgrade Tool ALPHA]({{site.baseurl}}/safe-upgrade-tool/introduction.html) for more information about the new Magento CLI tool that helps you update your Magento software.
58+
5659
<!-- ABBREVIATIONS -->
5760

5861
*[contributing developer]: A developer who contributes code to the Magento 2 CE codebase

src/guides/v2.4/comp-mgr/bk-compman-upgrade-guide.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ Related topics
4848

4949
Complete the tasks discussed in [Prerequisites].
5050

51+
{:.bs-callout-info}
52+
See the [Safe Upgrade Tool ALPHA]({{site.baseurl}}/safe-upgrade-tool/introduction.html) for more information about the new Magento CLI tool that helps you update your Magento software.
53+
5154
<!-- ABBREVIATIONS -->
5255

5356
*[contributing developer]: A developer who contributes code to the Magento 2 CE codebase

src/safe-upgrade-tool/developer.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
group: software-update-guide
3+
title: Developer information
4+
ee_only: True
5+
functional_areas:
6+
- Upgrade
7+
---
8+
9+
This topic contains information for developers who want to know more technical information about the Magento Safe Upgrade Tool ALPHA (SUT). It is focused on developers who work closely with the Magento source code. You can use this knowledge to customize the SUT's components.
10+
11+
## Magento API index integration
12+
13+
Magento API index integration is an internal integration solution that comprehends a set of tools to explore Magento Extensions developed by Magento, an Adobe Company, Magento Partners and 3rd party vendors based on static code analysis.
14+
15+
The integration with Magento API index is done through:
16+
17+
`Sut\Domain\MRay\MRayInterface`
18+
19+
It is implemented through the `config/services.yaml` file. Its value decides where the response of methods `api()` and `modules()` comes from.
20+
21+
Edit this file to customize the response according to your installation. Just replace the value assigned to `Sut\Domain\MRay\MRayInterface`:
22+
23+
### Example of a custom value
24+
25+
`Sut\Domain\MRay\MRayInterface : "@sut_mray_mock"`
26+
27+
In the previous example, the SUT uses `@sut_mray_mock` as the `MRayInterface` implementation. The responses from the `api()` and `modules()` methods come from the following files:
28+
29+
* `dev/mray_mock_files/api.json`
30+
* `dev/mray_mock_files/modules.json`
31+
32+
{:.bs-callout-info}
33+
When you make changes to the `services.yaml` file, delete the `var/cache/` folder to correctly apply them.
34+
35+
## Unit testing
36+
37+
To run the unit tests, execute one of the following commands:
38+
39+
* `vendor/bin/phpunit tests/unit`
40+
* `vendor/bin/phpunit -c tests/unit/phpunit.xml.dist tests/unit`
41+
* `vendor/bin/phpunit -c tests/unit/phpunit.xml.dist --testsuite=unit-tests`
42+
43+
## Integration testing
44+
45+
To run the integration tests, execute one of the following commands:
46+
47+
* `vendor/bin/phpunit -c tests/integration/phpunit.xml.dist tests/integration`
48+
* `vendor/bin/phpunit -c tests/integration/phpunit.xml.dist --testsuite=integration-tests`
49+
50+
## Acceptance testing
51+
52+
1. Before executing acceptance tests, you must set the Magento URL in the `phpunit` configuration file.
53+
1. Copy the default `tests/acceptance/phpunit.xml` file (without the .dist suffix).
54+
1. Change the `TESTS_BASE_URL` value to point to the Magento URL that you want to test.
55+
1. To run the acceptance tests, execute one of the following commands:
56+
57+
* `vendor/bin/phpunit -c tests/acceptance/phpunit.xml tests/acceptance`
58+
* `vendor/bin/phpunit -c tests/acceptance/phpunit.xml --testsuite=acceptance-tests`
59+
60+
## JS unit testing for GraphQL
61+
62+
We used the [Jest](https://jestjs.io/docs/en/getting-started.html) framework to create these JS unit tests:
63+
64+
{:.bs-callout-info}
65+
To run JS unit tests for GraphQL, you must have Node.js installed.
66+
67+
### Node.js
68+
69+
To install Node.js on your system, see the Node.js [documentation](https://nodejs.dev/learn/how-to-install-nodejs).
70+
71+
The following instructions are for MacOS systems:
72+
73+
1. Open a terminal and navigate to the `graphql-schema-compatibility/` directory.
74+
1. Install project dependencies:
75+
76+
```bash
77+
npm install
78+
```
79+
80+
1. Run unit tests or `jest`:
81+
82+
```bash
83+
npm run unit-test
84+
```
85+
86+
The tests are inside `graphql-schema-compatibility/test/js/unit`.
87+
88+
The string schemas for testing are inside `dev/graphql_schemas`.
89+
90+
## Complexity score
91+
92+
The **complexity score** is a figure that indicates how difficult an upgrade from the current version to the new one might be. Lower numbers indicate easier upgrades.
93+
94+
{:.bs-callout-info}
95+
Complexity scores range between 0 and ∞.
96+
97+
This score is based on the results extracted from the analysis:
98+
99+
* Number of issues identified
100+
* Severity of issues identified
101+
102+
The SUT calculates this score according to the following formula:
103+
104+
### Complexity score formula
105+
106+
`Complexity Score = 2 * (# of errors) + 1 * (# of warnings)`
107+
108+
{:.bs-callout-warning}
109+
These are absolute values.
477 KB
Loading
163 KB
Loading
48.7 KB
Loading

src/safe-upgrade-tool/install.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
group: software-update-guide
3+
title: Install
4+
ee_only: True
5+
functional_areas:
6+
- Upgrade
7+
---
8+
9+
The Safe Upgrade Tool ALPHA (SUT) is a command line (CLI) tool that checks a Magento instance against a specific version by analyzing all the non-Magento modules installed on it.
10+
11+
{:.bs-callout-warning}
12+
At the moment this is an ALPHA version with limited scope, available for all Magento Commerce merchants, only validating PHP Magento APIs and GraphQL schema.
13+
14+
## Workflow
15+
16+
The following diagram shows the expected workflow when running the SUT:
17+
18+
![SUT Diagram](img/mvp-diagram-v2.png)
19+
20+
### Who is the SUT for?
21+
22+
The following use case describes the typical process for a Magento partner to upgrade a client's Magento instance:
23+
24+
1. A partner's Software Engineer downloads the SUT package from the [Magento repository](https://repo.magento.com/) and executes it during the beta phase of the newest Magento release.
25+
1. The Software Engineer sees that there are several customized areas broken in the inventory and catalog modules and they also get a complexity score of X. See the [Developer information guide]({{site.baseurl}}/safe-upgrade-tool/developer.html) for more information on the complexity score.
26+
1. With this information, the Software Engineer is able to understand the complexity of the upgrade and is able to relay this information back to the partner's Account Manager.
27+
1. The Account Manager creates a timeline and cost for the Magento upgrade, which allows them to get their manager's approval.
28+
1. With their manager's approval, the Software Engineer works on the required code modifications to fix the broken modules.
29+
1. The Software Engineer runs the SUT tool one more time with a Magento pre-release to ensure there are no new issues and that their code changes fixed the problems found during the beta phase.
30+
1. Everything check’s out and the Software Engineer pushes the code to a staging environment where regression tests confirm all tests are green, which allows them to release the latest Magento version to production the same day that the Magento pre-release is released.
31+
32+
![SUT audience](img/audience-sut.png)
33+
34+
#### Contact SUT
35+
36+
To connect with the SUT team:
37+
38+
1. Contact us on the Engineering Slack channel [Magento Safe Upgrade Tool](https://magentocommeng.slack.com/archives/C019Y143U9F).
39+
1. Send us an email at [[email protected]](mailto:[email protected]).
40+
41+
See the [Resources]({{site.baseurl}}/community/resources/resources.html) page for more information.
42+
43+
## Prerequisites
44+
45+
See [prerequisites]({{site.baseurl}}/safe-upgrade-tool/prerequisites.html) for more information.
46+
47+
{:.bs-callout-info}
48+
You can run the SUT in any operating system. There is no requirement to run the SUT where your Magento instance is located. It is necessary for SUT to have access to the source code of the Magento instance. For example, you can install the SUT on one server and point it at your Magento installation on another server.
49+
50+
If you are running SUT against a Magento instance with large modules and files, the tool might require a high amount of RAM, at least 2GB RAM.
51+
52+
### Recommended actions
53+
54+
Magento best practice is not to have 2 modules with the same name, if this happens SUT will show a segmentation fault error in which case you have to analyze each module independently with the option `-m`:
55+
56+
```bash
57+
bin/sut upgrade:check /(instance_path) --coming-version=2.4.1 -m /(module_path)
58+
```
59+
60+
If you get memory issues while executing SUT it is recommended to use the `-m` command to run the tool against a specific module.
61+
62+
## Install
63+
64+
To install the SUT, you must install the necessary prerequisites:
65+
66+
* Magento access keys
67+
* Composer
68+
* Node.js (only required to check GraphQL compatibility)
69+
70+
Refer to the [SUT installation]({{site.baseurl}}/safe-upgrade-tool/install.html#install).
71+
72+
### Magento access keys
73+
74+
You must have [Magento access keys]({{site.baseurl}}/marketplace/sellers/profile-information.html#access-keys) to download and use the SUT. Add your Magento access keys to your `auth.json` file, which is located at `~/.composer` by default.
75+
76+
{:.bs-callout-warning}
77+
Check your **COMPOSER_HOME** environment variable to see where the `auth.json` file is located.
78+
79+
The **public key** corresponds to the _username_ whereas the **private key** is the _password_:
80+
81+
### Example of Magento access keys
82+
83+
```json
84+
"http-basic": {
85+
"repo.magento.com": {
86+
"username": "YOUR_MAGENTO_PUBLIC_KEY",
87+
"password": "YOUR_MAGENTO_PRIVATE_KEY"
88+
}
89+
},
90+
```
91+
92+
### Composer
93+
94+
Clone the [safe-upgrade-tool](https://github.com/magento-commerce/safe-upgrade-tool) repository and run `composer install` in your terminal to install dependencies.
95+
96+
{:.bs-callout-warning}
97+
If the **Magento access keys** are not correctly configured, the SUT will not install and you will get errors when running the `composer install` command.
98+
99+
### Node.js
100+
101+
To install Node.js, see the Node.js [documentation](https://nodejs.dev/learn/how-to-install-nodejs).
102+
103+
{:.bs-callout-info}
104+
Node.js is only a requirement to check GraphQL compatibility.
105+
106+
## Third-party extensions
107+
108+
Magento recommends that you contact your search engine vendor to determine whether your extension is fully compatible with Magento 2.4.
109+
110+
See [Run the tool]({{site.baseurl}}/safe-upgrade-tool/run.html) for information about executing the SUT tool.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
group: software-update-guide
3+
title: Introduction
4+
ee_only: True
5+
functional_areas:
6+
- Upgrade
7+
---
8+
9+
The Safe Upgrade Tool ALPHA (SUT) is a command line (CLI) tool that checks a Magento instance against a specific version by analyzing all the non-Magento modules installed in it.
10+
11+
The SUT identifies potential problems that must be fixed in your custom code before attempting to upgrade to a newer version of Magento.
12+
13+
The SUT returns a list of errors and warnings that you must address before upgrading to a new version of Magento.
14+
15+
It is distributed as a Composer package with every release of a Magento version. See [Developer]({{site.baseurl}}/safe-upgrade-tool/developer.html) topic for more information.
16+
17+
Refer to the [Install]({{site.baseurl}}/safe-upgrade-tool/install.html) for first steps with SUT.
18+
19+
{:.bs-callout-warning}
20+
At the moment this is an ALPHA version with limited scope, available for all Magento Commerce merchants, only validating PHP Magento APIs and GraphQL schema.

0 commit comments

Comments
 (0)