Skip to content

feat: add config-file migration endpoint #1784 - #1830

Open
KirylKurnosenka wants to merge 1 commit into
feat/issue-1783from
feat/issue-1784
Open

feat: add config-file migration endpoint #1784#1830
KirylKurnosenka wants to merge 1 commit into
feat/issue-1783from
feat/issue-1784

Conversation

@KirylKurnosenka

Copy link
Copy Markdown
Contributor

Adds an admin-triggered, on-demand endpoint that copies file-defined config entities into the platform blob bucket, so they become API-managed without changing what clients see or send. Supports dry-run and is idempotent on re-invocation.

Applicable issues

Description of changes

  • New POST /v1/admin/config/file/migrate (ConfigFileMigrateController), admin-only, migrating models/interceptors/roles/keys/routes/applications/toolsets/schemas/catalog_schemas/settings on request, with a types filter and dryRun flag.
  • Reuses AdminApplyController's per-kind write pipeline (validateOnly, mutateScratch, newScratch, and a newly extracted applyEntries) instead of duplicating per-type encryption/validation/dup-checks; applyEntries and the DEPENDENCY_ORDER_COMPARATOR it now shares with applyBatch are also reused as-is by the migration endpoint.
  • New SchemaMigrationNaming helper mints a deterministic canonical blob name for migrated schemas (sha256($id) + sanitized display-name slug), since a schema's canonical id is intentionally decoupled from its $id.
  • Response statuses distinguish dry-run from real outcomes (migrated/skipped/failed vs. would_migrate/would_skip/would_fail) so a result can't be mistaken for an actual write.
  • New ConfigFileMigrateApiTest integration coverage: happy path, idempotent re-run, dry-run (writes nothing), toolset secret round-trip, same-display-name schema disambiguation, settings migration, types filtering, invalid type (400), non-admin (403).

Notes for reviewers

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

…igrate #1784

Admin-triggered, on-demand copy of file-defined config entities (models,
interceptors, roles, keys, routes, applications, toolsets, schemas,
catalog_schemas, settings) into the platform blob bucket, with dry-run
support and idempotent re-runs. Reuses AdminApplyController's per-kind
write pipeline (validateOnly/mutateScratch/applyEntries) instead of
duplicating per-type encryption/validation/dup-checks.
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