feat(identity): improve identity migration logging verbosity and reduce noise#1050
Draft
feat(identity): improve identity migration logging verbosity and reduce noise#1050
Conversation
- Add user/group, resource type, and resource ID to authorization log messages - Suppress stack traces for 409 "already exists" conflicts in identity context - Update test helper to match new log format using anySatisfy assertion related to #1011 Co-authored-by: tasso94 <[email protected]>
Copilot
AI
changed the title
[WIP] Improve logging for identity migration
feat(identity): improve authorization migration logging verbosity and reduce noise
Feb 27, 2026
Member
|
@copilot, would a similar improvement also make sense for tenants/tenant memberships? |
- Include tenant name in MIGRATING_TENANT, SUCCESSFULLY_MIGRATED_TENANT, SKIPPED_TENANT messages - Include skip reason in SKIPPED_TENANT (was previously silently dropped) - Update logMigratingTenant/logMigratedTenant/logSkippedTenant to accept Tenant object - Add markAsSkipped(Tenant, String) overload in IdentityMigrator - Remove now-unused markAsSkipped(IdKeyMapper.TYPE, String, String) dead code - Update verifyTenantSkippedViaLogs to use anySatisfy pattern related to #1011 Co-authored-by: tasso94 <[email protected]>
Contributor
Author
Yes, applied the same improvements in commit 558fc64:
Example new format:
Tenant membership logs were already verbose (include tenant ID, member type, and user/group ID), so no changes were needed there. |
Copilot
AI
changed the title
feat(identity): improve authorization migration logging verbosity and reduce noise
feat(identity): improve identity migration logging verbosity and reduce noise
Feb 27, 2026
Member
|
@copilot, fix test failures: |
…entityMigratorLogs ArchitectureTest requires methods in io.camunda.migration.data.. packages to use protected or package-private visibility instead of private. related to #1011 Co-authored-by: tasso94 <[email protected]>
Contributor
Author
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.
Authorization and tenant migration logs were hard to follow—skipped messages only showed UUIDs, making it impossible to identify the actual entities without a database lookup. Additionally, common 409 conflicts (authorization/tenant already exists) were logged as ERROR with full stack traces, polluting logs with noise for an expected scenario.
Description
Verbose authorization logs (
IdentityMigratorLogs,IdentityMigrator)All authorization log messages now include owner type/ID, resource type, and resource ID alongside the authorization UUID.
Before:
After:
logMigratingAuthorization,logMigratedAuthorization,logSkippedAuthorizationnow accept anAuthorizationobjectmarkAsSkipped(Authorization, String)overload toIdentityMigratorto carry the full authorization context through to the log callVerbose tenant logs (
IdentityMigratorLogs,IdentityMigrator)All tenant log messages now include the tenant name alongside the tenant ID. The skip reason is also now logged for skipped tenants (it was previously silently dropped — a pre-existing bug fixed here).
Before:
After:
logMigratingTenant,logMigratedTenant,logSkippedTenantnow accept aTenantobjectmarkAsSkipped(Tenant, String)overload toIdentityMigratormarkAsSkipped(IdKeyMapper.TYPE, String, String)dead codeSuppress 409 stack traces (
ExceptionUtils)In
IDENTITYcontext, aProblemExceptionwith HTTP 409 is now logged asWARNwith the API detail message only—no stack trace. All other errors retain existingERROR+stack-trace behavior.Before:
After:
Test updates (
IdentityTestHelper)verifyAuthorizationSkippedViaLogsandverifyTenantSkippedViaLogsupdated from brittle fixed-format string matches toanySatisfyassertions that verify the entity ID and skip reason appear together in the same log event.Architecture compliance (
IdentityMigratorLogs)Helper methods
ownerType,ownerId, andresourceTypeNamechanged fromprivateto package-private visibility to satisfy the project'sArchitectureTestrule requiring methods inio.camunda.migration.data..packages to useprotectedor package-private access.Type of Change
Testing Checklist
Black-Box Testing Requirements
DbClient,IdKeyMapper,..impl..packages except logging constants)ArchitectureTestvalidates these rules)Test Coverage
Architecture Compliance
Run architecture tests to ensure compliance:
mvn test -Dtest=ArchitectureTestIf architecture tests fail, refactor your tests to use:
LogCapturerfor log assertionscamundaClient.new*SearchRequest()for C8 queriesDocumentation
Checklist
Related Issues
Related to #1011
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.