GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Stability] Focus identity email address mutations by Storypapst · Pull Request #885 · OpenResilienceInitiative/ORISO-UserService

Conversation

@Storypapst

@Storypapst Storypapst commented Jul 28, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Summary

  • replay issue Complete the focused identity email-address mutation boundary #797 directly on the current pre-dev base without the obsolete dependency stack
  • introduce the provider-neutral IdentityEmailAddressUpdater output port for current-account and post-verification email writes
  • remove email mutation methods from the broad IdentityClient
  • keep Keycloak validation, authenticated-user lookup, locale-independent lowercase normalization, dummy-email handling, and persistence inside the adapter
  • remove the duplicate current-user representation read and make unchanged email writes explicit no-ops
  • protect the focused consumers and shared Spring test contexts with an executable module-boundary contract

Measured call bounds

  • changed current-account email: one representation read, one availability search with exact email matching, one provider update
  • unchanged current-account email: one representation read, no availability search, no provider update
  • current-account deletion: the same focused write path with the adapter-owned dummy email
  • completed email verification: one exact username search and at most one provider update; an unchanged email is a no-op after that lookup

Verification

  • Java 21 unit suite: 3,428 tests, 0 failures, 0 errors, 0 skipped
  • Java 21 integration suite: 850 tests, 0 failures, 0 errors, 9 conditional environment skips
  • architecture and CI contracts: 51 passed, including 2 subtests
  • OpenAPI contract gate: 8 passed
  • focused Keycloak adapter suite: 98 passed after the final naming/documentation cleanup
  • Spotless, package build, and git diff --check: passed
  • local database reset: not required
  • GitHub: all 11 Actions checks successful, including both full integration jobs, both MariaDB contracts, Redis, OpenAPI, Docker validation and required PreDev CI
  • CodeRabbit status is green because automatic reviews are disabled for the pre-dev base branch; this is not a content approval

Scope and rollout truth

This ready-for-review PR is direct on commit be15d12f from current pre-dev and contains only #797. It supersedes the obsolete stacked PR #798. It is clean and mergeable, with review requested from shazia-k, Hassan9215 and shanzaeimran. Nothing from this PR is merged, deployed, or runtime-verified on PreDev.

The architecture target remains Matrix-only chat through the ORISO-owned frontend, an ORISO-controlled Element Call/MatrixRTC fork, and LiveKit. Rocket.Chat and Jitsi are complete removal targets and are never fallback architecture.

Closes #797
Supersedes #798

Summary by CodeRabbit

  • New Features

    • Email updates and deletions now use dedicated identity-management operations.
    • Email addresses are normalized consistently, while unchanged addresses are skipped.
    • Email verification updates the confirmed address without changing external APIs or configuration.
  • Documentation

    • Updated identity module guidance for provider-neutral email operations and behavior.
  • Tests

    • Expanded coverage for normalization, availability checks, deletion, and unchanged-email scenarios.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Storypapst @claude
