Repository navigation
Include organization definitions in the partial export - #54274
Merged
pedroigor merged 1 commit intoOct 26, 2026
Merged
Conversation
The partial export skipped the organizations as a whole. Since 26.8 the domain routing lives on the organization domains, so the exported file carried no trace of it. The organizations are now exported with the same representation as in the full export. Members stay limited to the full export. Identity providers at the realm level are still exported without organization links. The partial import accepts the file and does not import the organizations. Closes keycloak#39334 Signed-off-by: Hakaou <hakaou@fr.scc.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused change preserves full-export behavior, includes targeted regression coverage and documentation, and has no identified blocking issues.
No open issues 🎉
What changed in this PR
Addresses #39334 by including organization definitions and domain routing in Admin Console partial exports, while keeping organization members limited to full exports.
Changes:
- Includes organization definitions in partial exports without changing full-export behavior.
- Expands regression coverage across all export-option combinations and checks that partial import accepts the exported JSON.
- Documents that partial exports omit organization members and partial imports do not restore organizations.
| File | Description |
|---|---|
testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/organization/exportimport/OrganizationExportTest.java |
Verifies organization data, omitted members, identity-provider links, and partial-import acceptance. |
model/storage-private/src/main/java/org/keycloak/exportimport/util/ExportUtils.java |
Includes organizations in partial exports while restricting members to full exports. |
docs/guides/server/importExport.adoc |
Clarifies organization export and partial-import limitations. |
Review effort: Balanced
sguilhen
approved these changes
Oct 23, 2026
Contributor
There was a problem hiding this comment.
If I understood the issue correctly, this is the first step (partial export), with the counterpart (partial import) coming as a separate PR.
In this context, I think the PR is well structured and properly tested. Approving.
pedroigor
approved these changes
Oct 26, 2026
Contributor
|
Thanks, @Hakaou. |
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.
Follow-up to the discussion in #39334 with @vramik.
The partial export (
partial-export, used by the Admin Console export) skipped the organizations as a whole inExportUtils. Since 26.8 the domain routing lives on the organization domains, so the exported file carried no trace of it.Changes:
ExportUtils.exportRealm()exports the organizations for partial exports too, with the same representation as the full export. Only the members, with their organization group memberships, stay limited to the full export.OrganizationExportTest.testPartialExportchecks, for each combination ofexportClientsandexportGroupsAndRoles: name, alias, description and attributes, the domain with its identity provider routing, the identity provider link (organization id,autoMembershipset to false before the export, membership type), the organization group, no members, and realm-level identity providers without links. It then posts the whole exported JSON topartialImportwithifResourceExists=SKIPadded and expects 200. The partial import dialog of the console sends only the selected resource lists. The partial import accepts the file and does not restore the organizations:PartialImportRepresentationhas no organizations field and ignores unknown properties.importExport.adoc: organizations are exported without their members, and the Admin Console partial import does not import them.Tests run locally on f7532e1 with JDK 21:
OrganizationExportTestwith the change (embedded Undertow)testExportcovers the full export with members.testExportImportEmptyOrgcovers an organization without members.ExportUtilsreverted to maintestPartialExportfails atassertThat(export.getOrganizations(), hasSize(1)):Expected: a collection with size <1> but: was nullPartialExportTest,PartialImport*Test,ExportImportTest,RealmImportSharedUndefinedClientRoleTestspotless:checkon both changed modulesRelated work:
testPartialExportto the new test framework. Whichever lands second will need to carry the change of the other.AI usage: I designed and directed this change and reviewed every line. An AI agent (Claude) wrote the code and the test under my direction, from the discussion in #39334. The change was verified locally before opening the PR. I can explain and revise the code myself.
Closes #39334