feat: Directus migration — data, files, roles, multi-trigger flows#14
Open
chrisaddams wants to merge 3 commits into
Open
feat: Directus migration — data, files, roles, multi-trigger flows#14chrisaddams wants to merge 3 commits into
chrisaddams wants to merge 3 commits into
Conversation
39b7fc2 to
e7722e0
Compare
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
e7722e0 to
b5838f6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two commits add Directus → Anythink import for schema, data, files,
roles and flows.
1807c2flays down a platform-agnostic importer framework undersrc/Importers/(so future source platforms plug in via oneinterface) plus the Directus implementation.
360211bextends 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 combinationsDirectusFlowMappingTests— op translationDirectusTemplateAdapterTests— template rewritingImportRunnerTopoSortTests— FK topological order