refactor(identity): focus email address mutations (#797)
35a9078
Co-Authored-By: Claude Opus 4.8 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@shazia-k, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f17e8d4b-30dd-43f8-84ef-9e036ab7e4e0

📥 Commits

Reviewing files that changed from the base of the PR and between a73fb5f and e4c2538.

📒 Files selected for processing (1)
  • src/test/java/de/caritas/cob/userservice/api/testConfig/KeycloakTestConfig.java
📝 Walkthrough

Walkthrough

This PR adds the IdentityEmailAddressUpdater port. Application services use it for email mutations. KeycloakService owns normalization and unchanged-email no-op behavior. Tests and stability documentation define the new boundary.

Changes

Focused identity email-mutation port

Layer / File(s) Summary
Email mutation port contract
src/main/java/.../port/out/IdentityEmailAddressUpdater.java, src/main/java/.../port/out/IdentityClient.java
Adds the focused email mutation methods and removes the legacy email methods from IdentityClient.
Keycloak email mutation implementation
src/main/java/.../adapters/keycloak/KeycloakService.java, src/test/java/.../adapters/keycloak/KeycloakServiceTest.java
Renames email operations, uses Locale.ROOT normalization, separates availability checks, and skips unchanged updates. Tests cover changed and unchanged email flows.
Application service delegation
src/main/java/.../IdentityManager.java, src/main/java/.../service/user/UserAccountService.java, src/test/java/.../IdentityManagerTest.java, src/test/java/.../service/user/UserAccountServiceTest.java
Routes verification, account email updates, and email deletion through IdentityEmailAddressUpdater.
Test configuration and boundary documentation
src/test/java/.../*IT.java, src/test/java/.../testConfig/KeycloakTestConfig.java, documentation/USER_SERVICE_STABILITY.md
Updates mocked interfaces and test stubs. Documents bounded email mutation calls and unchanged-email behavior.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant IdentityManager
  participant IdentityEmailAddressUpdater
  participant KeycloakService
  participant UserAccountService

  IdentityManager->>IdentityEmailAddressUpdater: updateEmailByUsername(username, email)
  IdentityEmailAddressUpdater->>KeycloakService: updateEmailByUsername(username, email)
  KeycloakService->>KeycloakService: Read representation and update when email changed

  UserAccountService->>IdentityEmailAddressUpdater: updateCurrentUserEmail(email) or deleteCurrentUserEmail()
  IdentityEmailAddressUpdater->>KeycloakService: Execute current-user email mutation
Loading

Possibly related PRs

  • OpenResilienceInitiative/ORISO-UserService#728: Both changes modify the email-verification update flow in IdentityManager.
  • OpenResilienceInitiative/ORISO-UserService#753: Both changes move provider-specific identity operations into focused ports.
  • OpenResilienceInitiative/ORISO-UserService#882: Both changes refactor IdentityClient, IdentityManager, and KeycloakService boundaries.

Suggested labels: coderabbit

Suggested reviewers: hassan9215, shanzaeimran, shazia-k

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise, conventional, and identifies the affected identity email mutation area.
Linked Issues check ✅ Passed The changes implement the focused identity email mutation boundary and satisfy the coding objectives and acceptance criteria in [#797].
Out of Scope Changes check ✅ Passed The changes are limited to the requested identity boundary, adapter behavior, tests, documentation, and test-context updates.
Validation Evidence ✅ Passed Behavior changes include focused automated tests for delegation, normalization, changed and unchanged updates, deletion, and interaction bounds; the PR also reports passing Java 21 unit and integra...
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch replay/identity-email-mutation-797

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Jul 28, 2026
Complete the focused identity email-address mutation boundary #797
Closed
[Stability] Focus identity email address mutations #798
Closed
@Storypapst
Storypapst marked this pull request as ready for review July 28, 2026 12:38
@Storypapst
Storypapst requested review from Hassan9215, shanzaeimran and shazia-k July 28, 2026 12:38
@cursor

cursor Bot commented Jul 28, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Jul 28, 2026
[Feature Request] Stage the UserService refactor integration (#887) #888
Closed
Make UserService safe when two instances overlap (finish the remaining replica-safety work) #887
Open
Storypapst added a commit that referenced this pull request Jul 28, 2026
@Storypapst @claude
Merge PR #885: focus identity email mutations
ade49a1
Compose the focused email-address updater with the existing authentication, email-owner, role-read, username-availability, and second-factor seams on the integration branch. Preserve the original delivery commit and keep the combined branch review-only.

Refs #887

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@shazia-k
Merge origin/pre-dev into replay/identity-email-mutation-797
0bda09d
Eighteen conflicts. KeycloakService now declares ten ports — pre-dev's nine plus
this branch's IdentityEmailAddressUpdater — and the eight shared mocks mirror it.
IdentityManager and UserAccountService each had both sides injecting a different
port, so both collaborators were kept.

Four conflicts needed a decision rather than a union, because the branch and
pre-dev had each moved methods off IdentityClient in different directions. The two
sets were derived from the two IdentityClient versions rather than assumed:

  removed by this PR : changeEmailAddress (x2), deleteEmailAddress, updateEmail
  already gone on pre-dev: closeSession, deactivateUser, deleteUser, findUserByEmail,
      getById, getRealmRoles, isUsernameAvailable, loginUser, logoutUser,
      rollBackUser, updateDummyEmail, updatePassword, verifyIgnoringOtp

KeycloakService.deleteEmailAddress becomes deleteCurrentUserEmail per the new port,
but keeps pre-dev's body: the branch's version called a single-argument
updateDummyEmail that #900 replaced. UserAccountServiceTest verifications follow
whichever side names a method that still exists. KeycloakTestConfig's override
block keeps pre-dev's rollbackUser and drops both the branch's older rollBackUser
spelling and the removed updateEmail.

CI contract suite: 68 tests green.
coderabbitai[bot]
coderabbitai Bot requested changes Jul 31, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/main/java/de/caritas/cob/userservice/api/service/user/UserAccountService.java`:
- Around line 137-138: The email-change flow around
identityEmailAddressUpdater::updateCurrentUserEmail and deleteCurrentUserEmail
must define an application-level consistency boundary across Keycloak and local
writes. Implement an outbox or compensating workflow so local persistence
failures after the identity update cannot leave the systems with different email
values, and add a failure-path test covering that scenario.

In
`@src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java`:
- Around line 289-291: Fix the malformed email-port migration remnants across
the test sources: in
src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java:289-291,
remove the stray `@Override` and deleteCurrentUserEmail() declaration while
retaining deleteEmailAddress_Should_useServicesCorrectly as the `@Test` method; in
src/test/java/de/caritas/cob/userservice/api/service/user/UserAccountServiceTest.java:255-256
and :278-279, replace each local method declaration with
verify(identityEmailAddressUpdater).deleteCurrentUserEmail();; and in
src/test/java/de/caritas/cob/userservice/api/testConfig/KeycloakTestConfig.java:140-142,
remove the extra `@Override` before rollbackUser.

In
`@src/test/java/de/caritas/cob/userservice/api/admin/service/admin/update/UpdateAdminServiceIT.java`:
- Line 48: Update UpdateAdminServiceIT to verify that
IdentityEmailAddressUpdater receives the expected user identifier and newEmail
via updateEmailByUsername(...), in addition to the existing persisted Admin
assertions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 84bb6dd8-9173-48ab-be0d-0f311b18b514

📥 Commits

Reviewing files that changed from the base of the PR and between 425573e and 0bda09d.

⛔ Files ignored due to path filters (1)
  • tests/ci/test_module_boundaries.py is excluded by none and included by none
📒 Files selected for processing (18)
  • documentation/USER_SERVICE_STABILITY.md
  • src/main/java/de/caritas/cob/userservice/api/IdentityManager.java
  • src/main/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakService.java
  • src/main/java/de/caritas/cob/userservice/api/port/out/IdentityClient.java
  • src/main/java/de/caritas/cob/userservice/api/port/out/IdentityEmailAddressUpdater.java
  • src/main/java/de/caritas/cob/userservice/api/service/user/UserAccountService.java
  • src/test/java/de/caritas/cob/userservice/api/IdentityManagerTest.java
  • src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java
  • src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserAdminControllerE2EIT.java
  • src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserAdminControllerMultiTenancyTrueE2EIT.java
  • src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserControllerAuthorizationIT.java
  • src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserControllerIT.java
  • src/test/java/de/caritas/cob/userservice/api/admin/service/admin/create/CreateAdminServiceIT.java
  • src/test/java/de/caritas/cob/userservice/api/admin/service/admin/update/UpdateAdminServiceIT.java
  • src/test/java/de/caritas/cob/userservice/api/admin/service/consultant/create/agencyrelation/ConsultantAgencyRelationCreatorServiceTenantAwareIT.java
  • src/test/java/de/caritas/cob/userservice/api/admin/service/consultant/update/ConsultantUpdateServiceBase.java
  • src/test/java/de/caritas/cob/userservice/api/service/user/UserAccountServiceTest.java
  • src/test/java/de/caritas/cob/userservice/api/testConfig/KeycloakTestConfig.java
💤 Files with no reviewable changes (1)
  • src/main/java/de/caritas/cob/userservice/api/port/out/IdentityClient.java
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: mariadb-contract / MariaDB schema, statistics and replica contracts
  • GitHub Check: required integration tests
🧰 Additional context used
📓 Path-based instructions (2)
src/test/**/*.java

⚙️ CodeRabbit configuration file

src/test/**/*.java: Tests must be able to fail. Flag over-mocking that hides the defect,
assertions that cannot break, and missing edge cases.

Files:

  • src/test/java/de/caritas/cob/userservice/api/admin/service/admin/create/CreateAdminServiceIT.java
  • src/test/java/de/caritas/cob/userservice/api/admin/service/consultant/create/agencyrelation/ConsultantAgencyRelationCreatorServiceTenantAwareIT.java
  • src/test/java/de/caritas/cob/userservice/api/admin/service/admin/update/UpdateAdminServiceIT.java
  • src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserControllerAuthorizationIT.java
  • src/test/java/de/caritas/cob/userservice/api/admin/service/consultant/update/ConsultantUpdateServiceBase.java
  • src/test/java/de/caritas/cob/userservice/api/IdentityManagerTest.java
  • src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserAdminControllerMultiTenancyTrueE2EIT.java
  • src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserAdminControllerE2EIT.java
  • src/test/java/de/caritas/cob/userservice/api/testConfig/KeycloakTestConfig.java
  • src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java
  • src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserControllerIT.java
  • src/test/java/de/caritas/cob/userservice/api/service/user/UserAccountServiceTest.java
src/main/**/*.java

⚙️ CodeRabbit configuration file

src/main/**/*.java: Check behavior against the surrounding ORISO flow, not only types. Flag
missing transaction boundaries, swallowed exceptions, N+1 queries, and
privacy regressions around Matrix identifiers, chat content and user data.
Configuration must stay environment-driven — never hardcode hosts, IPs or
credentials (see ADR-005 / finding DB-M04).

Files:

  • src/main/java/de/caritas/cob/userservice/api/IdentityManager.java
  • src/main/java/de/caritas/cob/userservice/api/port/out/IdentityEmailAddressUpdater.java
  • src/main/java/de/caritas/cob/userservice/api/service/user/UserAccountService.java
  • src/main/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakService.java
🧠 Learnings (1)
📚 Learning: 2026-07-12T05:15:05.095Z
Learnt from: Storypapst
Repo: OpenResilienceInitiative/ORISO-UserService PR: 420
File: src/main/java/de/caritas/cob/userservice/api/conversation/service/AnonymousConversationCreatorService.java:34-35
Timestamp: 2026-07-12T05:15:05.095Z
Learning: In ORISO-UserService, treat `rocket-chat.enabled` defaulting to `false` (e.g., `Value("${rocket-chat.enabled:false}")`) as an intentional Matrix-only default. Do not flag code paths/config placeholders that use this default-false behavior as a bug in future reviews. Rocket.Chat must be explicitly enabled only by setting `ROCKET_CHAT_ENABLED=true` (or the equivalent `rocket-chat.enabled=true`), consistent with the repository’s `application*.properties`/configuration validator and the disabled Rocket.Chat service wiring.

Applied to files:

  • src/main/java/de/caritas/cob/userservice/api/IdentityManager.java
  • src/main/java/de/caritas/cob/userservice/api/port/out/IdentityEmailAddressUpdater.java
  • src/main/java/de/caritas/cob/userservice/api/service/user/UserAccountService.java
  • src/main/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakService.java
🪛 ast-grep (0.45.0)
src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java

[warning] 1187-1187: Avoid LDAP injections
Context: verify(usersResource).search("[email protected]", 0, Integer.MAX_VALUE)
Note: [CWE-90] Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection'). Security best practice.

(ldap-injection-java)


[warning] 1205-1205: Avoid LDAP injections
Context: verify(usersResource, never()).search(anyString(), anyInt(), anyInt())
Note: [CWE-90] Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection'). Security best practice.

(ldap-injection-java)

🪛 PMD (7.26.0)
src/test/java/de/caritas/cob/userservice/api/service/user/UserAccountServiceTest.java

[High] 256-256: Parse Error: ParseException: Parse exception in file 'src/test/java/de/caritas/cob/userservice/api/service/user/UserAccountServiceTest.java' at line 256, column 10: Encountered .
Was expecting one of:

(Parse Error)

🔇 Additional comments (19)
documentation/USER_SERVICE_STABILITY.md (1)

377-377: LGTM!

Also applies to: 428-440

src/main/java/de/caritas/cob/userservice/api/port/out/IdentityEmailAddressUpdater.java (1)

3-10: LGTM!

src/main/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakService.java (1)

34-34: LGTM!

Also applies to: 53-53, 87-87, 193-212, 756-772, 786-792

src/main/java/de/caritas/cob/userservice/api/IdentityManager.java (1)

9-9: LGTM!

Also applies to: 24-24, 45-46

src/main/java/de/caritas/cob/userservice/api/service/user/UserAccountService.java (1)

14-14: LGTM!

Also applies to: 42-42

src/test/java/de/caritas/cob/userservice/api/IdentityManagerTest.java (1)

10-10: LGTM!

Also applies to: 31-31, 60-60, 71-71

src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java (1)

15-15: LGTM!

Also applies to: 234-264, 1178-1210, 1868-1892

src/test/java/de/caritas/cob/userservice/api/service/user/UserAccountServiceTest.java (1)

29-29: LGTM!

Also applies to: 57-57, 196-196, 214-214, 234-234

src/test/java/de/caritas/cob/userservice/api/testConfig/KeycloakTestConfig.java (1)

84-93: LGTM!

src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserAdminControllerE2EIT.java (1)

44-44: LGTM!

Also applies to: 137-137

src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserAdminControllerMultiTenancyTrueE2EIT.java (1)

27-27: LGTM!

Also applies to: 80-80

src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserControllerAuthorizationIT.java (1)

81-81: LGTM!

Also applies to: 175-175

src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserControllerIT.java (1)

58-58: LGTM!

Also applies to: 294-294

src/test/java/de/caritas/cob/userservice/api/admin/service/admin/create/CreateAdminServiceIT.java (1)

29-29: LGTM!

Also applies to: 68-68

src/test/java/de/caritas/cob/userservice/api/admin/service/admin/update/UpdateAdminServiceIT.java (1)

19-19: LGTM!

src/test/java/de/caritas/cob/userservice/api/admin/service/consultant/create/agencyrelation/ConsultantAgencyRelationCreatorServiceTenantAwareIT.java (2)

33-33: LGTM!


93-93: LGTM!

src/test/java/de/caritas/cob/userservice/api/admin/service/consultant/update/ConsultantUpdateServiceBase.java (2)

21-21: LGTM!


46-46: LGTM!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/main/java/de/caritas/cob/userservice/api/service/user/UserAccountService.java
Comment on lines +137 to +138
identityEmailAddressUpdater::updateCurrentUserEmail,
identityEmailAddressUpdater::deleteCurrentUserEmail);

