Skip to content

Conversation

@larskemper
Copy link
Member

@larskemper larskemper commented Sep 9, 2025

resolves #13015

related shopware/shopware#13587

Summary

Introduces the new ui to resolve user-fixable migration errors grouped by code/entity/field.

==> screen design
==> cloud version: settings > migration (please do not confirm "continue" 😄)

What changed

Note

Tests will follow in a seperate pr to make this not bigger as it already is (pr: #90)

Backend

src/Controller/HistoryController

New Endpoints:

  • GET api/_action/migration/get-log-groups: Main endpoint to fetch grouped logs of the current migration run to resolve errors. It groups the logs by error code, entity name and field name. Also it gives the option to paginate, sort (by & direction) and filter the results by error code, status (resolved / unresolved), entity, and field name. Uses the new LogGroupingService for fetching the logs.

  • POST api/_action/migration/get-all-log-ids: For the error resolution modal I need a endpoint that gives me all Ids of logs groups by code, entity name and field name to select all logs of this group for bulck editing.

src/Migration/History/LogGroupingService

New Service:

  • groups logs by code, entity name, field name for given runId and level
  • supports filters: error code, entity name, field name, status (resolved / unresolved)
  • supports sorting: by count, code, entity name, field name, profile name, gateway name createdAt
  • supports pagination, respecting filters and sorting
  • computes the fixCount for the ui where we display how many of the grouped errors have been resolved (e.g. 12 / 500)
  • computes the levelCounts for error type error/warning/info (e.g. Errors (12), Warning (30) ...)

Administration

New components

  • swag-migration-error-resolution-step: Entry point for resolving migration issues. Lists grouped log items, offers filters and sorting, opens the resolution modal

  • swag-migration-error-resolution-modal: Bulk resolution modal for selected group of errors. Lets the user choose a target log, input a fix value and create a fix

  • swag-migration-error-resolution-details-modal: Shows the user the raw data of the logs convertedData and sourceData if available

  • swag-migration-error-resolution-log-filter: Filter panel for the main table. Provides code, enity, field and status select.

  • swag-migration-error-resolution-field: Field wrapper that inspects the entity medadata to render the correct input type (subcomponents)

    • swag-migration-error-resolution-field-relation: input for relation fields (to-one / to-many). User can either select one entity (id) or multiple

    • swag-migration-error-resolution-field-scalar: input for scalar field (stirng / number / boolean / dates / json)

    • swag-migration-error-resolution-field-unhandeled: fallback for unsuppoorted or unknown field types (e.g. if an unexpexted field got recognized and we have no metadata in the definitions for the field or the type of field is unsupported)

New Service:

src/module/swag-migration/service/swag-migration-error-resolution.service.ts:

Business logic for the error resolution with following responsibilities:

  • resolves admin route for an entity (getEntityLink) to create option for a fix
  • analyses the entity definitions to extract:
    • type of scalar values
    • type and entity of associations
    • required fields
    • extraction of id fields (to-one and to-many ids)
    • entity field validation
  • field utilities:
    • finds corresponding association fields in the definition
    • picks "highest priority" property of an entity for displaying meaningful information
  • table generation: builds columns for the error resolution modal by following schema: 1. status, 2. field that has error, ... followed by prioritized scalar fields

DennisGarding
DennisGarding previously approved these changes Sep 17, 2025
MalteJanz

This comment was marked as outdated.

@larskemper larskemper marked this pull request as draft October 6, 2025 05:53
@larskemper larskemper force-pushed the feat/add-error-resolution-ui branch from 7934044 to 787b1e1 Compare October 27, 2025 14:08
@larskemper larskemper force-pushed the feat/add-error-resolution-ui branch from 787b1e1 to d2efce6 Compare October 27, 2025 14:14
@larskemper larskemper changed the title feat: add error resolution UI draft feat: add error resolution ui Oct 27, 2025
@larskemper larskemper force-pushed the feat/add-error-resolution-ui branch from 72f605d to bc33763 Compare October 28, 2025 15:22
@larskemper larskemper force-pushed the feat/add-error-resolution-ui branch from 53a1fbf to b335d35 Compare November 3, 2025 12:27
@larskemper larskemper force-pushed the feat/add-error-resolution-ui branch from b335d35 to 7b6c830 Compare November 3, 2025 12:28
@larskemper larskemper force-pushed the feat/add-error-resolution-ui branch from 3f6d0dd to ef8ff1c Compare November 3, 2025 14:46
@MalteJanz MalteJanz self-requested a review November 25, 2025 11:47
Copy link
Contributor

@MalteJanz MalteJanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not quite at the end 🙈 To be honest, there is quite a lot of frontend code in this PR and I'm wondering if we really need that much or can simplify stuff further.

I know some of it is needed, because we are also building a complex UI here, but there is also quite some code related to fetching and transforming data around.

@MalteJanz MalteJanz self-requested a review November 25, 2025 16:28
Copy link
Contributor

@MalteJanz MalteJanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally done with my code review, sorry that it took so long 😅 ✌️ .

And great job, this PR definitely wasn't a small task 💪 . Let's try to get it finally merged now, iterating further from that 🙂

@larskemper larskemper merged commit a05f7e7 into feature/migration-logging-refactor Nov 28, 2025
11 checks passed
@larskemper larskemper deleted the feat/add-error-resolution-ui branch November 28, 2025 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants