Skip to content

Commit b0d424c

Browse files
committed
Merge branch 'spartans_pr_17102025_AC-15856' of github.com:magento-gl/magento2ce into spartans_pr_17102025_AC-15856
2 parents ef10afa + b8c3e1e commit b0d424c

File tree

52 files changed

+8500
-137
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+8500
-137
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockWithCustomOptionsVisibleInSearchOnlyTest.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@
2929
<createData entity="SimpleSubCategory" stepKey="categoryEntity"/>
3030
</before>
3131
<after>
32-
<actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="openProductCatalogPage1"/>
33-
<actionGroup ref="AdminDeleteAllProductsFromGridActionGroup" stepKey="selectAndDeleteProducts"/>
34-
<actionGroup ref="ClearFiltersAdminProductGridActionGroup" stepKey="clearFilterFromProductIndex"/>
32+
<!-- Delete all products via API -->
33+
<helper class="Magento\Catalog\Test\Mftf\Helper\ProductApiHelper" method="deleteAllProductsApi" stepKey="deleteAllProductsViaApi"/>
3534
<deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/>
3635
<deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/>
3736
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminCreateWidgetWithEnabledBlockActionGroup" extends="AdminCreateWidgetWithBlockActionGroup">
12+
<annotations>
13+
<description>EXTENDS: AdminCreateWidgetWithBlockActionGroup. Creates the provided Widget which includes the provided enabled Block (instead of disabled).</description>
14+
</annotations>
15+
16+
<remove keyForRemoval="chooseStatus"/>
17+
<selectOption selector="{{AdminNewWidgetSection.blockStatus}}" userInput="Enable" stepKey="chooseStatusEnabled" after="waitForLoadBlocks"/>
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
10+
<entity name="DisablePageBuilderConfigData">
11+
<data key="path">cms/pagebuilder/enabled</data>
12+
<data key="value">0</data>
13+
</entity>
14+
<entity name="EnablePageBuilderConfigData">
15+
<data key="path">cms/pagebuilder/enabled</data>
16+
<data key="value">1</data>
17+
</entity>
18+
</entities>

app/code/Magento/LoginAsCustomer/Test/Mftf/ActionGroup/AdminLoginAsCustomerLogFilterDatePickerTodayActionGroup.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
6-
*/
4+
* Copyright 2021 Adobe
5+
* All Rights Reserved.
6+
*/
77
-->
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -15,6 +15,7 @@
1515
<click selector="{{AdminLoginAsCustomerLogToolbarSection.filters}}" stepKey="clickFilters"/>
1616
<click selector="{{AdminLoginAsCustomerLogToolbarSection.DatePickerFrom}}" stepKey="clickFromDate"/>
1717
<click selector="{{AdminLoginAsCustomerLogToolbarSection.todayDate}}" stepKey="clickToToday"/>
18+
<waitForElementClickable selector="{{AdminLoginAsCustomerLogToolbarSection.DatePickerTo}}" stepKey="waitForToDateClickable"/>
1819
<click selector="{{AdminLoginAsCustomerLogToolbarSection.DatePickerTo}}" stepKey="clickToDate"/>
1920
<click selector="{{AdminLoginAsCustomerLogToolbarSection.todayDate}}" stepKey="clickTodayDateAgain"/>
2021
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
Lines changed: 115 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2025 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento\NewRelicReporting\Console\Command;
77

8+
use Magento\Framework\Exception\LocalizedException;
89
use Symfony\Component\Console\Command\Command;
910
use Symfony\Component\Console\Input\InputInterface;
1011
use Symfony\Component\Console\Output\OutputInterface;
1112
use Symfony\Component\Console\Input\InputArgument;
13+
use Symfony\Component\Console\Input\InputOption;
14+
use Symfony\Component\Console\Helper\Table;
15+
use Magento\NewRelicReporting\Model\Config;
1216
use Magento\NewRelicReporting\Model\Apm\DeploymentsFactory;
1317
use Magento\NewRelicReporting\Model\ServiceShellUser;
1418

@@ -17,27 +21,34 @@ class DeployMarker extends Command
1721
/**
1822
* @var DeploymentsFactory
1923
*/
20-
private $deploymentsFactory;
24+
private DeploymentsFactory $deploymentsFactory;
2125

2226
/**
2327
* @var ServiceShellUser
2428
*/
25-
private $serviceShellUser;
29+
private ServiceShellUser $serviceShellUser;
30+
/**
31+
* @var Config
32+
*/
33+
private Config $config;
2634

2735
/**
2836
* Initialize dependencies.
2937
*
3038
* @param DeploymentsFactory $deploymentsFactory
3139
* @param ServiceShellUser $serviceShellUser
32-
* @param ?string $name
40+
* @param Config $config
41+
* @param string|null $name
3342
*/
3443
public function __construct(
3544
DeploymentsFactory $deploymentsFactory,
3645
ServiceShellUser $serviceShellUser,
37-
$name = null
46+
Config $config,
47+
?string $name = null
3848
) {
3949
$this->deploymentsFactory = $deploymentsFactory;
4050
$this->serviceShellUser = $serviceShellUser;
51+
$this->config = $config;
4152
parent::__construct($name);
4253
}
4354

