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(triplestore): ZIO-fying triplestore service (DSP-904) #2059

Merged
merged 87 commits into from Jul 1, 2022

Conversation

subotic
Copy link
Collaborator

@subotic subotic commented May 8, 2022

PR Checklist

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
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: DSP-904

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@subotic subotic marked this pull request as draft May 8, 2022 11:27
@subotic subotic self-assigned this May 8, 2022
@subotic subotic changed the title refactor(triplestore): ZIO-fying triplestore service refactor(triplestore): ZIO-fying triplestore service (DSP-904) May 8, 2022
@subotic subotic marked this pull request as ready for review June 28, 2022 22:42
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.

LGTM although I have to admint that I couldn't review this PR properly because of the amount of changed files.

@@ -334,12 +337,15 @@ object TriplestoreInternalException {
* @param message a description of the error.
* @param cause the original exception representing the cause of the error, if any.
*/
case class TriplestoreResponseException(message: String, cause: Option[Throwable] = None)
final case class TriplestoreResponseException(message: String, cause: Option[Throwable] = None)

Choose a reason for hiding this comment

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

Setting the case class to final here makes sense. Shall we do it for all Error case classes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For those that we don't want to have any subclasses, we definitely should. Btw. This error is one of those that should be moved out of the shared project and to the triplestore service, as it is specific to it.

appActor
.ask(GetAppState())
.mapTo[AppState]
.fallbackTo(FastFuture.successful(AppStates.Stopped))

Choose a reason for hiding this comment

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

What does this fallback do? Does it mean if there is no state found, the state is set to Stopped?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, something like that. Basically, this should never fail. There is a short amount of time during startup, where the appactor is not ready to answer these queries and this is where this would "fix" this case. I ran into it only in tests.

@@ -12,8 +12,7 @@ import io.swagger.annotations._
import org.knora.webapi.IRI

Choose a reason for hiding this comment

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

Do we still need this route?

Copy link
Collaborator Author

@subotic subotic Jun 29, 2022

Choose a reason for hiding this comment

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

yes, we do. It should be refactored / renamed at some point.

webapi/src/test/scala/org/knora/webapi/TestingSpec01.scala Outdated Show resolved Hide resolved
webapi/src/test/scala/org/knora/webapi/TestingSpec02.scala Outdated Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Jul 1, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 17 Code Smells

No Coverage information No Coverage information
6.9% 6.9% Duplication

@subotic subotic merged commit 9e038ec into main Jul 1, 2022
@subotic subotic deleted the wip/DEV-904-dsp-api-zio-fying-triplestore-service branch July 1, 2022 10:25
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

2 participants