@coderabbitai coderabbitai Bot Jul 31, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Define an application-level consistency boundary for the email change.

updateCurrentUserEmail or deleteCurrentUserEmail completes before the local consultant, user, appointment, and notification work. If a later local write fails, Keycloak and ORISO store different email values.

Use an outbox or compensating workflow. A database transaction alone cannot make the Keycloak and database writes atomic. Add a failure-path test for a local persistence failure after the identity update.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/de/caritas/cob/userservice/api/service/user/UserAccountService.java`
around lines 137 - 138, The email-change flow around
identityEmailAddressUpdater::updateCurrentUserEmail and deleteCurrentUserEmail
must define an application-level consistency boundary across Keycloak and local
writes. Implement an outbox or compensating workflow so local persistence
failures after the identity update cannot leave the systems with different email
values, and add a failure-path test covering that scenario.

Source: Path instructions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...est/java/de/caritas/cob/userservice/api/admin/service/admin/update/UpdateAdminServiceIT.java
IdentityAuthentication.class,
IdentityDeactivator.class,
IdentityDummyEmailUpdater.class,
IdentityEmailAddressUpdater.class,

@coderabbitai coderabbitai Bot Jul 31, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Verify the email-port interaction in this test.

UpdateAdminServiceIT changes newEmail but only checks the persisted Admin values at Lines 60-83. Because IdentityEmailAddressUpdater is an unstubbed void method on the Mockito mock, this test passes if UpdateAdminService skips updateEmailByUsername(...) or sends the wrong email. Verify the port call with the expected identifier and newEmail.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/test/java/de/caritas/cob/userservice/api/admin/service/admin/update/UpdateAdminServiceIT.java`
at line 48, Update UpdateAdminServiceIT to verify that
IdentityEmailAddressUpdater receives the expected user identifier and newEmail
via updateEmailByUsername(...), in addition to the existing persisted Admin
assertions.

Source: Path instructions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
This was referenced Aug 2, 2026
DpaForwardEmailService and GlobalSmtpTestEmailService onto the e-mail design system #946
Closed
Complete the focused identity role-membership read boundary #795
Closed
@shazia-k
merge: reconcile PR #885 with pre-dev identity port split
ceb81d7
Integrate the focused IdentityEmailAddressUpdater port with pre-dev's identity
port split. The auto-merger handled all 8 Spring @MockitoBean test files
cleanly, inserting IdentityEmailAddressUpdater.class alphabetically. Six files
needed manual resolution:

- KeycloakService.updateProfile: adopt pre-dev's profile-based body, but read
  the representation once and pass it to the merged verifyEmail(Representation)
  signature.
