feat(app-dev): surface metadata diff in dev sync and name failing migration actions (#21249)

Split out of #21240.

- Render the applied metadata changes (created/updated/deleted +
identifiers) in the dev sync output instead of a bare `✓ Synced`.
- Include the failing entity's `universalIdentifier` in
`WorkspaceMigrationRunnerException` messages so conflicts are
diagnosable.

<img width="637" height="114" alt="image"
src="https://github.com/user-attachments/assets/61422a16-370c-4e9b-a2f6-c29ce17f3b1b"
/>

<img width="497" height="104" alt="image"
src="https://github.com/user-attachments/assets/d493c398-da29-49c9-ac5e-aa0f26cd7389"
/>

<img width="593" height="127" alt="image"
src="https://github.com/user-attachments/assets/15e26edc-c0e4-4427-bd34-909040e970c9"
/>

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
martmull
2026-06-05 16:35:50 +02:00
committed by GitHub
parent f72898063a
commit f20d04eb6e
13 changed files with 364 additions and 5 deletions
@@ -1,6 +1,7 @@
import { Field, ObjectType } from '@nestjs/graphql';
import GraphQLJSON from 'graphql-type-json';
import { type SyncAction } from 'twenty-shared/metadata';
@ObjectType('WorkspaceMigration')
export class WorkspaceMigrationDTO {
@@ -8,5 +9,5 @@ export class WorkspaceMigrationDTO {
applicationUniversalIdentifier: string;
@Field(() => GraphQLJSON)
actions: unknown[];
actions: SyncAction[];
}
@@ -31,7 +31,7 @@ Report: {
`;
exports[`formatUpgradeErrorForStorage should format a WorkspaceMigrationRunnerException with EXECUTION_FAILED 1`] = `
"[WorkspaceMigrationRunnerException] Migration action 'create' for 'objectMetadata' failed
"[WorkspaceMigrationRunnerException] Migration action 'create' for 'objectMetadata' (universalIdentifier: test-object-uid) failed
Code: EXECUTION_FAILED
Action: create on objectMetadata
Metadata error: column "label" cannot be null
@@ -57,6 +57,7 @@ describe('formatUpgradeErrorForStorage', () => {
const action = {
type: 'create',
metadataName: 'objectMetadata',
flatEntity: { universalIdentifier: 'test-object-uid' },
} as unknown as AllUniversalWorkspaceMigrationAction;
const error = new WorkspaceMigrationRunnerException({