Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
d2efce6
feat: add error resolution ui draft
larskemper Sep 8, 2025
bc33763
fix: smells
larskemper Oct 28, 2025
c405900
Merge remote-tracking branch 'origin/feature/migration-logging-refact…
larskemper Nov 3, 2025
7b6c830
chore: resolve conflicts
larskemper Nov 3, 2025
da80c24
fix: resolution modal scss
larskemper Nov 3, 2025
ef8ff1c
feat: add error table logic
larskemper Nov 3, 2025
8e93bc2
feat: add loading state to download button
larskemper Nov 3, 2025
342ce06
feat: add missing snippets
larskemper Nov 3, 2025
c0486dd
fix: abort of migration
larskemper Nov 3, 2025
1fc6070
chore: sync package lock
larskemper Nov 3, 2025
43a805f
refactor: simplify param validation
larskemper Nov 3, 2025
33329c4
fix: ci
larskemper Nov 3, 2025
be142ef
fix: tab title in error step
larskemper Nov 3, 2025
eab2b67
feat: fetch total unfixable errors
larskemper Nov 3, 2025
815c514
fix: flicker loading
larskemper Nov 4, 2025
72caee7
feat: add resolution modal data loading
larskemper Nov 4, 2025
2af978d
fix: resolution modal pagination
larskemper Nov 4, 2025
4caf140
feat: display converted and source data in error resolution details m…
larskemper Nov 4, 2025
7d70832
feat: add functionality to select all logs in error resolution modal
larskemper Nov 4, 2025
6dd011b
chore: sync package-lock.json with package.json
larskemper Nov 4, 2025
e87eb03
fix: deselect all
larskemper Nov 4, 2025
8dc0f38
feat: add de snippets
larskemper Nov 4, 2025
8dc4184
feat: add non visible fields optional to grids
larskemper Nov 5, 2025
a160fba
chore: revert package changes
larskemper Nov 5, 2025
5e49dad
fix: details modal height & scroll behavior
larskemper Nov 5, 2025
1a96f21
fix: use correct number type
larskemper Nov 5, 2025
6d8fb9b
fix: fetch the right run
larskemper Nov 5, 2025
bcef2f9
refactor: optimize column selection
larskemper Nov 5, 2025
5e717a4
feat: emit scalar field value change
larskemper Nov 5, 2025
9e262a0
feat: correct displaying of relation fields
larskemper Nov 5, 2025
0f08e11
feat: emit relation field value
larskemper Nov 5, 2025
de64d73
feat: add fallback recognition for version relation fields
larskemper Nov 5, 2025
c8b170c
docs: add comments to logic
larskemper Nov 5, 2025
39a0649
refactor: cleanup
larskemper Nov 5, 2025
6702f4e
feat: add unhandled field
larskemper Nov 5, 2025
9ba6dc3
fix: display correct error count and fix z-index issue in modal.
larskemper Nov 5, 2025
a4b998a
feat: add no options warning
larskemper Nov 6, 2025
2df60c9
feat: add link to not found entity
larskemper Nov 6, 2025
f177345
fix: disable relation field if no options are found
larskemper Nov 6, 2025
f98b4cb
feat: prepare creation of fixes
larskemper Nov 6, 2025
277341c
fix: error notification
larskemper Nov 6, 2025
e4a4d08
feat: add sorting for step table
larskemper Nov 10, 2025
925604a
Merge remote-tracking branch 'origin/feature/migration-logging-refact…
larskemper Nov 10, 2025
b6aa491
fix: adopt new migration fix data structure
larskemper Nov 10, 2025
3585393
fix: extract entity collection ids & validate invalid log data
larskemper Nov 10, 2025
9a89ff4
feat: add first poc of fetching fixed errors
larskemper Nov 10, 2025
f9fda19
Merge branch 'feature/migration-logging-refactor' into feat/add-error…
larskemper Nov 12, 2025
548ad92
fix: parse value of unhandeled fields correctly
larskemper Nov 12, 2025
0e12990
fix: status controller test
larskemper Nov 12, 2025
62f7da9
fix: use code where usefull
larskemper Nov 12, 2025
31f27e3
feat: add log filter component
larskemper Nov 12, 2025
6091d88
feat: add fix value to modal grid if available
larskemper Nov 12, 2025
29c6410
fix: resolved marking
larskemper Nov 12, 2025
189b980
refactor: reduce mutations
larskemper Nov 12, 2025
7ca89fd
feat: add search to log filter
larskemper Nov 12, 2025
5a8ca2b
refactor: extract log code in own service
larskemper Nov 12, 2025
872dbe2
fix: unwrap not needed json
larskemper Nov 12, 2025
b6a2fe7
refactor: cleanup
larskemper Nov 13, 2025
6f321e8
refactor: adjust filter popover to updated screen design
larskemper Nov 13, 2025
6f96ec5
fix: service config
larskemper Nov 13, 2025
b3168d7
refactor: display more options for filtering
larskemper Nov 13, 2025
9a91028
feat: add block for extension
larskemper Nov 13, 2025
af78a7f
feat: hide source data in details modal if empty
larskemper Nov 13, 2025
d2ddee2
fix: select all unresolved ids
larskemper Nov 13, 2025
52c06fa
fix: gateway registry arguments
larskemper Nov 14, 2025
0396106
feat: remove support call to action
larskemper Nov 19, 2025
58980c3
feat: add log table empty state
larskemper Nov 19, 2025
fbba675
feat: add filter count badge
larskemper Nov 19, 2025
2dd0e73
fix: truncate long text values
larskemper Nov 19, 2025
9395d7d
fix: add divider to small viewport stepper
larskemper Nov 19, 2025
3802a16
fix: count query & continue modal
larskemper Nov 19, 2025
c9eedcc
fix: preselection of detail table
larskemper Nov 19, 2025
25be402
feat: use human readable error names
larskemper Nov 19, 2025
f0ab5d0
refactor: apply fixes from test branch
larskemper Nov 19, 2025
fe6a479
fix: minor adjustments
larskemper Nov 20, 2025
93087b9
fix: further adjustments
larskemper Nov 20, 2025
f1afd79
refactor: details modal
larskemper Nov 20, 2025
0a23e3d
refactor: apply adjustments from test branch
larskemper Nov 25, 2025
6920a9c
fix: re-apply table identifer
larskemper Nov 25, 2025
cb54c2f
refactor: controller param default values & clearer validation
larskemper Nov 25, 2025
35cacf4
refactor: extract log group types
larskemper Nov 25, 2025
baf24a0
fix: flag log grouping service as internal
larskemper Nov 25, 2025
b7d3fea
refactor: use plain sql to fetch connection
larskemper Nov 25, 2025
078f3a2
fix: delete unused order by
larskemper Nov 25, 2025
5da6b1e
refactor: simplify & document log grouping service
larskemper Nov 25, 2025
4c0b20d
fix: return types & optional chains
larskemper Nov 25, 2025
3008b30
fix: consistent modal close event naming
larskemper Nov 25, 2025
7666996
Merge remote-tracking branch 'origin/feature/migration-logging-refact…
larskemper Nov 25, 2025
37565dd
refactor: simplify log options fetching
larskemper Nov 25, 2025
4afe377
feat: give user feedback on json input
larskemper Nov 25, 2025
7646beb
fix: correctly check snippet existenz
larskemper Nov 26, 2025
6f47e7b
fix: duplicate border in premapping grid
larskemper Nov 26, 2025
f5cccec
refactor: translation suffix length calculation
larskemper Nov 27, 2025
246062a
refactor: get rid of helper func
larskemper Nov 27, 2025
ad8674f
refactor: type case constants instead of dynamic values
larskemper Nov 27, 2025
4c89f08
refactor: use entity definition is many to many association check
larskemper Nov 27, 2025
d3ee211
refactor: fallback to alphabetic ordering for priority fields
larskemper Nov 27, 2025
131ad6f
fix: snippets
larskemper Nov 27, 2025
ef78152
refactor: more efficent association field find
larskemper Nov 27, 2025
77253c2
fix: bug
larskemper Nov 27, 2025
4a4b5e6
refactor: simplify log filter
larskemper Nov 28, 2025
9ed7481
fix: revert package-lock
larskemper Nov 28, 2025
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
107 changes: 104 additions & 3 deletions src/Controller/HistoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Shopware\Core\Framework\Routing\RoutingException;
use SwagMigrationAssistant\Exception\MigrationException;
use SwagMigrationAssistant\Migration\History\HistoryServiceInterface;
use SwagMigrationAssistant\Migration\History\LogGroupingServiceInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\HeaderUtils;
use Symfony\Component\HttpFoundation\JsonResponse;
Expand All @@ -25,11 +26,13 @@
#[Package('fundamentals@after-sales')]
class HistoryController extends AbstractController
{
public function __construct(private readonly HistoryServiceInterface $historyService)
{
public function __construct(
private readonly HistoryServiceInterface $historyService,
private readonly LogGroupingServiceInterface $logGroupingService,
) {
}

#[Route(path: '/api/migration/get-grouped-logs-of-run', name: 'api.admin.migration.get-grouped-logs-of-run', methods: ['GET'], defaults: ['_acl' => ['swag_migration.viewer']])]
#[Route(path: '/api/_action/migration/get-grouped-logs-of-run', name: 'api.admin.migration.get-grouped-logs-of-run', methods: ['GET'], defaults: ['_acl' => ['swag_migration.viewer']])]
public function getGroupedLogsOfRun(Request $request, Context $context): JsonResponse
{
$runUuid = $request->query->getAlnum('runUuid');
Expand Down Expand Up @@ -105,4 +108,102 @@ public function isMediaProcessing(): JsonResponse

return new JsonResponse($result);
}

#[Route(
path: '/api/_action/migration/get-log-groups',
name: 'api.admin.migration.get-log-groups',
methods: ['GET'],
defaults: ['_acl' => ['swag_migration.viewer']]
)]
public function getLogGroups(Request $request, Context $context): JsonResponse
{
$runId = $request->query->getAlnum('runId');

if (empty($runId)) {
throw RoutingException::missingRequestParameter('runId');
}

$level = $request->query->getAlpha('level');

if (empty($level)) {
throw RoutingException::missingRequestParameter('level');
}

$page = $request->query->getInt('page', 1);
$limit = $request->query->getInt('limit', 25);

$sortBy = $request->query->getAlpha('sortBy') ?: 'count';
$sortDirection = $request->query->getAlpha('sortDirection') ?: 'DESC';

if (!\in_array(\strtoupper($sortDirection), ['ASC', 'DESC'], true)) {
$sortDirection = 'DESC';
}

$filterCode = $request->query->get('filterCode');
$filterStatus = $request->query->get('filterStatus');
$filterEntity = $request->query->get('filterEntity');
$filterField = $request->query->get('filterField');

$result = $this->logGroupingService->getGroupedLogsByCodeAndEntity(
$runId,
$level,
$page,
$limit,
$sortBy,
\strtoupper($sortDirection),
\is_string($filterCode) && !empty($filterCode) ? $filterCode : null,
\is_string($filterStatus) && !empty($filterStatus) ? $filterStatus : null,
\is_string($filterEntity) && !empty($filterEntity) ? $filterEntity : null,
\is_string($filterField) && !empty($filterField) ? $filterField : null,
);

return new JsonResponse($result);
}

