Skip to content

Prevent querying all clients in client composite import#1292

Open
adhurjaty wants to merge 3 commits intoadorsys:mainfrom
appfolio:improve-client-composite-import-runtime
Open

Prevent querying all clients in client composite import#1292
adhurjaty wants to merge 3 commits intoadorsys:mainfrom
appfolio:improve-client-composite-import-runtime

Conversation

@adhurjaty
Copy link
Copy Markdown
Contributor

@adhurjaty adhurjaty commented Mar 27, 2025

What this PR does / why we need it:

As the number of clients in our realms increases, we noticed that the time to run the configuration job increased as well, even though we were omitting the clients from the config JSON. We noticed that the RoleImportService step was taking a much longer time than the other steps.

This change updates the RealmCompositeRepository to instead get the realm composites and query the clients based on that, instead of getting all the clients and checking against the RoleResource to see if it is a composite. This results in a much faster execution of the role import step.

This change updates the ClientCompositeImport services to more efficiently remove composites that need to be removed. The current method gets all clients and excludes config import client composites, then gets the intersection between that and the existing client composites. The proposed change simply retrieves the existing client composites and excludes the config client composites

Current

Screenshot 2025-04-21 at 7 56 23 AM

Proposed

Screenshot 2025-04-21 at 7 56 30 AM

Special notes for your reviewer:

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

  • the CHANGELOG.md release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR

@sonarqubecloud
Copy link
Copy Markdown

@adhurjaty adhurjaty changed the title Prevent querying all clients on searching matching client composites Prevent querying all clients in client composite import Apr 21, 2025
@AssahBismarkabah AssahBismarkabah added enhancement java Pull requests that update Java code pr contribution welcome A PR contribution is welcome. labels Sep 18, 2025
@adhurjaty adhurjaty force-pushed the improve-client-composite-import-runtime branch from 8692fb4 to 3ec707e Compare September 23, 2025 16:54
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

hello @adhurjaty
Please can you resolve your conflicts ??

@adhurjaty adhurjaty force-pushed the improve-client-composite-import-runtime branch from 3ec707e to 01f03e1 Compare January 28, 2026 18:28
@adhurjaty
Copy link
Copy Markdown
Contributor Author

Looks like test coverage is slightly under the threshold for 25.0.1. I don't have access to the coverage tool, so it's not easy for me to figure out where the gaps I'd need to fill are. Can someone help out with this?

@Nkwenti-Severian-Ndongtsop
Copy link
Copy Markdown
Collaborator

Thanks, @adhurjaty, for the quick feedback
Please can you add some tests for your implementation, so the coverage will increase

@adhurjaty adhurjaty force-pushed the improve-client-composite-import-runtime branch from 39d2b58 to 5c19fb0 Compare January 29, 2026 16:42
@sonarqubecloud
Copy link
Copy Markdown

@Nkwenti-Severian-Ndongtsop
Copy link
Copy Markdown
Collaborator

@adhurjaty, Your changes bring in some conflicts
Please can you have a look and resolve them ??

@Motouom Motouom moved this from Review to Awaiting Feedback in os-competence-center-board Mar 4, 2026
@adhurjaty adhurjaty force-pushed the improve-client-composite-import-runtime branch 2 times, most recently from 346d9d5 to 09430c7 Compare March 12, 2026 14:30
@adhurjaty adhurjaty force-pushed the improve-client-composite-import-runtime branch from 1d08a13 to 604e3c7 Compare March 16, 2026 14:47
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement java Pull requests that update Java code pr contribution welcome A PR contribution is welcome.

Projects

Status: Awaiting Feedback

Development

Successfully merging this pull request may close these issues.

4 participants