Skip to content

Commit

Permalink
Merged PR 51494: Surface hidden import settings to tune bulk sync beh…
Browse files Browse the repository at this point in the history
…aviour

## What's being changed

We've exposed all the batch size configs governing sync behaviour in the admin, in Dotdigital > Developer > Import Settings. We didn't want these to be visible in Reports > Dotdigital > Dashboard so we've removed all configs from the dashboard other than the actual yellow dashboard panel.

## Why it's being changed

We want to enable merchants to more easily use and understand these options for tuning bulk syncs.

## How to review / test this change

- Review the admin UI
- Test updating and saving the values
- Observe the configs are updated in core_config_data
- Remove any import_settings configs from core_config_data, confirm the default values are as expected
- Run Integration Insights sync and see the new values captured as expected

Related work items: #215987
  • Loading branch information
sta1r committed Oct 22, 2024
1 parent db298fd commit d172182
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 203 deletions.
51 changes: 0 additions & 51 deletions Block/Adminhtml/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/
class Dashboard extends \Magento\Backend\Block\Widget\Container
{

/**
* @var string
*/
Expand All @@ -25,55 +24,5 @@ public function _construct()
$this->_controller = 'adminhtml_dashboard';
$this->_headerText = __('Dashboard');
parent::_construct();

/**
* Contact sync.
*/
$this->buttonList->add(
'contact_sync',
[
'label' => __('Run Contact Sync'),
'class' => 'primary'
]
);

/**
* Importer sync.
*/
$this->buttonList->add(
'importer_sync',
[
'label' => __('Run Importer Sync'),
'class' => 'primary'
]
);
}

/**
* Get contact sync link.
*
* @return string
*/
public function getContactSyncLink()
{
return $this->getUrl('dotdigitalgroup_email/run/contactsync');
}

/**
* Get importer link.
*
* @return string
*/
public function getImporterLink()
{
$query = [
'_query' => [
'sync-type' => 'importer'
]
];
return $this->getUrl(
'dotdigitalgroup_email/run/sync',
$query
);
}
}
84 changes: 0 additions & 84 deletions Block/Adminhtml/Dashboard/Configuration.php

This file was deleted.

25 changes: 0 additions & 25 deletions Model/Config/Developer/Transactionaldata.php

This file was deleted.

8 changes: 6 additions & 2 deletions Model/Sync/Integration/DotdigitalConfigInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,17 @@ interface DotdigitalConfigInterface
Config::XML_PATH_CONSENT_CUSTOMER_TEXT,
Config::XML_PATH_CONNECTOR_CLIENT_ID,
Config::XML_PATH_CONNECTOR_SYNC_LIMIT,
Config::XML_PATH_CONNECTOR_TRANSACTIONAL_DATA_SYNC_LIMIT,
Config::XML_PATH_CONNECTOR_ENABLE_SUBSCRIBER_SALES_DATA,
Config::XML_PATH_CONNECTOR_SYNC_BREAK_VALUE,
Config::XML_PATH_CONNECTOR_MEGA_BATCH_SIZE_ORDERS,
Config::XML_PATH_CONNECTOR_MEGA_BATCH_SIZE_CATALOG,
Config::XML_PATH_CONNECTOR_MEGA_BATCH_SIZE_CONTACT,
Config::XML_PATH_CONNECTOR_CUSTOM_DOMAIN,
Config::XML_PATH_CONNECTOR_CUSTOM_AUTHORIZATION,
Config::XML_PATH_CONNECTOR_ADVANCED_DEBUG_ENABLED,
Config::XML_PATH_CONNECTOR_DEBUG_API_REQUEST_LIMIT,
Config::XML_PATH_CONNECTOR_TRANSACTIONAL_DATA_SYNC_LIMIT,
Config::XML_PATH_CONNECTOR_IP_RESTRICTION_ADDRESSES,
Config::XML_PATH_CONNECTOR_ENABLE_SUBSCRIBER_SALES_DATA,
Config::XML_PATH_CONNECTOR_STRIP_PUB,
Config::XML_PATH_CONNECTOR_SYSTEM_ALERTS_SYSTEM_MESSAGES,
Config::XML_PATH_CONNECTOR_SYSTEM_ALERTS_EMAIL_NOTIFICATIONS,
Expand Down
50 changes: 33 additions & 17 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1734,36 +1734,52 @@
<label>Developer</label>
<tab>ddg_automation</tab>
<resource>Dotdigitalgroup_Email::config</resource>
<group id="import_settings" translate="label" sortOrder="10" showInDefault="1" showInWebsite="1"
showInStore="0">
<group id="import_settings" translate="label" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Import Settings</label>
<field id="batch_size" translate="label" sortOrder="20" showInStore="0" showInWebsite="1"
showInDefault="1">
<label>Contact Sync Size</label>
<comment><![CDATA[Configuration for bulk syncs. Use these options to tune the rate at which data is exported out of Magento and imported into Dotdigital. <a href="https://support.dotdigital.com/en/articles/8199588-edit-data-synchronisation-settings-in-magento-open-source-and-adobe-commerce#h_398b799dd3" target="_blank">Learn more</a>.]]></comment>

