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
mage-os-ci authored Dec 5, 2023
2 parents 2c3cbff + fdbc879 commit 42d810b
Show file tree
Hide file tree
Showing 90 changed files with 538 additions and 283 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
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
17 changes: 17 additions & 0 deletions .github/workflows/coding-standard-baseline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Coding Standard With Baseline
on:
pull_request:
branches:
- 2.4-develop
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}}

13 changes: 13 additions & 0 deletions .github/workflows/full-integration-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Integration Tests - Full Test Suite
run-name: ${{ github.actor }} is running Full Integration Test Suite
on:
workflow_dispatch: {}

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 }}
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 }}
19 changes: 19 additions & 0 deletions .github/workflows/nx-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Integration Tests (Using Nx)
run-name: ${{ github.actor }} is running Integration Tests
on:
pull_request:
branches:
- 2.4-develop

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 }}
13 changes: 13 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Unit Tests
run-name: ${{ github.actor }} is running Unit Tests
on:
pull_request:
branches:
- 2.4-develop

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 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
4 changes: 2 additions & 2 deletions app/code/Magento/Backend/Model/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function add(Item $item, $parentId = null, $index = null)
$index = (int) $index;
if (!isset($this[$index])) {
$this->offsetSet($index, $item);
$this->_logger->info(
$this->_logger->debug(
sprintf('Add of item with id %s was processed', $item->getId())
);
} else {
Expand Down Expand Up @@ -151,7 +151,7 @@ public function remove($itemId)
if ($item->getId() == $itemId) {
unset($this[$key]);
$result = true;
$this->_logger->info(
$this->_logger->debug(
sprintf('Remove on item with id %s was processed', $item->getId())
);
break;
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/Model/Menu/Director/Director.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected function _getCommand($data, $logger)
{
$command = $this->_commandFactory->create($data['type'], ['data' => $data]);
if (isset($this->_messagePatterns[$data['type']])) {
$logger->info(
$logger->debug(
sprintf($this->_messagePatterns[$data['type']], $command->getId())
);
}
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
6 changes: 3 additions & 3 deletions app/code/Magento/Backend/view/adminhtml/layout/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<arguments>
<argument name="show_part" xsi:type="string">logo</argument>
<argument name="edition" translate="true" xsi:type="string">Community Edition</argument>
<argument name="logo_image_src" xsi:type="string">images/magento-icon.svg</argument>
<argument name="logo_image_src" xsi:type="string">images/mage-os-icon.svg</argument>
</arguments>
</block>
<block class="Magento\Backend\Block\GlobalSearch" name="global.search" as="search" after="logo" aclResource="Magento_Backend::global_search"/>
Expand Down Expand Up @@ -63,12 +63,12 @@
<block class="Magento\Backend\Block\Page\Footer" name="version" as="version" />
<block class="Magento\Framework\View\Element\Template" name="privacyPolicy" as="privacyPolicy" template="Magento_Backend::page/privacyPolicy.phtml">
<arguments>
<argument name="privacypolicy_url" xsi:type="string">https://www.adobe.com/privacy/policy.html</argument>
<argument name="privacypolicy_url" xsi:type="string">https://mage-os.org/privacy-policy</argument>
</arguments>
</block>
<block class="Magento\Framework\View\Element\Template" name="report" as="report" template="Magento_Backend::page/report.phtml">
<arguments>
<argument name="bugreport_url" xsi:type="string">https://github.com/magento/magento2/issues</argument>
<argument name="bugreport_url" xsi:type="string">https://github.com/mage-os/mageos-magento2/issues</argument>
</arguments>
</block>
</container>
Expand Down
Loading

0 comments on commit 42d810b

Please sign in to comment.