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

feat(projectsADM): add possibility to get project and members by UUID (DEV-1408) #2272

Merged
merged 37 commits into from Nov 18, 2022

Conversation

mpro7
Copy link
Collaborator

@mpro7 mpro7 commented Oct 31, 2022

Issue Number: DEV-1488

Pull Request Checklist

Basic Requirements

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix: represents bug fixes
  • Refactor: represents production code refactoring
  • Feature: represents a new feature
  • Documentation: documentation changes (no production code change)
  • Chore: maintenance tasks (no production code change)
  • Style: styles updates (no production code change)
  • Test: all about tests: adding, refactoring tests (no production code change)
  • Other... Please describe:

Does this PR introduce a breaking change?

  • Yes
  • No

Does this PR change client-test-data?

  • Yes (don't forget to update the JS-LIB team about the change)
  • No

Other information

@swarmia
Copy link

swarmia bot commented Oct 31, 2022

✅  Linked to Story DEV-1408 · DSP-API: Make possible to get project by UUID
➡️  Part of Epic DEV-1403 · Project UUIDs

@codecov
Copy link

codecov bot commented Oct 31, 2022

Codecov Report

Base: 86.85% // Head: 86.95% // Increases project coverage by +0.09% 🎉

Coverage data is based on head (68c9aba) compared to base (c5c98ce).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2272      +/-   ##
==========================================
+ Coverage   86.85%   86.95%   +0.09%     
==========================================
  Files         241      242       +1     
  Lines       27967    28102     +135     
==========================================
+ Hits        24292    24435     +143     
+ Misses       3675     3667       -8     
Impacted Files Coverage Δ
...p-shared/src/main/scala/dsp/valueobjects/Iri.scala 94.68% <100.00%> (+0.36%) ⬆️
...sp-shared/src/main/scala/dsp/valueobjects/V2.scala 90.00% <100.00%> (+5.94%) ⬆️
.../knora/webapi/routing/admin/ProjectsRouteADM.scala 93.10% <0.00%> (-4.27%) ⬇️
...sp-shared/src/main/scala/dsp/valueobjects/Id.scala 65.38% <0.00%> (-3.85%) ⬇️
...n/scala/org/knora/webapi/routing/HealthRoute.scala 69.81% <0.00%> (-1.89%) ⬇️
...la/org/knora/webapi/messages/StringFormatter.scala 89.36% <0.00%> (-0.81%) ⬇️
...r/permissionsmessages/PermissionsMessagesADM.scala 86.39% <0.00%> (-0.32%) ⬇️
...ages/util/search/gravsearch/GravsearchParser.scala 68.13% <0.00%> (-0.26%) ⬇️
...scala/org/knora/webapi/routing/Authenticator.scala 88.88% <0.00%> (-0.08%) ⬇️
... and 29 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mpro7 mpro7 changed the title change getProjectByIri methods to work with UUID too feat(projectsADM): add possibility to get project and members by UUID Nov 2, 2022
@mpro7 mpro7 marked this pull request as ready for review November 2, 2022 07:41
Copy link
Collaborator

@BalduinLandolt BalduinLandolt left a comment

Choose a reason for hiding this comment

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

Tests are missing... as discussed, this is probably not testable in unit tests. but is there a ent-to-end test that you could use?

@mpro7 mpro7 changed the title feat(projectsADM): add possibility to get project and members by UUID feat(projectsADM): add possibility to get project and members by UUID (DEV-1408) Nov 2, 2022
@mpro7
Copy link
Collaborator Author

mpro7 commented Nov 2, 2022

Tests are missing... as discussed, this is probably not testable in unit tests. but is there a ent-to-end test that you could use?

This is testable in unit tests of the project route which we don't have. We only have e2e tests of the project responder, which would look the same as get by IRI tests, simply because of making UUID the IRI to reuse existing stuff. But if these tests pass we can assume that it's good.

Copy link
Collaborator

@BalduinLandolt BalduinLandolt left a comment

Choose a reason for hiding this comment

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

Looks good. Nothing to add from my side, apart from what we already discussed yesterday

@mpro7 mpro7 requested a review from subotic November 2, 2022 14:24
Copy link

@irinaschubert irinaschubert left a comment

Choose a reason for hiding this comment

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

I don't really understand the whole point in having e.g. a Shortcode and a ShortcodeIdentifier and not merge these two types into one (reuse the existing (new) value objects and let them extend the ProjectIdentifierADM). To me this looks overengineered but I probably don't see the whole picture. Apart from that it looks good to me, I added mainly suggestions to improve the readability of the code.

dsp-shared/src/main/scala/dsp/valueobjects/V2.scala Outdated Show resolved Hide resolved
dsp-shared/src/test/scala/dsp/valueobjects/IriSpec.scala Outdated Show resolved Hide resolved
def getProjectByIri(id: String): Task[Option[ProjectADM]] =
def getProjectByIri(id: Iri.ProjectIri): Task[Option[ProjectADM]] =
(for {
bytes <- getBytesValue(id.value)

Choose a reason for hiding this comment

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

I don't understand why this has to be treated differently than shortcode and shortname and can't be treated as a String? (Same for getProjectByUuid.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. I just repeated @subotic implementation, so maybe he can highlight us why this was implemented differently? However as we agreed this is not used anywhere thus going to be removed.

Copy link
Collaborator

@BalduinLandolt BalduinLandolt left a comment

Choose a reason for hiding this comment

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

not much to add from my side

@mpro7 mpro7 merged commit 4b66682 into main Nov 18, 2022
@mpro7 mpro7 deleted the DEV-1408-dsp-api-make-possible-to-get-project-by-uuid branch November 18, 2022 06:31
@mpro7 mpro7 self-assigned this Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants