Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
141087a
Added SUT topics
danidelcar Dec 2, 2020
281a7b8
Added dev topic for sut
danidelcar Dec 2, 2020
b312746
Added diagram workflow SUT
danidelcar Dec 3, 2020
0b31ee8
Fixed issues
danidelcar Dec 3, 2020
1fc73e4
Created use guide and divided install and welcome guide
danidelcar Dec 3, 2020
15b32d2
Reviewed topic and fixed issues
danidelcar Dec 3, 2020
28d9db4
Reviewed topic and fixed issues
danidelcar Dec 3, 2020
f46513e
Fixed url
danidelcar Dec 3, 2020
d4e85f5
Reviewed dev topic and fixed issues
danidelcar Dec 3, 2020
77f4b67
fixed in toc url
danidelcar Dec 3, 2020
0766442
Added sut tracking page and reorganized pages
danidelcar Dec 3, 2020
e2e9284
Reviewed topic sut tracking and added audience in welcome guide
danidelcar Dec 3, 2020
cf44e0f
Reviewed topics
danidelcar Dec 3, 2020
acd8b11
Reviewed topics and added page for SUT
danidelcar Dec 3, 2020
14b789d
Fix linting issues
danidelcar Dec 3, 2020
2218230
Fix linting issues
danidelcar Dec 3, 2020
247e124
Fix linting issues 3
danidelcar Dec 3, 2020
0a87e4d
Fix linting issues 4
danidelcar Dec 3, 2020
097659d
Fix linting issues 5
danidelcar Dec 3, 2020
0de2254
Fix linting issues
danidelcar Dec 3, 2020
9d7846b
Fix linting issues
danidelcar Dec 3, 2020
61f1033
Fix linting issues
danidelcar Dec 3, 2020
0866cb8
Fix linting issues
danidelcar Dec 3, 2020
edf883b
Fix linting issues
danidelcar Dec 3, 2020
1cd481f
Fix linting issues rule md30
danidelcar Dec 3, 2020
d95721e
Fix linting issues rule md30
danidelcar Dec 3, 2020
6a206c8
Fix linting issues rule md06 & md36
danidelcar Dec 3, 2020
ee1d425
Fix linting issues rule md36
danidelcar Dec 3, 2020
ac4d76a
Added link to the sut section in the main software update guide topic
danidelcar Dec 3, 2020
38d3cb6
Merge branch 'master' into MC-35509
danidelcar Dec 3, 2020
d8469cf
moved SUT section under guides to keep it versionless
danidelcar Dec 3, 2020
b640157
Added link to the sut section in the main 2.3 software update guide t…
danidelcar Dec 3, 2020
35c8d74
moved sut folder and modified urls as per peer review
danidelcar Dec 4, 2020
e0f9ebb
Added versionless:true to TOC as per peer review
danidelcar Dec 4, 2020
7258e17
Modified files for sut after peer review
danidelcar Dec 4, 2020
16877f8
Fixed linting issue MD029
danidelcar Dec 4, 2020
8276b67
continue modifying files after peer review
danidelcar Dec 4, 2020
843ea2d
continue modifying files after peer review - include H3 or H4 for exa…
danidelcar Dec 4, 2020
a3485b3
added links to composer and new relic
danidelcar Dec 4, 2020
e3b2184
added links to composer and new relic
danidelcar Dec 4, 2020
dda4583
fixed linting rule issues md009
danidelcar Dec 4, 2020
46e8bfc
fixed topics after peer review
danidelcar Dec 4, 2020
c3873ed
fixed linting rule issues md029
danidelcar Dec 4, 2020
36d1f09
Removed acronym from directory path
jeff-matthews Dec 7, 2020
4228f33
Applied suggestions from initiall peer review
jeff-matthews Dec 7, 2020
f07d81e
Copy edited files that were not part of innitial peer review
jeff-matthews Dec 7, 2020
2321601
Merge branch 'master' into MC-35509
danidelcar Dec 17, 2020
19ee29a
reviewed topics and pages after discussion with ENG about SUT public …
danidelcar Dec 17, 2020
73ae70a
Fixed linting issue MD029
danidelcar Dec 17, 2020
562e83b
Added a banner in page-header.html
danidelcar Dec 17, 2020
943e4a7
Added a banner in page-header.html
danidelcar Dec 17, 2020
10e8699
Modified banner as ALPHA
danidelcar Dec 17, 2020
982d204
Updated topic after peer review
danidelcar Dec 21, 2020
65fdc67
Updated topic after peer review - continue
danidelcar Dec 21, 2020
1920a30
Merge branch 'master' into MC-35509
danidelcar Jan 5, 2021
e98220f
Merge branch 'MC-35509' of github.com:magento/devdocs into MC-35509
danidelcar Jan 5, 2021
607febf
Removed entry in TOC about tracking
danidelcar Jan 5, 2021
c1f33e0
Reviewed comments in PR
danidelcar Jan 8, 2021
4f2ccf6
Merge branch 'master' into MC-35509
danidelcar Jan 8, 2021
d9866d3
Merge branch 'master' into MC-35509
danidelcar Jan 12, 2021
f27b5cb
Added memory limits as per technical review
danidelcar Jan 12, 2021
badffe5
Updated introduction with correct tool name from Ampersand
danidelcar Jan 13, 2021
da5580d
Updated information for memory limitations and complexity formula
danidelcar Jan 13, 2021
e640b8a
Merge branch 'master' into MC-35509
danidelcar Jan 13, 2021
ce1dca8
Fixed url in page-header html
danidelcar Jan 13, 2021
1449b04
Fixed pages and toc with commerce-only banner
danidelcar Jan 14, 2021
a8d649f
Merge branch 'master' into MC-35509
danidelcar Jan 14, 2021
b07959d
Fixed toc with commerce-only banner
danidelcar Jan 14, 2021
217d0bd
Merge branch 'MC-35509' of github.com:magento/devdocs into MC-35509
danidelcar Jan 14, 2021
3c6305c
Merge branch 'master' into MC-35509
danidelcar Jan 14, 2021
0a49934
Merge branch 'master' into MC-35509
danidelcar Jan 19, 2021
b12c6cb
Added changes as per MC-40435
danidelcar Jan 19, 2021
daab5f9
Merge branch 'master' into MC-35509
danidelcar Jan 19, 2021
27130f5
Merge branch 'master' into MC-35509
danidelcar Jan 19, 2021
977b4d6
Merge branch 'master' into MC-35509
danidelcar Jan 20, 2021
fdd6df3
Updated PR after product review
danidelcar Jan 20, 2021
f763b6b
Updated PR after linting review
danidelcar Jan 20, 2021
6bc854f
Merge branch 'master' into MC-35509
danidelcar Jan 20, 2021
74e69ef
Updated PR after product review
danidelcar Jan 20, 2021
063ee58
Updated PR after product review - 2
danidelcar Jan 20, 2021
90f6a18
Merge branch 'master' into MC-35509
danidelcar Jan 21, 2021
6bd2b79
Updated PR after slack/email information requested by product
danidelcar Jan 21, 2021
8696511
Updated PR after slack/email information requested by product
danidelcar Jan 21, 2021
be8c685
Updated PR after slack/email information requested by product
danidelcar Jan 21, 2021
da55255
Modified contact section
danidelcar Jan 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/_data/toc/software-update-guide.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,28 @@ pages:
- label: Update and upgrade checklist
url: /comp-mgr/prereq/prereq_compman-checklist.html

