Skip to content

feat: Directus migration — data, files, roles, multi-trigger flows#14

Open
chrisaddams wants to merge 3 commits into
mainfrom
feat/migrations-directus
Open

feat: Directus migration — data, files, roles, multi-trigger flows#14
chrisaddams wants to merge 3 commits into
mainfrom
feat/migrations-directus

Conversation

@chrisaddams

@chrisaddams chrisaddams commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Two commits add Directus → Anythink import for schema, data, files,
roles and flows.

1807c2f lays down a platform-agnostic importer framework under
src/Importers/ (so future source platforms plug in via one
interface) plus the Directus implementation.

360211b extends the importer to cover data records, files, roles,
and workflow translation. The workflow client moves to the
multi-trigger shape; the template adapter rewrites Directus mustache
into Anythink's $anythink.* syntax.

Tests

275 passing (40 new):

  • DirectusFieldMappingTests — db_type / display_type combinations
  • DirectusFlowMappingTests — op translation
  • DirectusTemplateAdapterTests — template rewriting
  • ImportRunnerTopoSortTests — FK topological order

@chrisaddams chrisaddams marked this pull request as ready for review May 26, 2026 13:35
@chrisaddams chrisaddams force-pushed the feat/migrations-directus branch from 39b7fc2 to e7722e0 Compare May 26, 2026 14:52
Adds schema-and-flows import from a Directus instance into an Anythink
project. Sets up a platform-agnostic importer framework under
`src/Importers/` so future source platforms plug in via a single
interface.

`ImportDirectusCommand` is a thin shell that parses CLI args, builds a
`DirectusImporter`, and hands off to `ImportRunner`. The runner is
platform-agnostic and handles entity create, field merge, flows,
dry-run plan, and summary rendering.

Flags: `import directus --url <cms> --token <token>` with `--dry-run`
and `--include-flows`.
Builds on the import-directus scaffolding (1807c2f) to cover the full
migration surface.

- `--include-data` paginates source records and writes them in FK-safe
  topological order, with src→dst id maps and FK remap on the wire.
- `--include-files` re-uploads Directus assets and links them via the
  native file db-type.
- `--include-roles` reduces Directus' role/access/policy graph to
  Anythink roles with `<entity>:<action>` permissions.
- Workflow client moved to the multi-trigger shape. `DirectusFlowMapping`
  emits per-action parameter payloads in the snake_case shapes Anythink
  validators expect. `DirectusTemplateAdapter` rewrites Directus
  mustache into `$anythink.*` syntax; unrecognised expressions are
  emitted in literal form.
- `ApplyFlowAsync` merges into existing workflows by step Key, so
  re-runs are idempotent.
- Steps that need manual review (lossy op mapping, untranslated
  templates) are surfaced in the summary.

275 tests passing (40 new): field/display mapping, flow op translation,
template rewriting, FK topological sort.
# Conflicts:
#	.gitignore
#	src/Commands/WorkflowsCommand.cs
@chrisaddams chrisaddams force-pushed the feat/migrations-directus branch from e7722e0 to b5838f6 Compare May 26, 2026 15:30
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.

1 participant