- IdentityClient: rewrite to pre-dev's narrowed contract minus the three email
  methods this PR removes.
- IdentityManager.validateOneTimePassword: keep pre-dev's typed
  IdentityEmailVerification return, but route the email write through the new
  IdentityEmailAddressUpdater instead of IdentityClient.changeEmailAddress.
- IdentityManagerTest: verify against identitySecondFactor and
  identityEmailAddressUpdater.
- KeycloakTestConfig: retain PR's deleteCurrentUserEmail / updateEmailByUsername
  stubs and pre-dev's typed createUser signature.
- USER_SERVICE_STABILITY.md: fold both PR's email-mutation description and
  Identity/profile row addition into pre-dev's expanded structure.
coderabbitai[bot]
coderabbitai Bot reviewed Aug 7, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java (1)

368-381: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Install the metrics mock before verifying the retry metric.

The test creates outboundHttpMetrics but does not call keycloakService.setOutboundHttpMetrics(outboundHttpMetrics). Line 381 therefore always fails after the unauthorized retry.

 var outboundHttpMetrics = mock(OutboundHttpMetrics.class);
+keycloakService.setOutboundHttpMetrics(outboundHttpMetrics);
 var unauthorized =
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java`
around lines 368 - 381, Ensure the test setup for getOtpCredential installs the
outboundHttpMetrics mock via
keycloakService.setOutboundHttpMetrics(outboundHttpMetrics) before exercising
the request and verifying recordRetry. Keep the existing retry and Keycloak
interaction assertions unchanged.

Source: Path instructions

src/main/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakService.java (1)

214-221: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Validate the email before the username-based update.

updateEmailByUsername lowercases and persists emailAddress without calling userAccountInputValidator.validateEmailAddress(emailAddress). This bypasses adapter-owned validation on the post-verification path.

Validate before normalization and lookup.

Proposed fix
 public void updateEmailByUsername(String username, String emailAddress) {
+  userAccountInputValidator.validateEmailAddress(emailAddress);
   var lowerEmailAddress = emailAddress.toLowerCase(Locale.ROOT);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakService.java`
around lines 214 - 221, Update updateEmailByUsername to call
userAccountInputValidator.validateEmailAddress(emailAddress) before lowercasing
the address or performing the username lookup, preserving the existing
normalization and update flow afterward.
src/test/java/de/caritas/cob/userservice/api/admin/service/consultant/create/agencyrelation/ConsultantAgencyRelationCreatorServiceTenantAwareIT.java (1)

136-136: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Make the agency lookup contract observable.

The tests stub getAgenciesWithoutCaching(List.of(15L)) while getAgency(15L) remains stubbed. The persistence assertions can pass if the service ignores the batch lookup and uses the single-agency lookup. If the batch lookup is the intended path, verify it and reject the fallback stub. If both calls are intentional, verify both calls explicitly.

As per path instructions, tests must be able to fail.

Also applies to: 175-175

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/test/java/de/caritas/cob/userservice/api/admin/service/consultant/create/agencyrelation/ConsultantAgencyRelationCreatorServiceTenantAwareIT.java`
at line 136, Update the affected tests around the agency lookup stubs to verify
the intended getAgenciesWithoutCaching call and prevent the assertions from
passing via the getAgency fallback; if both lookup methods are expected,
explicitly verify both calls, otherwise remove or reject the unintended
single-agency stub.

Source: Path instructions

src/test/java/de/caritas/cob/userservice/api/admin/service/admin/create/CreateAdminServiceIT.java (1)

103-104: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Assert exact CreatedIdentity propagation.

The positive stubs return random CreatedIdentity values, but the tests assert only that Admin.id is non-null. The same class treats a missing CreatedIdentity.userId as an error. Use deterministic identities and assert that CreatedIdentity.userId becomes Admin.id. Also assert that the captured UserDTO contains VALID_EMAIL_ADDRESS.

As per path instructions, tests must be able to fail.

Also applies to: 138-139, 175-178, 208-211

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/test/java/de/caritas/cob/userservice/api/admin/service/admin/create/CreateAdminServiceIT.java`
around lines 103 - 104, Update the positive test stubs around
identityClient.createUser in the affected CreateAdminServiceIT scenarios to
return deterministic CreatedIdentity instances with explicit userId values, then
assert Admin.id exactly matches that userId rather than only being non-null.
Capture the UserDTO passed to identityClient and assert its email equals
VALID_EMAIL_ADDRESS in each applicable test, while preserving the existing
missing-userId error coverage.

Source: Path instructions

src/test/java/de/caritas/cob/userservice/api/IdentityManagerTest.java (1)

53-76: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Test the non-created verification result.

The tests cover only created() == true. Add a case where created() == false and verify that identityEmailAddressUpdater.updateEmailByUsername is not called.