- label: Safe Upgrade Tool
url: /safe-upgrade-tool/introduction.html
versionless: true
edition: ee-only
children:

- label: Prerequisites
url: /safe-upgrade-tool/prerequisites.html
versionless: true

- label: Install
url: /safe-upgrade-tool/install.html
versionless: true

- label: Run the tool
url: /safe-upgrade-tool/run.html
versionless: true

- label: Developer information
url: /safe-upgrade-tool/developer.html
versionless: true

- label: Magento Marketplace example
url: /comp-mgr/marketplace/marketplace.html
include_versions: ["2.3"]
Expand Down
6 changes: 6 additions & 0 deletions src/_includes/layout/page-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,10 @@ <h2 class="page-subtitle no_toc">{{ page.subtitle }}</h2>
</div>
{% endif %}

{% if page.url contains "safe-upgrade-tool/" %}
<div class="message-banner">
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>.
</div>
{% endif %}

</section>
3 changes: 3 additions & 0 deletions src/guides/v2.3/comp-mgr/bk-compman-upgrade-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ Related topics

Complete the tasks discussed in [Prerequisites].

{:.bs-callout-info}
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.

<!-- ABBREVIATIONS -->

*[contributing developer]: A developer who contributes code to the Magento 2 CE codebase
Expand Down
3 changes: 3 additions & 0 deletions src/guides/v2.4/comp-mgr/bk-compman-upgrade-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ Related topics

