feat(admin): config-sync export + import — code-keyed bundle (ADR 0003)#53
Merged
Conversation
… PR 1) First prototype increment of environment config promotion (ADR 0003). - ConfigBundle: portable, code-keyed snapshot of definitional config (permissions, roles + their permission codes, menus with parent/required-permission by code). - ConfigExportService: builds the bundle from the live DB for a tenant, translating every UUID into its natural code. - ConfigSyncController: GET /admin/api/v1/config/export?tenantId=... - ConfigSyncAutoConfiguration: registers + gates the whole surface — OFF unless devslab.kit.config-sync.enabled=true. - Testcontainers test seeds perms/roles/menus, exports, and asserts the bundle is keyed by code. Import (merge + dry-run) and the dev-profile / prod fail-fast gating follow on this branch per the ADR's PR breakdown.
… 0003, PR 2) - ConfigImportService: applies a bundle by natural code in one transaction. merge mode (additive, never deletes); dryRun computes the diff without writing. Permissions upsert by code; roles create + grant missing permissions (resolved by code); menus upsert parent-before-child (a child's parent must exist at create, and a menu's parent cannot be changed via update), so any bundle ordering imports correctly. - ImportResult: per-type created/updated diff (codes only). - POST /admin/api/v1/config/import?mode=merge&dryRun=true (dry-run is the default). - Test: dry-run writes nothing; apply creates by code with child-listed-before-parent input; re-apply is idempotent. Round-trip green on Testcontainers Postgres. (Renamed ConfigSyncExportTests -> ConfigSyncTests now that it covers both sides.)
jlc488
added a commit
that referenced
this pull request
Jun 3, 2026
All implementation PRs have merged: export/import (#53), prod fail-fast gating (#54), mirror mode + opt-in user sync (#55), and the admin-ui "Config Sync" page (devslab-kit-admin-ui #20). Flip the status to Accepted (item 6 of the plan) and record the PRs; the standalone how-to guide is the remaining piece. Both language files.
jlc488
added a commit
that referenced
this pull request
Jun 3, 2026
Prepares the 0.4.0 doc surfaces for the config-sync feature (ADR 0003, shipped in #53–#56): - CHANGELOG.md/.ko.md: 0.4.0 entry (export/import, merge/mirror, dry-run, opt-in user sync, prod fail-fast). - README.md/.ko.md: bump install coordinates to 0.4.0 + a "Config sync" feature row. - docs: bump install/configuration coordinates to 0.4.0; add a config-sync card to the home page; a new "Config Sync" guide (en/ko) wired into the mkdocs nav + ko nav translation; note it under the roadmap's shipped list. Docs only; `mkdocs build --strict` passes.
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
ADR 0003 config-sync — backend prototype: export + import (code-keyed bundle).
Export
ConfigBundle— portable, code-keyed snapshot of definitional config (permissions,roles + their permission codes, menus with parent / required-permission by code).
ConfigExportService+GET /admin/api/v1/config/export?tenantId=….Import
ConfigImportService— applies a bundle by natural code in one transaction.merge(additive, never deletes);dryRuncomputes the diff without writing.Permissions upsert by code; roles create + grant missing permissions (by code); menus
upsert parent-before-child (parent must exist at create; a menu's parent can't be
changed via update), so any bundle ordering imports correctly.
ImportResult— per-type created/updated diff (codes only).POST /admin/api/v1/config/import?mode=merge&dryRun=true(dry-run is the default).Gating
ConfigSyncAutoConfiguration— the whole surface is OFF unlessdevslab.kit.config-sync.enabled=true.Verification
./gradlew buildgreen (Testcontainers Postgres+Redis).ConfigSyncTests2/2:export keys by code; import dry-run writes nothing, apply creates by code with
child-listed-before-parent input handled, re-apply is idempotent.
Next on this track (per the ADR)
PR 3: stronger gating (dev-profile-only + prod fail-fast). PR 4:
mirrormode + optionaluser sync (guarded). PR 5: admin-ui Config Sync page.
요약 (한국어)
ADR 0003 config-sync 백엔드 프로토타입: export + import(코드 기준 번들).
ConfigBundle(코드 기준) +GET /config/exportConfigImportService— 코드 기준 upsert, 트랜잭션 1개, merge(추가형·삭제 없음) +dryRun(쓰기 없이 diff). 메뉴는 부모-먼저 위상순서.
POST /config/import?mode=merge&dryRun=true(기본 dry-run).config-sync.enabled=true일 때만(기본 off).ConfigSyncTests2/2 green(Testcontainers). 다음: 게이팅 강화 → mirror/사용자동기화 → admin-ui 페이지.