Skip to content

chore(backend): modernize directus-sync setup for Directus 11.17#859

Merged
antontranelis merged 8 commits into
mainfrom
chore/bump-directus-sync-3.5.1
Jun 6, 2026
Merged

chore(backend): modernize directus-sync setup for Directus 11.17#859
antontranelis merged 8 commits into
mainfrom
chore/bump-directus-sync-3.5.1

Conversation

@antontranelis

Copy link
Copy Markdown
Member

Summary

Two related changes to bring the backend tooling and the snapshot in
sync with the production stack, which was updated from Directus
11.9.3 → 11.17.4 on 2026-06-06.

Commit 1 — chore(backend): bump directus-sync to 3.5.1

backend/{push,pull,seed}.sh pinned directus-sync@3.4.0, which only
supports up to Directus 11.10. With production on 11.17, running these
scripts now fails with a schema-version mismatch.

3.5.1 (the current latest, released 2026-04-13) is explicitly compatible
with 11.17.

Commit 2 — chore(backend): sync directus-config with production

Pulled the live schema + collections from api.utopia-lab.org with
directus-sync@3.5.1 pull. Highlights:

  • snapshot/info.json: directus field bumped to 11.17.4, new systemFields array
  • Every field gains a "searchable": true property (introduced in Directus 11.13)
  • New specs/ directory (GraphQL + OpenAPI specs)
  • collections/{permissions,presets,flows,settings,…}.json now reflect the production state
  • directus_sync_id_map collection removed from the snapshot (internal table, recreated on demand)

The push side was already executed against production with
directus-sync@3.5.1 push --no-collections --force — this PR just brings
the repo's view of the schema and collections back into sync.

Test plan

  • Manual: cd backend && ./push.sh against a local dev instance succeeds without version mismatch
  • Manual: cd backend && ./pull.sh against a local dev instance succeeds and produces no diff
  • CI / lint / type-check passes

🤖 Generated with Claude Code

antontranelis and others added 8 commits June 6, 2026 21:23
3.5.1 is compatible with Directus 11.17, which the production stack
runs after the 2026-06-06 update. The previous pin (3.4.0) only
covered up to Directus 11.10 and would fail with a version mismatch.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Pulled current schema and collections from api.utopia-lab.org via
directus-sync@3.5.1 pull, after the 2026-06-06 Directus update from
11.9.3 to 11.17.4.

Notable diffs:
- info.json bumped to 11.17.4
- Every field metadata gains a 'searchable' property (added in 11.13)
- New specs/ directory with GraphQL + OpenAPI specs
- Collections (permissions, presets, flows, settings, …) snapshot the
  state that has accumulated in production over the past months
- directus_sync_id_map collection removed (internal table, recreated
  on demand)

The schema-side production state already matches the repo after
yesterday's 'directus-sync push --no-collections --force'. This commit
brings the repo's view of collections up to date as well.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Match the production stack (updated 2026-06-06). With the directus-config
snapshot now produced by 11.17.4 (it includes the new 'systemFields'
key in info.json), CI's backend container has to be at the matching
version or 'directus-sync push' fails with:

  Invalid payload. "systemFields" is not allowed.

Schema migrations between 11.9.3 and 11.17.4 run automatically on
container start, so no extra steps are needed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This folder was removed from production at some point but is still
referenced by 'seed/directus_files_marker_outline.json' (CI test data).
Without it, the backend-seed CI step hits 'No id map found for folder'
and 'directus-sync push' bails after 20 retry rounds.

Repo-only entry: production neither has nor needs it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The scripts blindly try to authenticate as soon as they run. When the
backend container has just been started (the common case in CI and
after a 'docker compose up'), Directus hasn't finished booting yet and
the login request errors out with 'fetch failed / other side closed'.

directus-sync 3.5.1 provides a 'wait-server-ready' command exactly for
this. Adding it to the top of each script makes the scripts idempotent
with respect to startup timing, so 'docker compose up -d --build && ./push.sh'
just works without a manual sleep.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Direct 'directus-sync wait-server-ready' fails with
'error: unknown command'. The wait helper is exposed as
'directus-sync helpers wait-server-ready' (see tractr/directus-sync
docs, 'Helpers' section).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
'directus-sync helpers wait-server-ready' relies on the SDK
authenticating against the server, so it hits the timeout even when
/server/health is already responsive — apparently the auth side
isn't fully ready in the early seconds of a fresh boot.

A plain curl against /server/health (which is public and only
requires the HTTP server to be up) is more honest about what
'ready' means here.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
A first-boot bootstrap on an empty database (no data/ directory yet)
can take well over a minute. Push 'wait for ready' out to 3 minutes
so a fresh local setup doesn't time out before Directus has applied
all its initial migrations.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@antontranelis antontranelis merged commit d5b9efd into main Jun 6, 2026
26 checks passed
@antontranelis antontranelis deleted the chore/bump-directus-sync-3.5.1 branch June 6, 2026 21:23
@antontranelis antontranelis mentioned this pull request Jun 6, 2026
3 tasks
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