-
Notifications
You must be signed in to change notification settings - Fork 18
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: KnoraUserGroup and KnoraUserGroupRepo (DEV-3288) #3059
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3059 +/- ##
===========================================
+ Coverage 11.74% 88.67% +76.92%
===========================================
Files 246 263 +17
Lines 22907 22430 -477
===========================================
+ Hits 2690 19889 +17199
+ Misses 20217 2541 -17676 ☔ View full report in Codecov by Sentry. |
47b5a42
to
0b8e9d4
Compare
webapi/src/test/scala/org/knora/webapi/slice/admin/domain/model/KnoraUserGroupSpec.scala
Show resolved
Hide resolved
cb61b25
to
7fc89fd
Compare
7fc89fd
to
ffce932
Compare
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.
LGTM, thanks!
webapi/src/main/scala/org/knora/webapi/slice/common/repo/rdf/RdfModel.scala
Show resolved
Hide resolved
...pi/src/test/scala/org/knora/webapi/slice/admin/repo/service/KnoraUserGroupRepoLiveSpec.scala
Outdated
Show resolved
Hide resolved
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.
There is one change that looks lika bad marge and needs to be reverted. Apart of that I have also few suggestions, and questions related to value objects, please se below comments:
.../main/scala/org/knora/webapi/messages/admin/responder/groupsmessages/GroupsPayloadsADM.scala
Outdated
Show resolved
Hide resolved
webapi/src/main/scala/org/knora/webapi/slice/admin/domain/model/KnoraUserGroup.scala
Show resolved
Hide resolved
webapi/src/main/scala/org/knora/webapi/slice/admin/domain/model/KnoraUserGroup.scala
Show resolved
Hide resolved
webapi/src/main/scala/org/knora/webapi/slice/admin/domain/model/KnoraUserGroup.scala
Show resolved
Hide resolved
webapi/src/main/scala/org/knora/webapi/slice/admin/domain/model/KnoraUserGroup.scala
Show resolved
Hide resolved
webapi/src/main/scala/org/knora/webapi/slice/admin/domain/model/KnoraUserGroup.scala
Outdated
Show resolved
Hide resolved
webapi/src/main/scala/org/knora/webapi/slice/admin/repo/service/KnoraUserGroupRepoLive.scala
Outdated
Show resolved
Hide resolved
5223382
to
ea34116
Compare
def save(userGroup: KnoraUserGroup): Task[KnoraUserGroup] = | ||
for { | ||
query <- findById(userGroup.id).map { | ||
case Some(_) => throw new TriplestoreUnsupportedFeatureException("Updating users is not supported.") |
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.
issue: The save
method suggests it could persisted a new or existing group but fails on update
I would suggest you implement this similar to the save query in the user repo. This query is able to create a new user or update an existing. There is also no need for findById
pre-query as the save query does is in one go.
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.
👍
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.
Take a look, what do you think?
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.
Morning!
This feature is somewhere between a chore and a refactor.
1.1. GroupDefinitions head
1.2. KnoraUserGroupRepoLive created with find/save method
1.3. getObjectIrisConvert used from KnoraUserRepoLive and reused
3.1. Methods in AuthorizationRestService sorted according to call order
3.2. Missing belongsToGroup handled (its absence is valid according to the ontology)
Pull Request Checklist
Task Description/Number
Issue Number: DEV-3288
PR Type
Basic requirements for bug fixes and features
Does this PR introduce a breaking change?
Does this PR change client-test-data?