#[Route(
path: '/api/_action/migration/get-all-log-ids',
name: 'api.admin.migration.get-all-log-ids',
methods: ['POST'],
defaults: ['_acl' => ['swag_migration.viewer']]
)]
public function getAllLogIds(Request $request): JsonResponse
{
$runId = $request->request->getAlnum('runId');

if (empty($runId)) {
throw RoutingException::missingRequestParameter('runId');
}

$code = $request->request->get('code');

if (!\is_string($code) || empty($code)) {
throw RoutingException::missingRequestParameter('code');
}

$entityName = $request->request->get('entityName');

if (!\is_string($entityName) || empty($entityName)) {
throw RoutingException::missingRequestParameter('entityName');
}

$fieldName = $request->request->get('fieldName');

if (!\is_string($fieldName) || empty($fieldName)) {
throw RoutingException::missingRequestParameter('fieldName');
}

$connectionId = $request->request->getAlnum('connectionId');

$logIds = $this->logGroupingService->getAllLogIdsByCodeAndEntity(
$runId,
$code,
$entityName,
$fieldName,
!empty($connectionId) ? $connectionId : null
);

return new JsonResponse([
'ids' => $logIds,
]);
}
}
20 changes: 12 additions & 8 deletions src/Controller/StatusController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
use Shopware\Core\Framework\Routing\RoutingException;
use SwagMigrationAssistant\Exception\MigrationException;
use SwagMigrationAssistant\Migration\Connection\SwagMigrationConnectionCollection;
use SwagMigrationAssistant\Migration\Connection\SwagMigrationConnectionEntity;
use SwagMigrationAssistant\Migration\DataSelection\DataSelectionRegistryInterface;
use SwagMigrationAssistant\Migration\Gateway\GatewayRegistryInterface;
use SwagMigrationAssistant\Migration\MigrationContext;
use SwagMigrationAssistant\Migration\MigrationContextFactoryInterface;
use SwagMigrationAssistant\Migration\Profile\ProfileRegistryInterface;
use SwagMigrationAssistant\Migration\Run\RunServiceInterface;
Expand Down Expand Up @@ -88,7 +90,10 @@ public function getProfileInformation(Request $request): Response
}

$profile = $this->profileRegistry->getProfile($profileName);
$gateways = $this->gatewayRegistry->getGateways($profile);
$context = new MigrationContext(new SwagMigrationConnectionEntity());
$context->setProfile($profile);

$gateways = $this->gatewayRegistry->getGateways($context);

$currentGateway = null;
foreach ($gateways as $gateway) {
Expand Down Expand Up @@ -152,7 +157,10 @@ public function getGateways(Request $request): JsonResponse
}

$profile = $this->profileRegistry->getProfile($profileName);
$gateways = $this->gatewayRegistry->getGateways($profile);
$context = new MigrationContext(new SwagMigrationConnectionEntity());
$context->setProfile($profile);

$gateways = $this->gatewayRegistry->getGateways($context);

$gatewayNames = [];
foreach ($gateways as $gateway) {
Expand Down Expand Up @@ -318,11 +326,7 @@ public function approveFinishedMigration(Context $context): Response
)]
public function abortMigration(Context $context): Response
{
try {
$this->runService->abortMigration($context);
} catch (\Exception $e) {
return new Response($e->getMessage(), Response::HTTP_BAD_REQUEST);
}
$this->runService->abortMigration($context);

return new Response(null, Response::HTTP_NO_CONTENT);
}
Expand Down Expand Up @@ -360,7 +364,7 @@ public function cleanupMigrationData(Context $context): Response
}

#[Route(
path: '/api/_action/migration/get-reset-status',
path: '/api/_action/migration/is-truncating-migration-data',
name: 'api.admin.migration.get-reset-status',
defaults: ['_acl' => ['swag_migration.viewer']],
methods: [Request::METHOD_GET]
Expand Down
5 changes: 5 additions & 0 deletions src/DependencyInjection/migration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@
<argument type="service" id="Doctrine\DBAL\Connection"/>
</service>

<service id="SwagMigrationAssistant\Migration\History\LogGroupingService">
<argument type="service" id="Doctrine\DBAL\Connection"/>
</service>

<service id="SwagMigrationAssistant\Migration\History\HistoryService">
<argument type="service" id="swag_migration_logging.repository"/>
<argument type="service" id="swag_migration_run.repository"/>
Expand Down Expand Up @@ -279,6 +283,7 @@

<service id="SwagMigrationAssistant\Controller\HistoryController" public="true">
<argument type="service" id="SwagMigrationAssistant\Migration\History\HistoryService"/>
<argument type="service" id="SwagMigrationAssistant\Migration\History\LogGroupingService"/>

<call method="setContainer">
<argument type="service" id="service_container"/>
Expand Down
5 changes: 3 additions & 2 deletions src/Migration/Gateway/GatewayRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use Shopware\Core\Framework\Log\Package;
use SwagMigrationAssistant\Exception\MigrationException;
use SwagMigrationAssistant\Migration\MigrationContextInterface;
use SwagMigrationAssistant\Migration\Profile\ProfileInterface;

#[Package('fundamentals@after-sales')]
class GatewayRegistry implements GatewayRegistryInterface
Expand All @@ -25,8 +24,10 @@ public function __construct(private readonly iterable $gateways)
/**
* @return GatewayInterface[]
*/
public function getGateways(ProfileInterface $profile): array
public function getGateways(MigrationContextInterface $migrationContext): array
{
$profile = $migrationContext->getProfile();

$gateways = [];
foreach ($this->gateways as $gateway) {
if ($gateway->supports($profile)) {
Expand Down
3 changes: 1 addition & 2 deletions src/Migration/Gateway/GatewayRegistryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@

use Shopware\Core\Framework\Log\Package;
use SwagMigrationAssistant\Migration\MigrationContextInterface;
use SwagMigrationAssistant\Migration\Profile\ProfileInterface;

#[Package('fundamentals@after-sales')]
interface GatewayRegistryInterface
{
/**
* @return GatewayInterface[]
*/
public function getGateways(ProfileInterface $profile): array;
public function getGateways(MigrationContextInterface $migrationContext): array;

/**
* Selects the correct gateway by the given migration context
Expand Down
Loading
Loading