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

Server endpoints v2 returning the checkpoins data of a partitioning: 190 #194

Conversation

TebaleloS
Copy link
Collaborator

@TebaleloS TebaleloS commented Apr 30, 2024

  • Created a class to call the DB function to get checkpoint based on the provided partitioning.
  • Added a function to return the checkpoint from database in the repository.
  • Defined CheckpointQuery and CheckpointFromDB as input and output types for the partitioning checkpoint operation.
  • Created a function to get partitioning checkpoints from the database and convert it to checkpointDTO.
  • Added Unit and integration testing.
  • Modified some of the properties of a DB function that get partitioning checkpoints.
  • Added REST API, v2: get checkpoints based on the provided partitioning.

closes #190

Copy link

github-actions bot commented Apr 30, 2024

JaCoCo server module code coverage report - scala 2.13.11

Overall Project 72.06% -23.65% 🍏
Files changed 73.64%

File Coverage
BaseRepository.scala 100% 🍏
PartitioningRepositoryImpl.scala 100% 🍏
PartitioningControllerImpl.scala 100% 🍏
BaseController.scala 100% 🍏
PartitioningServiceImpl.scala 100% 🍏
BaseService.scala 100% 🍏
CheckpointFromDB.scala 85.83% -308.66%
PlayJsonImplicits.scala 54.84% 🍏
GetPartitioningCheckpoints.scala 54.55% -56.36%

@TebaleloS TebaleloS self-assigned this May 6, 2024
project/Dependencies.scala Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Jun 4, 2024

JaCoCo model module code coverage report - scala 2.13.11

Overall Project 60.76% -38.65% 🍏
Files changed 0%

File Coverage
CheckpointQueryDTO.scala 0% -1385.71%

Copy link

github-actions bot commented Jun 4, 2024

JaCoCo agent module code coverage report - scala 2.13.11

Overall Project 86.3% 🍏

There is no coverage information present for the Files changed

@TebaleloS TebaleloS force-pushed the feature/#190-Server-endpoints-v2-returning-the-checkpoins-data-of-a-partitioning branch from 708067c to b591397 Compare June 5, 2024 12:50
@lsulak
Copy link
Collaborator

lsulak commented Jun 7, 2024

Looks good to me, review finished, just 1 minor thing, kind of consistency reasons; no other remarks outside of that, happy to approve soon!

…ns-data-of-a-partitioning' of https://github.com/AbsaOSS/atum-service into feature/#190-Server-endpoints-v2-returning-the-checkpoins-data-of-a-partitioning
@@ -54,6 +54,15 @@ trait Endpoints extends BaseEndpoints {
.out(jsonBody[AdditionalDataSubmitDTO])
}

protected val getPartitioningCheckpointsEndpoint
Copy link
Collaborator

Choose a reason for hiding this comment

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

We will have endpoints of different versions alongside one another therefore I would suggest a suffix V2 getPartitioningCheckpointsEndpointV2.

@@ -27,18 +27,30 @@ import zio.test._

object PartitioningControllerIntegrationTests extends ZIOSpecDefault with TestData {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please rename the class. It's not an integration test and therefore should be executed as a unit test.

@@ -64,6 +76,24 @@ object PartitioningControllerIntegrationTests extends ZIOSpecDefault with TestDa
failsWithA[InternalServerErrorResponse]
)
}
),

suite("GetPartitioningMeasuresSuite")(
Copy link
Collaborator

Choose a reason for hiding this comment

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

GetPartitioningCheckpointsSuite

checkpointName = Some("checkpointName")
)
// Read[CheckpointFromDB] implicit validation
Read[CheckpointFromDB]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this needed here? Implicits are resolved on compile time. Your code wouldn't compile if the read instance couldn't be constructed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I left it there because of the conversation that you and I had that we should keep it there for future references.

@@ -56,6 +57,11 @@ class PartitioningServiceIntegrationTests extends ZIOSpecDefault with TestData {
when(partitioningRepositoryMock.getPartitioningAdditionalData(partitioningDTO2))
.thenReturn(ZIO.fail(DatabaseError("boom!")))

when(partitioningRepositoryMock.getPartitioningCheckpoints(checkpointQueryDTO1))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Rename the class as these are unit tests and therefore should be executed as such. Also change it to object and remove the runwith annotation.

Copy link
Collaborator

@salamonpavel salamonpavel left a comment

Choose a reason for hiding this comment

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

There are inconsistent namings. I would personally use getPartitioningCheckpoints everywhere (sometimes you use getPartitioningMeasures instead).

@lsulak
Copy link
Collaborator

lsulak commented Jun 12, 2024

There are inconsistent namings. I would personally use getPartitioningCheckpoints everywhere (sometimes you use getPartitioningMeasures instead).

Absolutely, I support this idea. However, I think this PR (and few others) has been here for far too long, and we know that we already have some technical debt in endpoint/operation namings, plus we need to update the agent to support some of the missing operations (especially those for v2).

I'll approve now as I think that it's complete from my PoV.

@TebaleloS TebaleloS merged commit 5ab72ea into master Jun 13, 2024
7 checks passed
@TebaleloS TebaleloS deleted the feature/#190-Server-endpoints-v2-returning-the-checkpoins-data-of-a-partitioning branch June 13, 2024 06:24
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.

Create Server endpoints (v2) returning the checkpoins data of a partitioning
3 participants