As per path instructions, “Tests must be able to fail” and must cover missing edge cases.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/test/java/de/caritas/cob/userservice/api/IdentityManagerTest.java` around
lines 53 - 76, Add a test for validateOneTimePassword using an
IdentityEmailVerification with created() == false, and verify
identityEmailAddressUpdater.updateEmailByUsername is never invoked. Keep the
existing successful verification tests unchanged and configure the
identitySecondFactor response for the non-created result.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In
`@src/main/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakService.java`:
- Around line 214-221: Update updateEmailByUsername to call
userAccountInputValidator.validateEmailAddress(emailAddress) before lowercasing
the address or performing the username lookup, preserving the existing
normalization and update flow afterward.

In
`@src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java`:
- Around line 368-381: Ensure the test setup for getOtpCredential installs the
outboundHttpMetrics mock via
keycloakService.setOutboundHttpMetrics(outboundHttpMetrics) before exercising
the request and verifying recordRetry. Keep the existing retry and Keycloak
interaction assertions unchanged.

In
`@src/test/java/de/caritas/cob/userservice/api/admin/service/admin/create/CreateAdminServiceIT.java`:
- Around line 103-104: Update the positive test stubs around
identityClient.createUser in the affected CreateAdminServiceIT scenarios to
return deterministic CreatedIdentity instances with explicit userId values, then
assert Admin.id exactly matches that userId rather than only being non-null.
Capture the UserDTO passed to identityClient and assert its email equals
VALID_EMAIL_ADDRESS in each applicable test, while preserving the existing
missing-userId error coverage.

In
`@src/test/java/de/caritas/cob/userservice/api/admin/service/consultant/create/agencyrelation/ConsultantAgencyRelationCreatorServiceTenantAwareIT.java`:
- Line 136: Update the affected tests around the agency lookup stubs to verify
the intended getAgenciesWithoutCaching call and prevent the assertions from
passing via the getAgency fallback; if both lookup methods are expected,
explicitly verify both calls, otherwise remove or reject the unintended
single-agency stub.

In `@src/test/java/de/caritas/cob/userservice/api/IdentityManagerTest.java`:
- Around line 53-76: Add a test for validateOneTimePassword using an
IdentityEmailVerification with created() == false, and verify
identityEmailAddressUpdater.updateEmailByUsername is never invoked. Keep the
existing successful verification tests unchanged and configure the
identitySecondFactor response for the non-created result.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 39e1a4fb-a9b9-4a5a-b83e-1c1d78014172

📥 Commits

Reviewing files that changed from the base of the PR and between 0bda09d and ceb81d7.

⛔ Files ignored due to path filters (1)
  • tests/ci/test_module_boundaries.py is excluded by none and included by none
📒 Files selected for processing (15)
  • documentation/USER_SERVICE_STABILITY.md
  • src/main/java/de/caritas/cob/userservice/api/IdentityManager.java
  • src/main/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakService.java
  • src/main/java/de/caritas/cob/userservice/api/port/out/IdentityClient.java
  • src/test/java/de/caritas/cob/userservice/api/IdentityManagerTest.java
  • src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java
  • src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserAdminControllerE2EIT.java
  • src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserAdminControllerMultiTenancyTrueE2EIT.java
  • src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserControllerAuthorizationIT.java
  • src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserControllerIT.java
  • src/test/java/de/caritas/cob/userservice/api/admin/service/admin/create/CreateAdminServiceIT.java
  • src/test/java/de/caritas/cob/userservice/api/admin/service/admin/update/UpdateAdminServiceIT.java
  • src/test/java/de/caritas/cob/userservice/api/admin/service/consultant/create/agencyrelation/ConsultantAgencyRelationCreatorServiceTenantAwareIT.java
  • src/test/java/de/caritas/cob/userservice/api/admin/service/consultant/update/ConsultantUpdateServiceBase.java
  • src/test/java/de/caritas/cob/userservice/api/testConfig/KeycloakTestConfig.java
📜 Review details
⚠️ CI failures not shown inline (6)

GitHub Actions: UserService Branch Validation / required integration tests: merge: reconcile PR #885 with pre-dev identity port split

Conclusion: failure

View job details

anslate
 [INFO] Processing operation translateGroupChatAuthorContent
 [INFO] Processing operation getMultilingualTenantById
 [INFO] Processing operation updateTenant
 [INFO] Processing operation getAllTenants
 [INFO] Processing operation getTenantById
 [INFO] Processing operation getRestrictedTenantDataBySubdomain
 [INFO] Processing operation getRestrictedTenantDataByTenantId
 [INFO] Processing operation getRestrictedSingleTenancyTenantData
 [INFO] Processing operation getRestrictedTenantData
 [INFO] Processing operation canAccessTenant
 [INFO] Processing operation getDataProcessingAgreementPreview
 [INFO] Processing operation confirmDataProcessingAgreement
 [INFO] Processing operation getDataProcessingAgreementSignatures
 [INFO] Processing operation getDataProcessingAgreementGate
 [INFO] Processing operation createDataProcessingAgreementSignInvite
 [INFO] Processing operation publishDataProcessingAgreement
 [INFO] Processing operation getDataProcessingAgreementVersions
 [INFO] Processing operation uploadTenantMedia
 [INFO] Processing operation getTenantMedia
 [INFO] 'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [http://localhost] for server URL [http://localhost/]
 [INFO] 'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [http://localhost] for server URL [http://localhost/]
 [INFO] Model uploadTenantMedia_request not generated since it's marked as unused (due to form parameters) and `skipFormModel` (global property) set to true (default)
 [INFO] writing file /home/runner/work/ORISO-UserService/ORISO-UserService/target/generated-sources/openapi/de/caritas/cob/userservice/tenantadminservice/generated/web/model/AdminTenantDTO.java
 [INFO] writing file /home/runner/work/ORISO-UserService/ORISO-UserService/target/generated-sources/openapi/docs/AdminTenantDTO.md
 [INFO] writing file /home/runner/work/ORISO-UserService/ORISO-UserService/target/generated-sources/openapi/de/caritas/cob/userservice/tenantadminservice...

GitHub Actions: UserService Branch Validation / mariadb-contract _ MariaDB schema, statistics and replica contracts: merge: reconcile PR #885 with pre-dev identity port split

Conclusion: failure

View job details

anslate
 [INFO] Processing operation translateGroupChatAuthorContent
 [INFO] Processing operation getMultilingualTenantById
 [INFO] Processing operation updateTenant
 [INFO] Processing operation getAllTenants
 [INFO] Processing operation getTenantById
 [INFO] Processing operation getRestrictedTenantDataBySubdomain
 [INFO] Processing operation getRestrictedTenantDataByTenantId
 [INFO] Processing operation getRestrictedSingleTenancyTenantData
 [INFO] Processing operation getRestrictedTenantData
 [INFO] Processing operation canAccessTenant
 [INFO] Processing operation getDataProcessingAgreementPreview
 [INFO] Processing operation confirmDataProcessingAgreement
 [INFO] Processing operation getDataProcessingAgreementSignatures
 [INFO] Processing operation getDataProcessingAgreementGate
 [INFO] Processing operation createDataProcessingAgreementSignInvite
 [INFO] Processing operation publishDataProcessingAgreement
 [INFO] Processing operation getDataProcessingAgreementVersions
 [INFO] Processing operation uploadTenantMedia
 [INFO] Processing operation getTenantMedia
 [INFO] 'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [http://localhost] for server URL [http://localhost/]
 [INFO] 'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [http://localhost] for server URL [http://localhost/]
 [INFO] Model uploadTenantMedia_request not generated since it's marked as unused (due to form parameters) and `skipFormModel` (global property) set to true (default)
 [INFO] writing file /home/runner/work/ORISO-UserService/ORISO-UserService/target/generated-sources/openapi/de/caritas/cob/userservice/tenantadminservice/generated/web/model/AdminTenantDTO.java
 [INFO] writing file /home/runner/work/ORISO-UserService/ORISO-UserService/target/generated-sources/openapi/docs/AdminTenantDTO.md
 [INFO] writing file /home/runner/work/ORISO-UserService/ORISO-UserService/target/generated-sources/openapi/de/caritas/cob/userservice/tenantadminservice...

GitHub Actions: UserService Branch Validation / 1_required integration tests.txt: merge: reconcile PR #885 with pre-dev identity port split

Conclusion: failure

View job details

anslate
 [INFO] Processing operation translateGroupChatAuthorContent
 [INFO] Processing operation getMultilingualTenantById
 [INFO] Processing operation updateTenant
 [INFO] Processing operation getAllTenants
 [INFO] Processing operation getTenantById
 [INFO] Processing operation getRestrictedTenantDataBySubdomain
 [INFO] Processing operation getRestrictedTenantDataByTenantId
 [INFO] Processing operation getRestrictedSingleTenancyTenantData
 [INFO] Processing operation getRestrictedTenantData
 [INFO] Processing operation canAccessTenant
 [INFO] Processing operation getDataProcessingAgreementPreview
 [INFO] Processing operation confirmDataProcessingAgreement
 [INFO] Processing operation getDataProcessingAgreementSignatures
 [INFO] Processing operation getDataProcessingAgreementGate
 [INFO] Processing operation createDataProcessingAgreementSignInvite
 [INFO] Processing operation publishDataProcessingAgreement
 [INFO] Processing operation getDataProcessingAgreementVersions
 [INFO] Processing operation uploadTenantMedia
 [INFO] Processing operation getTenantMedia
 [INFO] 'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [http://localhost] for server URL [http://localhost/]
 [INFO] 'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [http://localhost] for server URL [http://localhost/]
 [INFO] Model uploadTenantMedia_request not generated since it's marked as unused (due to form parameters) and `skipFormModel` (global property) set to true (default)
 [INFO] writing file /home/runner/work/ORISO-UserService/ORISO-UserService/target/generated-sources/openapi/de/caritas/cob/userservice/tenantadminservice/generated/web/model/AdminTenantDTO.java
 [INFO] writing file /home/runner/work/ORISO-UserService/ORISO-UserService/target/generated-sources/openapi/docs/AdminTenantDTO.md
 [INFO] writing file /home/runner/work/ORISO-UserService/ORISO-UserService/target/generated-sources/openapi/de/caritas/cob/userservice/tenantadminservice...

GitHub Actions: UserService Branch Validation / test and build UserService: merge: reconcile PR #885 with pre-dev identity port split

Conclusion: failure

View job details

Processing operation translateGroupChatAuthorContent
 [INFO] Processing operation getMultilingualTenantById
 [INFO] Processing operation updateTenant
 [INFO] Processing operation getAllTenants
 [INFO] Processing operation getTenantById
 [INFO] Processing operation getRestrictedTenantDataBySubdomain
 [INFO] Processing operation getRestrictedTenantDataByTenantId
 [INFO] Processing operation getRestrictedSingleTenancyTenantData
 [INFO] Processing operation getRestrictedTenantData
 [INFO] Processing operation canAccessTenant
 [INFO] Processing operation getDataProcessingAgreementPreview
 [INFO] Processing operation confirmDataProcessingAgreement
 [INFO] Processing operation getDataProcessingAgreementSignatures
 [INFO] Processing operation getDataProcessingAgreementGate
 [INFO] Processing operation createDataProcessingAgreementSignInvite
 [INFO] Processing operation publishDataProcessingAgreement
 [INFO] Processing operation getDataProcessingAgreementVersions
 [INFO] Processing operation uploadTenantMedia
 [INFO] Processing operation getTenantMedia
 [INFO] 'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [http://localhost] for server URL [http://localhost/]
 [INFO] 'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [http://localhost] for server URL [http://localhost/]
 [INFO] Model uploadTenantMedia_request not generated since it's marked as unused (due to form parameters) and `skipFormModel` (global property) set to true (default)
 [INFO] writing file /home/runner/work/ORISO-UserService/ORISO-UserService/target/generated-sources/openapi/de/caritas/cob/userservice/tenantadminservice/generated/web/model/AdminTenantDTO.java
 [INFO] writing file /home/runner/work/ORISO-UserService/ORISO-UserService/target/generated-sources/openapi/docs/AdminTenantDTO.md
 [INFO] writing file /home/runner/work/ORISO-UserService/ORISO-UserService/target/generated-sources/openapi/de/caritas/cob/userservice/tenantadminservice/generated/web/m...

GitHub Actions: UserService Branch Validation / 2_mariadb-contract _ MariaDB schema, statistics and replica contracts.txt: merge: reconcile PR #885 with pre-dev identity port split

Conclusion: failure

View job details

anslate
 [INFO] Processing operation translateGroupChatAuthorContent
 [INFO] Processing operation getMultilingualTenantById
 [INFO] Processing operation updateTenant
 [INFO] Processing operation getAllTenants
 [INFO] Processing operation getTenantById
 [INFO] Processing operation getRestrictedTenantDataBySubdomain
 [INFO] Processing operation getRestrictedTenantDataByTenantId
 [INFO] Processing operation getRestrictedSingleTenancyTenantData
 [INFO] Processing operation getRestrictedTenantData
 [INFO] Processing operation canAccessTenant
 [INFO] Processing operation getDataProcessingAgreementPreview
 [INFO] Processing operation confirmDataProcessingAgreement
 [INFO] Processing operation getDataProcessingAgreementSignatures
 [INFO] Processing operation getDataProcessingAgreementGate
 [INFO] Processing operation createDataProcessingAgreementSignInvite
 [INFO] Processing operation publishDataProcessingAgreement
 [INFO] Processing operation getDataProcessingAgreementVersions
 [INFO] Processing operation uploadTenantMedia
 [INFO] Processing operation getTenantMedia
 [INFO] 'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [http://localhost] for server URL [http://localhost/]
 [INFO] 'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [http://localhost] for server URL [http://localhost/]
 [INFO] Model uploadTenantMedia_request not generated since it's marked as unused (due to form parameters) and `skipFormModel` (global property) set to true (default)
 [INFO] writing file /home/runner/work/ORISO-UserService/ORISO-UserService/target/generated-sources/openapi/de/caritas/cob/userservice/tenantadminservice/generated/web/model/AdminTenantDTO.java
 [INFO] writing file /home/runner/work/ORISO-UserService/ORISO-UserService/target/generated-sources/openapi/docs/AdminTenantDTO.md
 [INFO] writing file /home/runner/work/ORISO-UserService/ORISO-UserService/target/generated-sources/openapi/de/caritas/cob/userservice/tenantadminservice...

GitHub Actions: UserService Branch Validation / 0_test and build UserService.txt: merge: reconcile PR #885 with pre-dev identity port split

Conclusion: failure

View job details

Processing operation translateGroupChatAuthorContent
 [INFO] Processing operation getMultilingualTenantById
 [INFO] Processing operation updateTenant
 [INFO] Processing operation getAllTenants
 [INFO] Processing operation getTenantById
 [INFO] Processing operation getRestrictedTenantDataBySubdomain
 [INFO] Processing operation getRestrictedTenantDataByTenantId
 [INFO] Processing operation getRestrictedSingleTenancyTenantData
 [INFO] Processing operation getRestrictedTenantData
 [INFO] Processing operation canAccessTenant
 [INFO] Processing operation getDataProcessingAgreementPreview
 [INFO] Processing operation confirmDataProcessingAgreement
 [INFO] Processing operation getDataProcessingAgreementSignatures
 [INFO] Processing operation getDataProcessingAgreementGate
 [INFO] Processing operation createDataProcessingAgreementSignInvite
 [INFO] Processing operation publishDataProcessingAgreement
 [INFO] Processing operation getDataProcessingAgreementVersions
 [INFO] Processing operation uploadTenantMedia
 [INFO] Processing operation getTenantMedia
 [INFO] 'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [http://localhost] for server URL [http://localhost/]
 [INFO] 'host' (OAS 2.0) or 'servers' (OAS 3.0) not defined in the spec. Default to [http://localhost] for server URL [http://localhost/]
 [INFO] Model uploadTenantMedia_request not generated since it's marked as unused (due to form parameters) and `skipFormModel` (global property) set to true (default)
 [INFO] writing file /home/runner/work/ORISO-UserService/ORISO-UserService/target/generated-sources/openapi/de/caritas/cob/userservice/tenantadminservice/generated/web/model/AdminTenantDTO.java
 [INFO] writing file /home/runner/work/ORISO-UserService/ORISO-UserService/target/generated-sources/openapi/docs/AdminTenantDTO.md
 [INFO] writing file /home/runner/work/ORISO-UserService/ORISO-UserService/target/generated-sources/openapi/de/caritas/cob/userservice/tenantadminservice/generated/web/m...
🧰 Additional context used
📓 Path-based instructions (2)
src/test/**/*.java

⚙️ CodeRabbit configuration file

src/test/**/*.java: Tests must be able to fail. Flag over-mocking that hides the defect,
assertions that cannot break, and missing edge cases.

Files:

  • src/test/java/de/caritas/cob/userservice/api/admin/service/consultant/create/agencyrelation/ConsultantAgencyRelationCreatorServiceTenantAwareIT.java
  • src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserAdminControllerE2EIT.java
  • src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserControllerIT.java
  • src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserControllerAuthorizationIT.java
  • src/test/java/de/caritas/cob/userservice/api/admin/service/admin/create/CreateAdminServiceIT.java
  • src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserAdminControllerMultiTenancyTrueE2EIT.java
  • src/test/java/de/caritas/cob/userservice/api/admin/service/consultant/update/ConsultantUpdateServiceBase.java
  • src/test/java/de/caritas/cob/userservice/api/IdentityManagerTest.java
  • src/test/java/de/caritas/cob/userservice/api/admin/service/admin/update/UpdateAdminServiceIT.java
  • src/test/java/de/caritas/cob/userservice/api/testConfig/KeycloakTestConfig.java
  • src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java
src/main/**/*.java

⚙️ CodeRabbit configuration file

src/main/**/*.java: Check behavior against the surrounding ORISO flow, not only types. Flag
missing transaction boundaries, swallowed exceptions, N+1 queries, and
privacy regressions around Matrix identifiers, chat content and user data.
Configuration must stay environment-driven — never hardcode hosts, IPs or
credentials (see ADR-005 / finding DB-M04).

Files:

  • src/main/java/de/caritas/cob/userservice/api/IdentityManager.java
  • src/main/java/de/caritas/cob/userservice/api/port/out/IdentityClient.java
  • src/main/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakService.java
🧠 Learnings (1)
📚 Learning: 2026-07-12T05:15:05.095Z
Learnt from: Storypapst
Repo: OpenResilienceInitiative/ORISO-UserService PR: 420
File: src/main/java/de/caritas/cob/userservice/api/conversation/service/AnonymousConversationCreatorService.java:34-35
Timestamp: 2026-07-12T05:15:05.095Z
Learning: In ORISO-UserService, treat `rocket-chat.enabled` defaulting to `false` (e.g., `Value("${rocket-chat.enabled:false}")`) as an intentional Matrix-only default. Do not flag code paths/config placeholders that use this default-false behavior as a bug in future reviews. Rocket.Chat must be explicitly enabled only by setting `ROCKET_CHAT_ENABLED=true` (or the equivalent `rocket-chat.enabled=true`), consistent with the repository’s `application*.properties`/configuration validator and the disabled Rocket.Chat service wiring.

Applied to files:

  • src/main/java/de/caritas/cob/userservice/api/IdentityManager.java
  • src/main/java/de/caritas/cob/userservice/api/port/out/IdentityClient.java
  • src/main/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakService.java
🪛 ast-grep (0.45.0)
src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java

[warning] 1059-1059: Avoid LDAP injections
Context: verify(usersResource).search("anotherEmail", 0, Integer.MAX_VALUE)
Note: [CWE-90] Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection'). Security best practice.

(ldap-injection-java)


[warning] 1088-1088: Avoid LDAP injections
Context: verify(usersResource, never()).search(any(), any(), any())
Note: [CWE-90] Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection'). Security best practice.

(ldap-injection-java)


[warning] 1098-1098: Avoid LDAP injections
Context: usersResource.search(any(), any(), any())
Note: [CWE-90] Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection'). Security best practice.

(ldap-injection-java)


[warning] 1111-1111: Avoid LDAP injections
Context: verify(usersResource).search("newemail", 0, Integer.MAX_VALUE)
Note: [CWE-90] Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection'). Security best practice.

(ldap-injection-java)

🪛 GitHub Actions: UserService Branch Validation / 0_test and build UserService.txt
src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java

[error] 295-295: Spotless google-java-format check failed: illegal start of expression. Fix the syntax near line 295.

🪛 GitHub Actions: UserService Branch Validation / test and build UserService
src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java

[error] 295-295: Spotless google-java-format check failed: illegal start of expression.

🔇 Additional comments (7)
src/test/java/de/caritas/cob/userservice/api/admin/service/admin/update/UpdateAdminServiceIT.java (1)

51-51: 🗄️ Data Integrity & Integration

Add the missing email-port assertion.

The positive test still checks only local Admin rows. The unstubbed IdentityEmailAddressUpdater mock does not fail when updateEmailByUsername(...) is skipped or receives the wrong identifier or email. Verify that the port receives VALID_ADMIN_ID and newEmail.

As per path instructions, tests must be able to fail.

Source: Path instructions

src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserAdminControllerE2EIT.java (1)

43-52: LGTM!

Also applies to: 140-147

src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserAdminControllerMultiTenancyTrueE2EIT.java (1)

26-35: LGTM!

Also applies to: 83-90

src/test/java/de/caritas/cob/userservice/api/adapters/web/controller/UserControllerIT.java (1)

58-65: LGTM!

Also applies to: 297-304

src/test/java/de/caritas/cob/userservice/api/admin/service/admin/create/CreateAdminServiceIT.java (1)

28-37: LGTM!

Also applies to: 71-79, 260-262

src/test/java/de/caritas/cob/userservice/api/admin/service/consultant/create/agencyrelation/ConsultantAgencyRelationCreatorServiceTenantAwareIT.java (1)

33-40: LGTM!

Also applies to: 96-104

src/main/java/de/caritas/cob/userservice/api/port/out/IdentityClient.java (1)

13-25: 🗄️ Data Integrity & Integration

No contract gap remains.

Current email updates route through IdentityEmailAddressUpdater, and the updated test expectations no longer call the removed IdentityClient methods.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@shazia-k
fix(test): repair merge artifacts left in KeycloakServiceTest and Use…
a73fb5f
…rAccountServiceTest

Both files had google-java-format parse errors from a bad earlier merge that
left dangling '@OverRide public void deleteCurrentUserEmail() {' fragments
above the actual test methods.

- KeycloakServiceTest: collapse the two colliding method signatures into the
  new deleteCurrentUserEmail_Should_useServicesCorrectly (matches PR 885's
  rename of the underlying method).
- UserAccountServiceTest: remove the stray @OverRide + method-signature
  fragments and switch the two consultant/user 'delete address' assertions
  from identityClient.deleteEmailAddress/changeEmailAddress (removed by
  PR 885) to identityEmailAddressUpdater.deleteCurrentUserEmail /
  updateCurrentUserEmail.
coderabbitai[bot]
coderabbitai Bot reviewed Aug 7, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java (4)

1209-1241: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Cover mixed-case normalization on the current-user path.

The test passes a lowercase address and expects lowercase values. It cannot detect removal of Locale.ROOT normalization from updateCurrentUserEmail. Pass a mixed-case address, then keep the lowercase expectations for search, setEmail, and the update payload.

Proposed test change
-    this.keycloakService.updateCurrentUserEmail("[email protected]");
+    this.keycloakService.updateCurrentUserEmail("[email protected]");

As per path instructions, tests must be able to fail and must cover edge cases.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java`
around lines 1209 - 1241, Update
updateCurrentUserEmail_Should_UpdateOnce_When_EmailIsChangedAndAvailable to use
a mixed-case input email while retaining lowercase expectations for
UsersResource.search, UserRepresentation.setEmail, and the captured update
payload, so the test verifies Locale.ROOT normalization on the current-user
path.

Source: Path instructions


2046-2060: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Verify the required single username lookup.

Both tests stub usersResource.search(USERNAME) but never verify it. The changed-email case can pass without a username lookup. The unchanged-email case can pass by returning before lookup. Add exact one-search verification to both tests. This enforces the contract of one username lookup and at most one update.

Proposed assertions
     keycloakService.updateEmailByUsername(USERNAME, "[email protected]");
 
+    verify(usersResource, times(1)).search(USERNAME);

Add the same assertion to the unchanged-email test.

As per path instructions, tests must be able to fail and must cover interaction bounds.

Also applies to: 2062-2074

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java`
around lines 2046 - 2060, Update both tests,
updateEmailByUsername_Should_UpdateEmail_When_EmailDiffers and the
unchanged-email test, to verify usersResource.search(USERNAME) is called exactly
once. Keep the existing update assertions, ensuring the tests cover one username
lookup and at most one update.

Source: Path instructions


304-308: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

Bind the fixtures to the authenticated user ID.

givenUsersResourceWithAnyUserId accepts every ID. These tests therefore pass if KeycloakService resolves or updates a different user. Stub and verify usersResource.get(userId) exactly. Use "userId" in the current-email test.

As per path instructions, tests must be able to fail and must not hide identity-binding defects.

Also applies to: 1209-1223

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java`
around lines 304 - 308, Update the affected KeycloakService tests, including the
current-email test and the additional cases around the referenced fixture, to
stub usersResource.get(userId) with the exact authenticated ID instead of using
givenUsersResourceWithAnyUserId. Verify that usersResource.get(userId) is
called, using the literal "userId" where required, so the tests fail when a
different user ID is resolved or updated.