<field id="contact_syncs_heading" translate="label" sortOrder="5" showInStore="1" showInWebsite="1" showInDefault="1">
<label>Contact syncs</label>
<frontend_model>Magento\Config\Block\System\Config\Form\Field\Heading</frontend_model>
</field>
<field id="batch_size" translate="label" sortOrder="10" showInStore="0" showInWebsite="1" showInDefault="1" canRestore="1">
<label>Contact sync batch size</label>
<comment><![CDATA[Batch size is the database query limit. Applies to Customer, Subscriber and Guest syncs.]]></comment>
</field>
<field id="mega_batch_size_contact" translate="label" sortOrder="15" showInStore="0" showInWebsite="0" showInDefault="1" canRestore="1">
<label>Contact sync mega batch size</label>
<comment><![CDATA[The number of objects we send in a single payload of JSON to the Dotdigital API. Applies to Customer, Subscriber and Guest syncs.]]></comment>
</field>
<field id="mega_batch_size_orders" translate="label" sortOrder="5" type="select" showInStore="0" showInWebsite="0" showInDefault="0">
<field id="insight_data_syncs_heading" translate="label" sortOrder="20" showInStore="1" showInWebsite="1" showInDefault="1">
<label>Insight data syncs</label>
<frontend_model>Magento\Config\Block\System\Config\Form\Field\Heading</frontend_model>
</field>
<field id="transactional_data" translate="label" sortOrder="25" showInStore="0" showInWebsite="0" showInDefault="1" canRestore="1">
<label>Transactional data batch size</label>
<comment><![CDATA[Batch size is the database query limit. Applies to order, catalog, review and wishlist syncs.]]></comment>
</field>
<field id="mega_batch_size_orders" translate="label" sortOrder="30" showInStore="0" showInWebsite="0" showInDefault="1" canRestore="1">
<label>Order sync mega batch size</label>
<comment><![CDATA[The number of objects we send in a single payload of JSON to the Dotdigital API.]]></comment>
</field>
<field id="mega_batch_size_catalog" translate="label" sortOrder="5" type="select" showInStore="0" showInWebsite="0" showInDefault="0">
<field id="mega_batch_size_catalog" translate="label" sortOrder="35" showInStore="0" showInWebsite="0" showInDefault="1" canRestore="1">
<label>Catalog sync mega batch size</label>
<comment><![CDATA[The number of objects we send in a single payload of JSON to the Dotdigital API.]]></comment>
</field>
<field id="mega_batch_size_contact" translate="label" sortOrder="5" type="select" showInStore="0" showInWebsite="0" showInDefault="0">
<label>Contact sync mega batch size</label>
</field>
<field id="transactional_data" translate="label" sortOrder="30" type="select" showInStore="0"
showInWebsite="0" showInDefault="1">
<label>Transactional Data Sync Size</label>
<source_model>Dotdigitalgroup\Email\Model\Config\Developer\Transactionaldata</source_model>
<field id="additional_import_settings_heading" translate="label" sortOrder="40" showInStore="1" showInWebsite="1" showInDefault="1">
<label>Additional settings</label>
<frontend_model>Magento\Config\Block\System\Config\Form\Field\Heading</frontend_model>
</field>
<field id="transactional_data_break" translate="label" sortOrder="35" showInStore="0" showInWebsite="0" showInDefault="0">
<field id="transactional_data_break" translate="label" sortOrder="45" showInStore="0" showInWebsite="0" showInDefault="1" canRestore="1">
<label>Transactional data break</label>
<comment><![CDATA[Limits the number of rows processed in a single sync. Applies to Customer, Subscriber, Guest, Order and Catalog syncs.]]></comment>
</field>
<field id="subscriber_sales_data_enabled" type="select" sortOrder="40" showInDefault="1" showInStore="0" showInWebsite="1">
<field id="subscriber_sales_data_enabled" type="select" sortOrder="50" showInDefault="1" showInStore="0" showInWebsite="1">
<label>Enable Subscribers Sales Data Sync</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment><![CDATA[Enabling ability to sync subscribers sales data increases server load and overall sync times.]]></comment>
</field>
<field id="strip_pub_from_media_paths" translate="label" sortOrder="50" type="select" showInStore="0"
<field id="strip_pub_from_media_paths" translate="label" sortOrder="55" type="select" showInStore="0"
showInWebsite="0" showInDefault="1">
<label>Remove /pub directory from URLs</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
Expand Down
11 changes: 0 additions & 11 deletions etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -301,17 +301,6 @@
<mega_batch_size_catalog>5000</mega_batch_size_catalog>
<mega_batch_size_contact>2000</mega_batch_size_contact>
</import_settings>
<sync_settings>
<setup_data_fields></setup_data_fields>
<contact_sync></contact_sync>
<subscriber_sync></subscriber_sync>
<order_sync></order_sync>
<delete_contact></delete_contact>
<reimport_customers></reimport_customers>
<reimport_subscribers></reimport_subscribers>
<reimport_orders></reimport_orders>
<suppressed_contacts></suppressed_contacts>
</sync_settings>
<debug>
<debug_enabled>0</debug_enabled>
<api_log_time>60</api_log_time>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
</arguments>
</block>
</block>
<block class="Dotdigitalgroup\Email\Block\Adminhtml\Dashboard\Configuration" name="dotdigitalgroup.email.dashboard_config"/>
</referenceContainer>
</body>
</page>
12 changes: 0 additions & 12 deletions view/adminhtml/templates/dashboard/main.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,4 @@
</div>
</div>

<?= $block->getChildHtml('dotdigitalgroup.email.dashboard_config') ?>

<script type="text/x-magento-init">
{
"*": {
"Dotdigitalgroup_Email/js/dashboard":{
"contactLink":"<?= $block->escapeUrl($block->getContactSyncLink()); ?>",
"importerLink":"<?= $block->escapeUrl($block->getImporterLink()); ?>"
}
}
}
</script>
<?php // phpcs:enable ?>

0 comments on commit d172182

Please sign in to comment.