Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor identity-related code #25921

Merged
merged 4 commits into from
Dec 12, 2024

Conversation

koevskinikola
Copy link
Member

Description

  1. Align Group service and transformers with other Identity-related classes.
  2. Introduce duplicate checks for Role and Group entity assignment (Tenants already have it).

Checklist

Related issues

closes #25905

Align the Group-related service and transformers with
the other Identity-related classes. The refactoring of
the remaining Identity-related classes occurred during
the initial Group service and REST API implementation.
Check if an entity has already been assigned
within the Group and Role AddEntity processors.
Add test coverage for duplicate entity assignment in
the Group and Role add entity processors.
@koevskinikola koevskinikola self-assigned this Dec 11, 2024
@github-actions github-actions bot added the component/zeebe Related to the Zeebe component/team label Dec 11, 2024
@koevskinikola
Copy link
Member Author

koevskinikola commented Dec 11, 2024

@remcowesterhoud here's the fix for Group and Role duplicate entity assignment checks.

@houssain-barouni I also piggybacked a refactoring to some Group-related service-layer code. It's meant to sync up the Group code with the changes introduced by this PR. At the time of the refactoring, the Group code wasn't being implemented but not merged.

@koevskinikola koevskinikola requested review from houssain-barouni and remcowesterhoud and removed request for remcowesterhoud December 11, 2024 13:02
Copy link
Contributor

@remcowesterhoud remcowesterhoud left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this @koevskinikola 🙇‍♂️ The checks look good to me

@remcowesterhoud
Copy link
Contributor

Wow I just noticed the RDBMS IT is failing here as well. I've been spending so much time trying to figure out why they're failing in my PR ... It's not my fault! 🎉

@koevskinikola
Copy link
Member Author

Wow I just noticed the RDBMS IT is failing here as well.

I think some of the failures are related to the refactoring I applied to the Grouo search classes.

@@ -25,7 +25,7 @@ public static final class Builder extends AbstractBuilder<Builder>
implements ObjectBuilder<GroupSort> {

public Builder groupKey() {
currentOrdering = new FieldSorting("key", null);
currentOrdering = new FieldSorting("groupKey", null);
Copy link
Contributor

Choose a reason for hiding this comment

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

❌ With this change the sorting has a different name as the actual property in the GroupEntity and GroupItem. This will be confusing for the end user and they should be the same.

💭 This actually applies to the GroupFilter object as well. Probably we should align all classes/dtos to "groupKey"

This renaming also is the reason for the failing RDBMS tests. We map the property names in the GroupSearchColumn enum to actual DB column names.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hey @stoerti, I was considering aligning the GroupEntity classes as well, but I noticed they are used heavily in the RDBMS code, and didn't want to cause merge conflicts for you.

If you prefer to align them further, I can apply the refactoring 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

No worries, please go ahead 👍

I rather prefer an consistent API over some temporary merge conflicts 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

@stoerti commit 65f0a43 renames the GroupEntity#key and GroupItem#key properties to groupKey.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, TY

@koevskinikola koevskinikola mentioned this pull request Dec 12, 2024
9 tasks
Rename the key property of the GroupEntity and
GroupItem classes to groupKey. This makes it
clearer to users and aligns it with other Group
and Identity-related classes.
@github-actions github-actions bot added the component/c8-api All things unified C8 API, e.g. C8 REST label Dec 12, 2024
@koevskinikola koevskinikola added this pull request to the merge queue Dec 12, 2024
Merged via the queue into main with commit ecbee5a Dec 12, 2024
61 checks passed
@koevskinikola koevskinikola deleted the nkk/25905-refactor-identity-related-code branch December 12, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/c8-api All things unified C8 API, e.g. C8 REST component/zeebe Related to the Zeebe component/team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adjust Identity related services, transformers, and processors
4 participants