Skip to content

Commit

Permalink
Merge branch '2.4-develop' into 2.4-develop-upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
rhoerr authored Oct 1, 2024
2 parents 1819fe7 + 535167b commit f128554
Show file tree
Hide file tree
Showing 109 changed files with 642 additions and 274 deletions.
2 changes: 1 addition & 1 deletion .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Magento Code of Conduct
# Mage-OS Code of Conduct

## Our Pledge

Expand Down
18 changes: 9 additions & 9 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Contributing to Magento 2 code

Contributions to the Magento 2 codebase are done using the fork & pull model.
This contribution model has contributors maintaining their own fork of the Magento 2 repository.
Contributions to the Mage-OS Magento 2 codebase are done using the fork & pull model.
This contribution model has contributors maintaining their own fork of the Mage-OS Magento 2 repository.
The forked repository is then used to submit a request to the base repository to "pull" a set of changes.
For more information on pull requests please refer to [GitHub Help](https://help.github.com/articles/about-pull-requests/).

Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes or optimizations.

The Magento 2 development team or community maintainers will review all issues and contributions submitted by the community of developers in the first in, first out order.
The Mage-OS Magento 2 development team or community maintainers will review all issues and contributions submitted by the community of developers in the first in, first out order.
During the review we might require clarifications from the contributor.
If there is no response from the contributor within two weeks, the pull request will be closed.

Expand All @@ -17,24 +17,24 @@ For more detailed information on contribution please read our [beginners guide](

1. Contributions must adhere to the [Magento coding standards](https://developer.adobe.com/commerce/php/coding-standards/).
2. Pull requests (PRs) must be accompanied by a meaningful description of their purpose. Comprehensive descriptions increase the chances of a pull request being merged quickly and without additional clarification requests.
3. Commits must be accompanied by meaningful commit messages. Please see the [Magento Pull Request Template](https://github.com/magento/magento2/blob/HEAD/.github/PULL_REQUEST_TEMPLATE.md) for more information.
3. Commits must be accompanied by meaningful commit messages. Please see the [Mage-OS Magento Pull Request Template](https://github.com/mage-os/mageos-magento2/blob/HEAD/.github/PULL_REQUEST_TEMPLATE.md) for more information.
4. PRs which include bug fixes must be accompanied with a step-by-step description of how to reproduce the bug.
5. PRs which include new logic or new features must be submitted along with:
* Unit/integration test coverage
* Proposed [documentation](https://developer.adobe.com/commerce) updates. Use feedback buttons __Edit in GitHub__ and __Log an issue__ at the top of a relevant topic.
6. For larger features or changes, please [open an issue](https://github.com/magento/magento2/issues) to discuss the proposed changes prior to development. This may prevent duplicate or unnecessary effort and allow other contributors to provide input.
6. For larger features or changes, please [open an issue](https://github.com/mage-os/mageos-magento2/issues) to discuss the proposed changes prior to development. This may prevent duplicate or unnecessary effort and allow other contributors to provide input.
7. All automated tests must pass.

## Contribution process

If you are a new GitHub user, we recommend that you create your own [free github account](https://github.com/signup/free).
This will allow you to collaborate with the Magento 2 development team, fork the Magento 2 project and send pull requests.
This will allow you to collaborate with the Mage-OS Magento 2 development team, fork the Mage-OS Magento 2 project and send pull requests.

1. Search current [listed issues](https://github.com/magento/magento2/issues) (open or closed) for similar proposals of intended contribution before starting work on a new contribution.
1. Search current [listed issues](https://github.com/mage-os/mageos-magento2/issues) (open or closed) for similar proposals of intended contribution before starting work on a new contribution.
2. Review the [Contributor License Agreement](https://opensource.adobe.com/cla.html) if this is your first time contributing.
3. Create and test your work.
4. Follow the [Forks And Pull Requests Instructions](https://developer.adobe.com/commerce/contributor/guides/code-contributions/) to fork the Magento 2 repository and send us a pull request.
5. Once your contribution is received the Magento 2 development team will review the contribution and collaborate with you as needed.
4. Follow the [Forks And Pull Requests Instructions](https://developer.adobe.com/commerce/contributor/guides/code-contributions/) to fork the Mage-OS Magento 2 repository and send us a pull request.
5. Once your contribution is received the Mage-OS Magento 2 development team will review the contribution and collaborate with you as needed.

## Code of Conduct

Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
Thank you for contributing to Magento.
Thank you for contributing to Mage-OS.
To help us process this issue we recommend that you add the following information:
- Summary of the issue,
- Information on your environment,
Expand All @@ -13,7 +13,7 @@
### Preconditions (*)
<!---
Please provide as detailed information about your environment as possible.
For example Magento version, tag, HEAD, PHP & MySQL version, etc..
For example Mage-OS Magento version, tag, HEAD, PHP & MySQL version, etc..
-->
1.
2.
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Bug report
description: Technical issue with the Magento 2 core components
description: Technical issue with the Mage-OS Magento 2 core components
body:
- type: markdown
attributes:
Expand All @@ -12,7 +12,7 @@ body:
Describe your environment.
Provide all the details that will help us to reproduce the bug.
value: |
- Magento version
- Mage-OS Magento version
- Anything else that would help a developer reproduce the bug
- type: textarea
attributes:
Expand Down Expand Up @@ -51,7 +51,7 @@ body:
attributes:
label: Additional information
description: |
Additional information is often requested when the bug report is processed. You can save time by providing both Magento and browser logs, screenshots, repository branch and HEAD commit you checked out to install Magento and any other artifacts related to the issue.
Additional information is often requested when the bug report is processed. You can save time by providing both Mage-OS Magento and browser logs, screenshots, repository branch and HEAD commit you checked out to install Magento and any other artifacts related to the issue.
Also, links to the comments with important information, Root Cause analysis, additional video recordings; and anything else that is important for the issue and at some reason cannot be added to other sections.
- type: textarea
attributes:
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ body:
- type: markdown
attributes:
value: |
Important: This repository is intended only for Magento 2 Technical Issues.
Important: This repository is intended only for Mage-OS Magento 2 Technical Issues.
Enter Feature Requests at https://github.com/magento/community-features.
Project stakeholders monitor and manage requests.
Feature requests entered using this form may be moved to the forum.
Expand All @@ -28,7 +28,7 @@ body:
attributes:
label: Benefits
description: |
How do you think this feature would improve Magento?
How do you think this feature would improve Mage-OS Magento?
- type: textarea
attributes:
label: Additional information
Expand Down
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!---
Thank you for contributing to Magento.
Thank you for contributing to Mage-OS.
To help us process this pull request we recommend that you add the following information:
- Summary of the pull request,
- Issue(s) related to the changes made,
Expand All @@ -20,10 +20,10 @@

### Fixed Issues (if relevant)
<!---
If relevant, please provide a list of fixed issues in the format magento/magento2#<issue_number>.
If relevant, please provide a list of fixed issues in the format mage-os/mageos-magento2#<issue_number>.
There could be 1 or more issues linked here and it will help us find some more information about the reasoning behind this change.
-->
1. Fixes magento/magento2#<issue_number>
1. Fixes mage-os/mageos-magento2#<issue_number>

### Manual testing scenarios (*)
<!---
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/coding-standard-baseline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Coding Standard With Baseline
on:
pull_request:
branches: ["**"]
permissions:
contents: read
jobs:
coding-standard:
runs-on: ubuntu-latest
steps:
- name: Run Coding Standard Baseline
uses: mage-os/github-actions/coding-standard-baseline@main
with:
head_repo: ${{github.event.pull_request.head.repo.full_name}}
head_ref: ${{github.event.pull_request.head.ref}}

19 changes: 19 additions & 0 deletions .github/workflows/full-integration-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Integration Tests - Full Test Suite
run-name: ${{ github.actor }} is running Full Integration Test Suite
on:
workflow_dispatch:
inputs:
test_directory:
description: 'Test directory to run integration tests'
type: string
required: false

jobs:
call-workflow:
name: calling full integration test suite
uses: mage-os/github-actions/.github/workflows/full-integration-tests.yaml@main
secrets: inherit
with:
repository: ${{ github.repository }}
head: ${{ github.sha }}
test_directory: ${{ github.event.inputs.test_directory }}
16 changes: 16 additions & 0 deletions .github/workflows/merge-upstream-changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
on:
schedule:
- cron: "10 10 * * *" # This gives mirror sync, which runs at 9:57, some time to complete.
workflow_dispatch: {}
permissions:
contents: write
pull-requests: write
jobs:
merge-from-mirror:
uses: mage-os/infrastructure/.github/workflows/merge-upstream-changes.yml@main
with:
upstream: https://github.com/mage-os/mirror-magento2.git
matrix: '{ branch: ["2.4-develop"] }'
secrets:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
MAGEOS_GITHUB_TOKEN: ${{ secrets.MAGE_OS_CI_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/nx-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Integration Tests (Using Nx)
run-name: ${{ github.actor }} is running Integration Tests
on:
pull_request:
branches: ["**"]

permissions:
contents: write

jobs:
call-workflow:
name: Calling Nx integration tests
uses: mage-os/github-actions/.github/workflows/nx-integration-tests.yml@main
secrets: inherit
with:
repository: ${{ github.repository }}
pr_head: ${{ github.event.pull_request.head.sha }}
pr_base: ${{ github.event.pull_request.base.ref }}
12 changes: 12 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Unit Tests
run-name: ${{ github.actor }} is running Unit Tests
on:
pull_request:
branches: ["**"]

permissions:
contents: write

jobs:
run-unit-tests:
uses: mage-os/infrastructure/.github/workflows/unit-tests.yml@main
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @Mage-OS/distribution
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
namespace Magento\AdminAnalytics\Model\Condition;

use Magento\AdminAnalytics\Model\ResourceModel\Viewer\Logger;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\View\Layout\Condition\VisibilityConditionInterface;
use Magento\Framework\App\CacheInterface;

Expand Down Expand Up @@ -40,16 +42,24 @@ class CanViewNotification implements VisibilityConditionInterface
*/
private $cacheStorage;

/**
* @var ScopeConfigInterface
*/
private $scopeConfig;

/**
* @param Logger $viewerLogger
* @param CacheInterface $cacheStorage
* @param ScopeConfigInterface|null $scopeConfig
*/
public function __construct(
Logger $viewerLogger,
CacheInterface $cacheStorage
CacheInterface $cacheStorage,
ScopeConfigInterface $scopeConfig = null
) {
$this->viewerLogger = $viewerLogger;
$this->cacheStorage = $cacheStorage;
$this->scopeConfig = $scopeConfig ?? ObjectManager::getInstance()->get(ScopeConfigInterface::class);
}

/**
Expand All @@ -62,7 +72,7 @@ public function isVisible(array $arguments): bool
{
$cacheKey = self::$cachePrefix;
$value = $this->cacheStorage->load($cacheKey);
if ($value !== 'log-exists') {
if ($this->scopeConfig->isSetFlag('admin/usage/enabled') && $value !== 'log-exists') {
$logExists = $this->viewerLogger->checkLogExists();
if ($logExists) {
$this->cacheStorage->save('log-exists', $cacheKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

use Magento\AdminAnalytics\Model\Condition\CanViewNotification;
use Magento\AdminAnalytics\Model\ResourceModel\Viewer\Logger;
use Magento\AdminAnalytics\Model\Viewer\Log;
use Magento\Framework\App\CacheInterface;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\App\ProductMetadataInterface;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use PHPUnit\Framework\MockObject\MockObject;
Expand All @@ -27,26 +27,27 @@ class CanViewNotificationTest extends TestCase
/** @var ProductMetadataInterface|MockObject */
private $productMetadataMock;

/** @var Log|MockObject */
private $logMock;

/** @var MockObject|CacheInterface $cacheStorageMock */
private $cacheStorageMock;

/** @var (ScopeConfigInterface&MockObject) */
private $scopeConfigMock;

protected function setUp(): void
{
$this->cacheStorageMock = $this->getMockBuilder(CacheInterface::class)
->getMockForAbstractClass();
$this->logMock = $this->createMock(Log::class);
$this->viewerLoggerMock = $this->createMock(Logger::class);
$this->productMetadataMock = $this->getMockForAbstractClass(ProductMetadataInterface::class);
$this->scopeConfigMock = $this->createMock(ScopeConfigInterface::class);
$objectManager = new ObjectManager($this);
$this->canViewNotification = $objectManager->getObject(
CanViewNotification::class,
[
'viewerLogger' => $this->viewerLoggerMock,
'productMetadata' => $this->productMetadataMock,
'cacheStorage' => $this->cacheStorageMock,
'scopeConfig' => $this->scopeConfigMock,
]
);
}
Expand All @@ -57,7 +58,7 @@ protected function setUp(): void
* @param $logExists
* @dataProvider isVisibleProvider
*/
public function testIsVisibleLoadDataFromLog($expected, $cacheResponse, $logExists)
public function testIsVisibleLoadDataFromLog($expected, $cacheResponse, $logExists, $configEnabled)
{
$this->cacheStorageMock->expects($this->once())
->method('load')
Expand All @@ -69,6 +70,7 @@ public function testIsVisibleLoadDataFromLog($expected, $cacheResponse, $logExis
$this->cacheStorageMock
->method('save')
->with('log-exists', 'admin-usage-notification-popup');
$this->scopeConfigMock->method('isSetFlag')->with('admin/usage/enabled')->willReturn($configEnabled);
$this->assertEquals($expected, $this->canViewNotification->isVisible([]));
}

Expand All @@ -78,9 +80,10 @@ public function testIsVisibleLoadDataFromLog($expected, $cacheResponse, $logExis
public static function isVisibleProvider()
{
return [
[true, false, false],
[false, 'log-exists', true],
[false, false, true],
[true, false, false, true], // first login, no cache, config enabled
[false, false, false, false], // first login, no cache, config disabled
[false, 'log-exists', true, true], // first login, cache exists, config enabled
[false, false, true, true], // first login, cache exists, config enabled
];
}
}
6 changes: 2 additions & 4 deletions app/code/Magento/AdminAnalytics/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
<default>
<admin>
<usage>
<enabled>
1
</enabled>
<enabled>0</enabled>
</usage>
</admin>
</default>
</config>
</config>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
<uiComponent name="admin_usage_notification">
<visibilityCondition name="can_view_admin_usage_notification" className="Magento\AdminAnalytics\Model\Condition\CanViewNotification"/>
</uiComponent>
<block name="tracking_notification" as="tracking_notification" template="Magento_AdminAnalytics::notification.phtml">
<block name="tracking_notification"
as="tracking_notification"
template="Magento_AdminAnalytics::notification.phtml"
ifconfig="admin/usage/enabled">
<arguments>
<argument name="notification" xsi:type="object">Magento\AdminAnalytics\ViewModel\Notification</argument>
</arguments>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<referenceContainer name="header">
<block name="tracking" as="tracking" template="Magento_AdminAnalytics::tracking.phtml" ifconfig="admin/usage/enabled">
<arguments>
<argument name="tracking_url" xsi:type="string">//assets.adobedtm.com/a7d65461e54e/37baabec1b6e/launch-177bc126c8e6.min.js</argument>
<!-- For Mage-OS the tracking_url is empty by default. -->
<argument name="tracking_url" xsi:type="string"/>
<argument name="metadata" xsi:type="object">Magento\AdminAnalytics\ViewModel\Metadata</argument>
</arguments>
</block>
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Backend/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,10 @@ password,password
"Reload Data","Reload Data"
"Browse Files...","Browse Files..."
Magento,Magento
"Mage-OS","Mage-OS"
"Copyright &copy; %1 Magento Commerce Inc. All rights reserved.","Copyright &copy; %1 Magento Commerce Inc. All rights reserved."
"Thank you for choosing Mage-OS.","Thank you for choosing Mage-OS."
"Learn more about Mage-OS.","Learn more about Mage-OS."
"ver. %1","ver. %1"
"Magento Admin Panel","Magento Admin Panel"
"Account Setting","Account Setting"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<move element="logo" destination="login.header" before="-"/>
<referenceBlock name="logo">
<arguments>
<argument name="logo_image_src" xsi:type="string">images/magento-logo.svg</argument>
<argument name="logo_image_src" xsi:type="string">images/mage-os-logo.svg</argument>
</arguments>
</referenceBlock>

Expand Down
Loading

0 comments on commit f128554

Please sign in to comment.