@@ -47,11 +58,11 @@ public function __construct(
4758
protected function configure()
4859
{
4960
$this->setName("newrelic:create:deploy-marker");
50-
$this->setDescription("Check the deploy queue for entries and create an appropriate deploy marker.")
61+
$this->setDescription("Create a deployment marker in New Relic (supports both v2 REST and NerdGraph)")
5162
->addArgument(
5263
'message',
5364
InputArgument::REQUIRED,
54-
'Deploy Message?'
65+
'Deploy Message / Description'
5566
)
5667
->addArgument(
5768
'change_log',
@@ -65,24 +76,110 @@ protected function configure()
6576
)->addArgument(
6677
'revision',
6778
InputArgument::OPTIONAL,
68-
'Revision'
79+
'Revision / Version'
80+
)
81+
->addOption(
82+
'commit',
83+
'c',
84+
InputOption::VALUE_OPTIONAL,
85+
'Git commit hash for this deployment (NerdGraph only)'
86+
)
87+
->addOption(
88+
'deep-link',
89+
'd',
90+
InputOption::VALUE_OPTIONAL,
91+
'Deep link to deployment details (NerdGraph only)'
92+
)
93+
->addOption(
94+
'group-id',
95+
'g',
96+
InputOption::VALUE_OPTIONAL,
97+
'Group ID for organizing deployments (NerdGraph only)'
6998
);
7099
parent::configure();
71100
}
72101

73102
/**
74103
* @inheritdoc
75104
*/
76-
protected function execute(InputInterface $input, OutputInterface $output)
105+
protected function execute(InputInterface $input, OutputInterface $output): int
106+
{
107+
$isEnabled = $this->config->isNewRelicEnabled();
108+
if (!$isEnabled) {
109+
$output->writeln('<error>✗ New Relic is not enabled. Please check your configuration.</error>');
110+
return Command::FAILURE;
111+
}
112+
try {
113+
$result = $this->deploymentsFactory->create()->setDeployment(
114+
$input->getArgument('message'),
115+
$input->getArgument('change_log') ?: false,
116+
$this->serviceShellUser->get($input->getArgument('user')) ?: false,
117+
$input->getArgument('revision'),
118+
$input->getOption('commit'),
119+
$input->getOption('deep-link'),
120+
$input->getOption('group-id')
121+
);
122+
123+
if ($result !== false) {
124+
$output->writeln('<info>✓ NewRelic deployment marker created successfully!</info>');
125+
126+
// Display enhanced details if available (from NerdGraph)
127+
if (is_array($result) && isset($result['deploymentId'])) {
128+
$this->displayDeploymentDetails($output, $result);
129+
}
130+
131+
return Command::SUCCESS;
132+
} else {
133+
$output->writeln('<error>✗ Failed to create deployment marker</error>');
134+
return Command::FAILURE;
135+
}
136+
} catch (\Exception $e) {
137+
$output->writeln('<error>✗ Error: ' . $e->getMessage() . '</error>');
138+
return Command::FAILURE;
139+
}
140+
}
141+
142+
/**
143+
* Display deployment details from NerdGraph response
144+
*
145+
* @param OutputInterface $output
146+
* @param array $deployment
147+
*/
148+
private function displayDeploymentDetails(OutputInterface $output, array $deployment): void
77149
{
78-
$this->deploymentsFactory->create()->setDeployment(
79-
$input->getArgument('message'),
80-
$input->getArgument('change_log'),
81-
$this->serviceShellUser->get($input->getArgument('user')),
82-
$input->getArgument('revision')
83-
);
84-
$output->writeln('<info>NewRelic deployment information sent</info>');
150+
$output->writeln('');
151+
$output->writeln('<comment>Deployment Details:</comment>');
152+
153+
$table = new Table($output);
154+
$table->setHeaders(['Field', 'Value']);
155+
156+
$rows = [
157+
['Deployment ID', $deployment['deploymentId'] ?? 'N/A'],
158+
['Entity GUID', $deployment['entityGuid'] ?? 'N/A'],
159+
['Version', $deployment['version'] ?? 'N/A'],
160+
['Description', $deployment['description'] ?? 'N/A'],
161+
['User', $deployment['user'] ?? 'N/A'],
162+
['Timestamp', $deployment['timestamp'] ?
163+
date(
164+
'Y-m-d H:i:s',
165+
(int)($deployment['timestamp'] / 1000)
166+
) : 'N/A']
167+
];
168+
169+
if (!empty($deployment['changelog'])) {
170+
$rows[] = ['Change log', $deployment['changelog']];
171+
}
172+
if (!empty($deployment['commit'])) {
173+
$rows[] = ['Commit', $deployment['commit']];
174+
}
175+
if (!empty($deployment['deepLink'])) {
176+
$rows[] = ['Deep Link', $deployment['deepLink']];
177+
}
178+
if (!empty($deployment['groupId'])) {
179+
$rows[] = ['Group ID', $deployment['groupId']];
180+
}
85181

86-
return 0;
182+
$table->setRows($rows);
183+
$table->render();
87184
}
88185
}

0 commit comments

Comments
 (0)