Complete the tasks discussed in [Prerequisites].

{:.bs-callout-info}
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.

<!-- ABBREVIATIONS -->

*[contributing developer]: A developer who contributes code to the Magento 2 CE codebase
Expand Down
109 changes: 109 additions & 0 deletions src/safe-upgrade-tool/developer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
group: software-update-guide
title: Developer information
ee_only: True
functional_areas:
- Upgrade
---

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.

## Magento API index integration

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.

The integration with Magento API index is done through:

`Sut\Domain\MRay\MRayInterface`

It is implemented through the `config/services.yaml` file. Its value decides where the response of methods `api()` and `modules()` comes from.

Edit this file to customize the response according to your installation. Just replace the value assigned to `Sut\Domain\MRay\MRayInterface`:

### Example of a custom value

`Sut\Domain\MRay\MRayInterface : "@sut_mray_mock"`

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:

* `dev/mray_mock_files/api.json`
* `dev/mray_mock_files/modules.json`

{:.bs-callout-info}
When you make changes to the `services.yaml` file, delete the `var/cache/` folder to correctly apply them.

## Unit testing

To run the unit tests, execute one of the following commands:

* `vendor/bin/phpunit tests/unit`
* `vendor/bin/phpunit -c tests/unit/phpunit.xml.dist tests/unit`
* `vendor/bin/phpunit -c tests/unit/phpunit.xml.dist --testsuite=unit-tests`

## Integration testing

To run the integration tests, execute one of the following commands:

* `vendor/bin/phpunit -c tests/integration/phpunit.xml.dist tests/integration`
* `vendor/bin/phpunit -c tests/integration/phpunit.xml.dist --testsuite=integration-tests`

## Acceptance testing

1. Before executing acceptance tests, you must set the Magento URL in the `phpunit` configuration file.
1. Copy the default `tests/acceptance/phpunit.xml` file (without the .dist suffix).
1. Change the `TESTS_BASE_URL` value to point to the Magento URL that you want to test.
1. To run the acceptance tests, execute one of the following commands:

* `vendor/bin/phpunit -c tests/acceptance/phpunit.xml tests/acceptance`
* `vendor/bin/phpunit -c tests/acceptance/phpunit.xml --testsuite=acceptance-tests`

## JS unit testing for GraphQL

