Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 16.0.0
- [BREAKING] [#94](https://github.com/shopware/SwagMigrationAssistant/pull/94): chore!: check naming consistency across error resolution
- [BREAKING] [#38](https://github.com/shopware/SwagMigrationAssistant/pull/38) feat!: add migration logging required fields
- [BREAKING] [#40](https://github.com/shopware/SwagMigrationAssistant/pull/40) refactor!: add migration logging optional fields
- [BREAKING] [#43](https://github.com/shopware/SwagMigrationAssistant/pull/43) refactor!: migration connection usage
Expand Down Expand Up @@ -57,7 +58,7 @@
- MIG-1016 - Improves the warnings for different default currency and default language in the data selection.
- MIG-1016 - Added new block `{% block swag_migration_confirm_warning_alert %}` in `swag-migration/component/card/swag-migration-confirm-warning/swag-migration-confirm-warning.html.twig`.
- MIG-1037 - Fixes a rare issue that in certain situations not all entities are migrated (some were skipped). Was detected during translations of SW5.

# 13.0.0
- MIG-945 - [BREAKING] Changed method name `getMedia` to `setMedia` in `SwagMigrationAssistant\Profile\Shopware\Converter\PropertyGroupOptionConverter`
- MIG-945 - [BREAKING] Removed cli command `migration:migrate` use `migration:start` instead
Expand Down Expand Up @@ -158,7 +159,7 @@
- MIG-943 - [BREAKING] Rename method in class `\SwagMigrationAssistant\Profile\Shopware\Converter\OrderConverter` from `getCountryTranslation` to `applyCountryTranslation`
- MIG-943 - [BREAKING] Rename method in class `\SwagMigrationAssistant\Profile\Shopware\Converter\OrderConverter` from `getCountryStateTranslation` to `applyCountryStateTranslation`
- MIG-943 - [BREAKING] Changed thrown exception from `AssociationEntityRequiredMissingException` to `SwagMigrationAssistant\Exception\MigrationException::associationMissing` in method `\SwagMigrationAssistant\Profile\Shopware\Converter\OrderConverter::convert`
- MIG-967, MIG-866 - Improving the migration of order documents
- MIG-967, MIG-866 - Improving the migration of order documents

# 10.0.1
- MIG-971 - Fix compatibility with Shopware 6.6.0.x
Expand Down
5 changes: 4 additions & 1 deletion UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# 16.0.0

- [BREAKING] [#94](https://github.com/shopware/SwagMigrationAssistant/pull/94) - chore!: check naming consistency across error resolution
- [BREAKING] Renamed method `hasValidMappingByEntityUuid()` to `hasValidMappingByEntityId()` in `SwagMigrationAssistant\Migration\Mapping\MappingServiceInterface` and implementation `SwagMigrationAssistant\Migration\Mapping\MappingService`

- [BREAKING] [#38](https://github.com/shopware/SwagMigrationAssistant/pull/38) - feat!: add migration logging required fields
- [BREAKING] Truncated database entries of `swag_migration_logging` with `SwagMigrationAssistant\Core\Migration\Migration1754896654TruncateMigrationLogs`
- [BREAKING] Deleted columns `title`, `description`, `paramenters`, `title_snippet`, `description_snippet`, `entity` and `source_id` from `swag_migration_logging` with `SwagMigrationAssistant\Core\Migration\Migration1754897550AddRequiredFieldsToMigrationLogs`
Expand All @@ -20,7 +23,7 @@
- extend `SwagMigrationAssistant\Migration\Logging\Log\Builder\AbstractSwagMigrationLogEntry` instead of `SwagMigrationAssistant\Migration\Logging\Log\BaseRunLogEntity`
- implement `SwagMigrationAssistant\Migration\Logging\Log\Builder\SwagMigrationLogEntry` instead of `SwagMigrationAssistant\Migration\Logging\Log\LogEntryInterface`
- mark class readonly
- [BREAKING] Renamed log classes to include `Log` suffix
- [BREAKING] Renamed log classes to include `Log` suffix
- `SwagMigrationAssistant\Migration\Logging\LogCannotConvertChildEntity`,
- `SwagMigrationAssistant\Migration\Logging\LogCannotConvertEntity`,
- `SwagMigrationAssistant\Migration\Logging\LogDocumentTypeNotSupported`,
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Field/AnyJsonField.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* @internal
*/
#[Package('after-sales')]
#[Package('fundamentals@after-sales')]
class AnyJsonField extends Field implements StorageAware
{
public function __construct(
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Field/AnyJsonFieldSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* @internal
*/
#[Package('after-sales')]
#[Package('fundamentals@after-sales')]
class AnyJsonFieldSerializer extends AbstractFieldSerializer
{
public function encode(Field $field, EntityExistence $existence, KeyValuePair $data, WriteParameterBag $parameters): \Generator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* @internal
*/
#[Package('after-sales')]
#[Package('fundamentals@after-sales')]
class Migration1762346793RenameColumnOfMappingTable extends MigrationStep
{
use ColumnExistsTrait;
Expand Down
3 changes: 1 addition & 2 deletions src/DependencyInjection/entity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<tag name="shopware.entity.definition" entity="swag_migration_connection"/>
</service>

<service id="SwagMigrationAssistant\Migration\MigrationFix\SwagMigrationFixDefinition">
<service id="SwagMigrationAssistant\Migration\ErrorResolution\Entity\SwagMigrationFixDefinition">
<tag name="shopware.entity.definition" entity="swag_migration_fix"/>
</service>

Expand All @@ -56,6 +56,5 @@

<tag name="shopware.field_serializer"/>
</service>

</services>
</container>
6 changes: 3 additions & 3 deletions src/DependencyInjection/migration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
<argument type="service" id="SwagMigrationAssistant\Migration\Logging\LoggingService"/>
<argument type="service" id="SwagMigrationAssistant\Migration\Data\SwagMigrationDataDefinition"/>
<argument type="service" id="SwagMigrationAssistant\Migration\Mapping\MappingService"/>
<argument type="service" id="SwagMigrationAssistant\Migration\Validation\SwagMigrationValidationService"/>
<argument type="service" id="SwagMigrationAssistant\Migration\Validation\MigrationValidationService"/>
</service>

<service id="SwagMigrationAssistant\Migration\Service\MigrationDataWriter" public="true">
Expand All @@ -236,7 +236,7 @@
<argument type="service" id="SwagMigrationAssistant\Migration\Logging\LoggingService"/>
<argument type="service" id="SwagMigrationAssistant\Migration\Data\SwagMigrationDataDefinition"/>
<argument type="service" id="swag_migration_mapping.repository"/>
<argument type="service" id="SwagMigrationAssistant\Migration\Writer\MigrationFix\MigrationFixApplier"/>
<argument type="service" id="SwagMigrationAssistant\Migration\ErrorResolution\MigrationErrorResolutionService"/>
</service>

<service id="SwagMigrationAssistant\Migration\Service\MediaFileProcessorService" public="true">
Expand Down Expand Up @@ -416,7 +416,7 @@
id="SwagMigrationAssistant\Core\Content\Product\Stock\StockStorageDecorator.inner"/>
</service>

<service id="SwagMigrationAssistant\Migration\Validation\SwagMigrationValidationService">
<service id="SwagMigrationAssistant\Migration\Validation\MigrationValidationService">
<argument type="service" id="Shopware\Core\Framework\DataAbstractionLayer\DefinitionInstanceRegistry"/>
<argument type="service" id="Symfony\Component\EventDispatcher\EventDispatcherInterface"/>
<argument type="service" id="SwagMigrationAssistant\Migration\Logging\LoggingService"/>
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/writer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
<tag name="shopware.migration.writer"/>
</service>

<service id="SwagMigrationAssistant\Migration\Writer\MigrationFix\MigrationFixApplier">
<service id="SwagMigrationAssistant\Migration\ErrorResolution\MigrationErrorResolutionService">
<argument type="service" id="Doctrine\DBAL\Connection"/>
</service>
</services>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
* file that was distributed with this source code.
*/

namespace SwagMigrationAssistant\Migration\MigrationFix;
namespace SwagMigrationAssistant\Migration\ErrorResolution\Entity;

use Shopware\Core\Framework\DataAbstractionLayer\EntityCollection;
use Shopware\Core\Framework\Log\Package;

/**
* @extends EntityCollection<SwagMigrationFixEntity>
*/
#[Package('after-sales')]
#[Package('fundamentals@after-sales')]
class SwagMigrationFixCollection extends EntityCollection
{
protected function getExpectedClass(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* file that was distributed with this source code.
*/

namespace SwagMigrationAssistant\Migration\MigrationFix;
namespace SwagMigrationAssistant\Migration\ErrorResolution\Entity;

use Shopware\Core\Framework\DataAbstractionLayer\EntityDefinition;
use Shopware\Core\Framework\DataAbstractionLayer\Field\CreatedAtField;
Expand All @@ -18,7 +18,7 @@
use Shopware\Core\Framework\Log\Package;
use SwagMigrationAssistant\Core\Field\AnyJsonField;

#[Package('after-sales')]
#[Package('fundamentals@after-sales')]
class SwagMigrationFixDefinition extends EntityDefinition
{
public const ENTITY_NAME = 'swag_migration_fix';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
* file that was distributed with this source code.
*/

namespace SwagMigrationAssistant\Migration\MigrationFix;
namespace SwagMigrationAssistant\Migration\ErrorResolution\Entity;

use Shopware\Core\Framework\DataAbstractionLayer\Entity;
use Shopware\Core\Framework\DataAbstractionLayer\EntityIdTrait;
use Shopware\Core\Framework\Log\Package;

#[Package('after-sales')]
#[Package('fundamentals@after-sales')]
class SwagMigrationFixEntity extends Entity
{
use EntityIdTrait;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
* file that was distributed with this source code.
*/

namespace SwagMigrationAssistant\Migration\Writer\MigrationFix;
namespace SwagMigrationAssistant\Migration\ErrorResolution;

use Doctrine\DBAL\ArrayParameterType;
use Doctrine\DBAL\Connection;
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\Uuid\Uuid;

#[Package('after-sales')]
class MigrationFixApplier
#[Package('fundamentals@after-sales')]
class MigrationErrorResolutionService
{
public function __construct(
private readonly Connection $connection,
Expand All @@ -23,7 +23,7 @@ public function __construct(
/**
* @param array<int|string, array<int|string, mixed>> $data
*/
public function apply(array &$data, string $connectionId, string $runId): void
public function applyFixes(array &$data, string $connectionId, string $runId): void
{
$itemIds = \array_column($data, 'id');
$fixes = $this->getFixes($itemIds, $connectionId, $runId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
* file that was distributed with this source code.
*/

namespace SwagMigrationAssistant\Migration\Writer\MigrationFix;
namespace SwagMigrationAssistant\Migration\ErrorResolution;

use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\Uuid\Uuid;
use SwagMigrationAssistant\Exception\MigrationException;

#[Package('after-sales')]
#[Package('fundamentals@after-sales')]
class MigrationFix
{
private const PATH_SEPARATOR = '.';
Expand Down
4 changes: 2 additions & 2 deletions src/Migration/Logging/Log/AssociationRequiredMissingLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
namespace SwagMigrationAssistant\Migration\Logging\Log;

use Shopware\Core\Framework\Log\Package;
use SwagMigrationAssistant\Migration\Logging\Log\Builder\AbstractSwagMigrationLogEntry;
use SwagMigrationAssistant\Migration\Logging\Log\Builder\AbstractMigrationLogEntry;

#[Package('fundamentals@after-sales')]
readonly class AssociationRequiredMissingLog extends AbstractSwagMigrationLogEntry
readonly class AssociationRequiredMissingLog extends AbstractMigrationLogEntry
{
public function isUserFixable(): bool
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Shopware\Core\Framework\Log\Package;

#[Package('fundamentals@after-sales')]
abstract readonly class AbstractSwagMigrationLogEntry implements SwagMigrationLogEntry
abstract readonly class AbstractMigrationLogEntry implements MigrationLogEntry
{
final public const LOG_LEVEL_INFO = 'info';
final public const LOG_LEVEL_WARNING = 'warning';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

/**
* @example
* $log = (new SwagMigrationLogBuilder('runId', 'profileName', 'gatewayName'))
* $log = (new MigrationLogBuilder('runId', 'profileName', 'gatewayName'))
* ->withField('fieldName')
* ->withFieldSourcePath('sourcePath')
* ->build(SwagMigrationLogEntry::class);
* ->build(MigrationLogEntry::class);
*/
#[Package('fundamentals@after-sales')]
class SwagMigrationLogBuilder
class MigrationLogBuilder
{
/**
* @param array<mixed>|null $sourceData
Expand Down Expand Up @@ -117,15 +117,15 @@ public function withExceptionTrace(array $exceptionTrace): self
}

/**
* @template T of AbstractSwagMigrationLogEntry
* @template T of AbstractMigrationLogEntry
*
* @param class-string<T> $logClass
*
* @return T
*/
public function build(string $logClass): AbstractSwagMigrationLogEntry
public function build(string $logClass): AbstractMigrationLogEntry
{
if (!class_exists($logClass) || !is_subclass_of($logClass, AbstractSwagMigrationLogEntry::class)) {
if (!class_exists($logClass) || !is_subclass_of($logClass, AbstractMigrationLogEntry::class)) {
throw MigrationException::failedToCreateMigrationLog($logClass);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Shopware\Core\Framework\Log\Package;

#[Package('fundamentals@after-sales')]
interface SwagMigrationLogEntry
interface MigrationLogEntry
{
public function getRunId(): string;

Expand Down
4 changes: 2 additions & 2 deletions src/Migration/Logging/Log/CannotConvertChildEntityLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
namespace SwagMigrationAssistant\Migration\Logging\Log;

use Shopware\Core\Framework\Log\Package;
use SwagMigrationAssistant\Migration\Logging\Log\Builder\AbstractSwagMigrationLogEntry;
use SwagMigrationAssistant\Migration\Logging\Log\Builder\AbstractMigrationLogEntry;

#[Package('fundamentals@after-sales')]
readonly class CannotConvertChildEntityLog extends AbstractSwagMigrationLogEntry
readonly class CannotConvertChildEntityLog extends AbstractMigrationLogEntry
{
public function isUserFixable(): bool
{
Expand Down
4 changes: 2 additions & 2 deletions src/Migration/Logging/Log/CannotConvertEntityLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
namespace SwagMigrationAssistant\Migration\Logging\Log;

use Shopware\Core\Framework\Log\Package;
use SwagMigrationAssistant\Migration\Logging\Log\Builder\AbstractSwagMigrationLogEntry;
use SwagMigrationAssistant\Migration\Logging\Log\Builder\AbstractMigrationLogEntry;

#[Package('fundamentals@after-sales')]
readonly class CannotConvertEntityLog extends AbstractSwagMigrationLogEntry
readonly class CannotConvertEntityLog extends AbstractMigrationLogEntry
{
public function isUserFixable(): bool
{
Expand Down
4 changes: 2 additions & 2 deletions src/Migration/Logging/Log/CannotGetFileRunLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
namespace SwagMigrationAssistant\Migration\Logging\Log;

use Shopware\Core\Framework\Log\Package;
use SwagMigrationAssistant\Migration\Logging\Log\Builder\AbstractSwagMigrationLogEntry;
use SwagMigrationAssistant\Migration\Logging\Log\Builder\AbstractMigrationLogEntry;

#[Package('fundamentals@after-sales')]
readonly class CannotGetFileRunLog extends AbstractSwagMigrationLogEntry
readonly class CannotGetFileRunLog extends AbstractMigrationLogEntry
{
public function isUserFixable(): bool
{
Expand Down
4 changes: 2 additions & 2 deletions src/Migration/Logging/Log/CannotReadEntityCountLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
namespace SwagMigrationAssistant\Migration\Logging\Log;

use Shopware\Core\Framework\Log\Package;
use SwagMigrationAssistant\Migration\Logging\Log\Builder\AbstractSwagMigrationLogEntry;
use SwagMigrationAssistant\Migration\Logging\Log\Builder\AbstractMigrationLogEntry;

#[Package('fundamentals@after-sales')]
readonly class CannotReadEntityCountLog extends AbstractSwagMigrationLogEntry
readonly class CannotReadEntityCountLog extends AbstractMigrationLogEntry
{
public function isUserFixable(): bool
{
Expand Down
4 changes: 2 additions & 2 deletions src/Migration/Logging/Log/DataSetNotFoundLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
namespace SwagMigrationAssistant\Migration\Logging\Log;

use Shopware\Core\Framework\Log\Package;
use SwagMigrationAssistant\Migration\Logging\Log\Builder\AbstractSwagMigrationLogEntry;
use SwagMigrationAssistant\Migration\Logging\Log\Builder\AbstractMigrationLogEntry;

#[Package('fundamentals@after-sales')]
readonly class DataSetNotFoundLog extends AbstractSwagMigrationLogEntry
readonly class DataSetNotFoundLog extends AbstractMigrationLogEntry
{
public function isUserFixable(): bool
{
Expand Down
8 changes: 4 additions & 4 deletions src/Migration/Logging/Log/DebugLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
namespace SwagMigrationAssistant\Migration\Logging\Log;

use Shopware\Core\Framework\Log\Package;
use SwagMigrationAssistant\Migration\Logging\Log\Builder\AbstractSwagMigrationLogEntry;
use SwagMigrationAssistant\Migration\Logging\Log\Builder\SwagMigrationLogEntry;
use SwagMigrationAssistant\Migration\Logging\Log\Builder\AbstractMigrationLogEntry;
use SwagMigrationAssistant\Migration\Logging\Log\Builder\MigrationLogEntry;

#[Package('fundamentals@after-sales')]
readonly class DebugLog implements SwagMigrationLogEntry
readonly class DebugLog implements MigrationLogEntry
{
/**
* @param array<string, mixed> $logData
Expand Down Expand Up @@ -53,7 +53,7 @@ public function getGatewayName(): string

public function getLevel(): string
{
return AbstractSwagMigrationLogEntry::LOG_LEVEL_DEBUG;
return AbstractMigrationLogEntry::LOG_LEVEL_DEBUG;
}

public function getCode(): string
Expand Down
4 changes: 2 additions & 2 deletions src/Migration/Logging/Log/DocumentTypeNotSupportedLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
namespace SwagMigrationAssistant\Migration\Logging\Log;

use Shopware\Core\Framework\Log\Package;
use SwagMigrationAssistant\Migration\Logging\Log\Builder\AbstractSwagMigrationLogEntry;
use SwagMigrationAssistant\Migration\Logging\Log\Builder\AbstractMigrationLogEntry;

#[Package('fundamentals@after-sales')]
readonly class DocumentTypeNotSupportedLog extends AbstractSwagMigrationLogEntry
readonly class DocumentTypeNotSupportedLog extends AbstractMigrationLogEntry
{
public function isUserFixable(): bool
{
Expand Down
4 changes: 2 additions & 2 deletions src/Migration/Logging/Log/EmptyNecessaryFieldRunLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
namespace SwagMigrationAssistant\Migration\Logging\Log;

use Shopware\Core\Framework\Log\Package;
use SwagMigrationAssistant\Migration\Logging\Log\Builder\AbstractSwagMigrationLogEntry;
use SwagMigrationAssistant\Migration\Logging\Log\Builder\AbstractMigrationLogEntry;

#[Package('fundamentals@after-sales')]
readonly class EmptyNecessaryFieldRunLog extends AbstractSwagMigrationLogEntry
readonly class EmptyNecessaryFieldRunLog extends AbstractMigrationLogEntry
{
public function isUserFixable(): bool
{
Expand Down
Loading
Loading