Source: Path instructions


238-247: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Make the renamed tests assert the email write.

These tests verify only validateEmailAddress and authenticatedUser.getUserId(). They pass if updateCurrentUserEmail does not read, search, or update Keycloak. Assert the representation read, normalized availability search, setEmail, and update. Keep the null-email case, but make it prove that the representation is persisted.

As per path instructions, tests must be able to fail and must cover edge cases.

Also applies to: 260-268

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java`
around lines 238 - 247, The renamed updateCurrentUserEmail tests currently
verify only setup and validation, not the Keycloak write flow. Update
updateCurrentUserEmail_Should_useServicesCorrectly and the null-email case to
assert the user representation is read, email availability is searched with the
normalized value, UserRepresentation.setEmail is called with the expected value,
and UserResource.update persists it; retain the null-email scenario and ensure
it proves persistence.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In
`@src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java`:
- Around line 1209-1241: Update
updateCurrentUserEmail_Should_UpdateOnce_When_EmailIsChangedAndAvailable to use
a mixed-case input email while retaining lowercase expectations for
UsersResource.search, UserRepresentation.setEmail, and the captured update
payload, so the test verifies Locale.ROOT normalization on the current-user
path.
- Around line 2046-2060: Update both tests,
updateEmailByUsername_Should_UpdateEmail_When_EmailDiffers and the
unchanged-email test, to verify usersResource.search(USERNAME) is called exactly
once. Keep the existing update assertions, ensuring the tests cover one username
lookup and at most one update.
- Around line 304-308: Update the affected KeycloakService tests, including the
current-email test and the additional cases around the referenced fixture, to
stub usersResource.get(userId) with the exact authenticated ID instead of using
givenUsersResourceWithAnyUserId. Verify that usersResource.get(userId) is
called, using the literal "userId" where required, so the tests fail when a
different user ID is resolved or updated.
- Around line 238-247: The renamed updateCurrentUserEmail tests currently verify
only setup and validation, not the Keycloak write flow. Update
updateCurrentUserEmail_Should_useServicesCorrectly and the null-email case to
assert the user representation is read, email availability is searched with the
normalized value, UserRepresentation.setEmail is called with the expected value,
and UserResource.update persists it; retain the null-email scenario and ensure
it proves persistence.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8996bcb3-430e-4ec7-8a3e-ac9beff25d18

📥 Commits

Reviewing files that changed from the base of the PR and between ceb81d7 and a73fb5f.

📒 Files selected for processing (2)
  • src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java
  • src/test/java/de/caritas/cob/userservice/api/service/user/UserAccountServiceTest.java
📜 Review details
⏰ Context from checks skipped due to timeout. (6)
  • GitHub Check: mariadb-contract / MariaDB schema, statistics, scheduler lease and replica contracts
  • GitHub Check: Redis shared-state contracts
  • GitHub Check: required integration tests
  • GitHub Check: openapi provider and consumer contracts
  • GitHub Check: required integration tests
  • GitHub Check: mariadb-contract / MariaDB schema, statistics and replica contracts
🧰 Additional context used
📓 Path-based instructions (1)
src/test/**/*.java

⚙️ CodeRabbit configuration file

src/test/**/*.java: Tests must be able to fail. Flag over-mocking that hides the defect,
assertions that cannot break, and missing edge cases.

Files:

  • src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java
  • src/test/java/de/caritas/cob/userservice/api/service/user/UserAccountServiceTest.java
🔇 Additional comments (3)
src/test/java/de/caritas/cob/userservice/api/adapters/keycloak/KeycloakServiceTest.java (1)

15-15: LGTM!

Also applies to: 293-293

src/test/java/de/caritas/cob/userservice/api/service/user/UserAccountServiceTest.java (2)

29-29: LGTM!

Also applies to: 57-57, 196-196, 214-214, 234-234


255-256: 🎯 Functional Correctness

No change needed for the empty-email negative verification.

changeUserAccountEmailAddress(Optional.empty()) currently routes only through deleteCurrentUserEmail; it does not call updateCurrentUserEmail with a non-null argument, so this never(anyString()) assertion is not masking the reported null-edge-case failure mode.

			> Likely an incorrect or invalid review comment.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@shazia-k
style: drop orphan @OverRide in KeycloakTestConfig anonymous class
e4c2538
The @OverRide on line 135 had no method under it — leftover from an earlier
merge that removed the updateEmail(String, String) stub when PR 885 dropped
that method from IdentityClient.
shazia-k
shazia-k approved these changes Aug 7, 2026
View reviewed changes
@shazia-k
shazia-k merged commit 2dc69b0 into pre-dev Aug 7, 2026
12 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@shazia-k
shazia-k deleted the replay/identity-email-mutation-797 branch August 7, 2026 10:48
@coderabbitai coderabbitai Bot mentioned this pull request Aug 12, 2026
Split consultant display name into public and internal names #996
Closed
7 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Aug 20, 2026
DPA_SIGNED_NOTICE and the onboarding-wizard DPA forward path #1031
Closed
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@coderabbitai coderabbitai[bot] coderabbitai[bot] requested changes
@shazia-k shazia-k shazia-k approved these changes
@Hassan9215 Hassan9215 Awaiting requested review from Hassan9215
@shanzaeimran shanzaeimran Awaiting requested review from shanzaeimran

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Storypapst @shazia-k
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.