We used the [Jest](https://jestjs.io/docs/en/getting-started.html) framework to create these JS unit tests:

{:.bs-callout-info}
To run JS unit tests for GraphQL, you must have Node.js installed.

### Node.js

To install Node.js on your system, see the Node.js [documentation](https://nodejs.dev/learn/how-to-install-nodejs).

The following instructions are for MacOS systems:

1. Open a terminal and navigate to the `graphql-schema-compatibility/` directory.
1. Install project dependencies:

```bash
npm install
```

1. Run unit tests or `jest`:

```bash
npm run unit-test
```

The tests are inside `graphql-schema-compatibility/test/js/unit`.

The string schemas for testing are inside `dev/graphql_schemas`.

## Complexity score

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.

{:.bs-callout-info}
Complexity scores range between 0 and ∞.

This score is based on the results extracted from the analysis:

* Number of issues identified
* Severity of issues identified

The SUT calculates this score according to the following formula:

### Complexity score formula

`Complexity Score = 2 * (# of errors) + 1 * (# of warnings)`

{:.bs-callout-warning}
These are absolute values.
Binary file added src/safe-upgrade-tool/img/audience-sut.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/safe-upgrade-tool/img/mvp-diagram-v2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/safe-upgrade-tool/img/mvp-diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
110 changes: 110 additions & 0 deletions src/safe-upgrade-tool/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
---
group: software-update-guide
title: Install
ee_only: True
functional_areas:
- Upgrade
---

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.

{:.bs-callout-warning}
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.

## Workflow

The following diagram shows the expected workflow when running the SUT:

![SUT Diagram](img/mvp-diagram-v2.png)

### Who is the SUT for?

The following use case describes the typical process for a Magento partner to upgrade a client's Magento instance:

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.
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.
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.
1. The Account Manager creates a timeline and cost for the Magento upgrade, which allows them to get their manager's approval.
1. With their manager's approval, the Software Engineer works on the required code modifications to fix the broken modules.
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.
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.

![SUT audience](img/audience-sut.png)

#### Contact SUT

To connect with the SUT team:

1. Contact us on the Engineering Slack channel [Magento Safe Upgrade Tool](https://magentocommeng.slack.com/archives/C019Y143U9F).
1. Send us an email at [sut@adobe.com](mailto:sut@adobe.com).

See the [Resources]({{site.baseurl}}/community/resources/resources.html) page for more information.

## Prerequisites

See [prerequisites]({{site.baseurl}}/safe-upgrade-tool/prerequisites.html) for more information.

{:.bs-callout-info}
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.

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.

### Recommended actions

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`:

```bash
bin/sut upgrade:check /(instance_path) --coming-version=2.4.1 -m /(module_path)
```

If you get memory issues while executing SUT it is recommended to use the `-m` command to run the tool against a specific module.

## Install

To install the SUT, you must install the necessary prerequisites:

* Magento access keys
* Composer
* Node.js (only required to check GraphQL compatibility)

Refer to the [SUT installation]({{site.baseurl}}/safe-upgrade-tool/install.html#install).

### Magento access keys

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.

{:.bs-callout-warning}
Check your **COMPOSER_HOME** environment variable to see where the `auth.json` file is located.

The **public key** corresponds to the _username_ whereas the **private key** is the _password_:

### Example of Magento access keys

```json
"http-basic": {
"repo.magento.com": {
"username": "YOUR_MAGENTO_PUBLIC_KEY",
"password": "YOUR_MAGENTO_PRIVATE_KEY"
}
},
```

### Composer

Clone the [safe-upgrade-tool](https://github.com/magento-commerce/safe-upgrade-tool) repository and run `composer install` in your terminal to install dependencies.

{:.bs-callout-warning}
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.

### Node.js

To install Node.js, see the Node.js [documentation](https://nodejs.dev/learn/how-to-install-nodejs).

{:.bs-callout-info}
Node.js is only a requirement to check GraphQL compatibility.

## Third-party extensions

Magento recommends that you contact your search engine vendor to determine whether your extension is fully compatible with Magento 2.4.

See [Run the tool]({{site.baseurl}}/safe-upgrade-tool/run.html) for information about executing the SUT tool.
20 changes: 20 additions & 0 deletions src/safe-upgrade-tool/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
group: software-update-guide
title: Introduction
ee_only: True
functional_areas:
- Upgrade
---

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.

The SUT identifies potential problems that must be fixed in your custom code before attempting to upgrade to a newer version of Magento.

The SUT returns a list of errors and warnings that you must address before upgrading to a new version of Magento.

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.

Refer to the [Install]({{site.baseurl}}/safe-upgrade-tool/install.html) for first steps with SUT.

{:.bs-callout-warning}
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.
25 changes: 25 additions & 0 deletions src/safe-upgrade-tool/prerequisites.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
group: software-update-guide
title: Prerequisites
ee_only: True
functional_areas:
- Upgrade
---

Running the Safe Upgrade Tool ALPHA (SUT) helps you identify what you must do **before** upgrading Magento.

The minimum requirements to run the SUT are:

| **Requirements** | **Constraints** |
|----------------|-----------------|
| PHP version| >= 7.3 |
| Composer | none |
| Node.js | An optional requirement. Only required to check GraphQL compatibility. |
| Memory limitations | At least 2GB RAM |
| Magento Access keys | none |
| MC or Magento Open Source | none |
{:style="table-layout:auto;"}

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 SUT on one server and point it at your Magento installation on another server. Refer to the [install]({{site.baseurl}}/safe-upgrade-tool/install.html#install) for more information.
Loading