Skip to content

Feature/348 create checkpoint v2 - #407

Merged
salamonpavel merged 13 commits into
feature/347-v2-endpoints-in-dispatcherfrom
feature/348-create-checkpoint-v2
Jan 12, 2026
Merged

salamonpavel merged 13 commits into
feature/347-v2-endpoints-in-dispatcherfrom
feature/348-create-checkpoint-v2

Conversation

@salamonpavel

Copy link
Copy Markdown
Collaborator

Release notes:

  • saveCheckpoint operation in HttpDispatcher uses v2 endpoints

Closes #348

…8-create-checkpoint-v2

# Conflicts:
#	agent/src/main/scala/za/co/absa/atum/agent/dispatcher/HttpDispatcher.scala
val parentPartitioningIdOpt = partitioning.parentPartitioning.map(getPartitioningId)
val partitioningWithIdOpt = getPartitioning(partitioning.partitioning)


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

unnecessary empty lines

.as[SingleSuccessResponse[AdditionalDataDTO.Data]]
.data
.map(item => item._1 -> item._2.map(_.value))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

unnecessary empty lines


// Could be different from the one that was submitted. Replacing, just to have the most fresh copy possible.
this.additionalData = retrievedAD.data.map { case (k, v) => (k, v.map(_.value)) }
this.additionalData = retrievedAD.data.map { case (k, v) => (k, v.map(_.value)) }.toMap

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this shouldn't be needed

@salamonpavel salamonpavel Jan 12, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

it is needed as now the data come from multisuccessresponse as a sequence

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

sorry looked at wrong class


import java.time.ZonedDateTime

@Ignore // has to be run with a real server

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if it's so, then it is no longer a unit test. If we want to have unit tests here in this file, then we have to mock

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what changed? It used to be runnable 'locally' without the server, am I mistaken?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

it's a newly introduced test class and actually everything is mocked

val flywayUrl = s"jdbc:postgresql://$host:$port/$database"
val flywayUser = "postgres"
val flywayPassword = "postgres"
val flywayPassword = "changeme"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I see that you made this change on all places, what's the reason?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

it's just to unify it everywhere accross the project so one doesn't need to change configs when running integration tests locally etc.

.in(V2Paths.Partitionings / path[Long]("partitioningId") / V2Paths.AdditionalData)
.out(statusCode(StatusCode.Ok))
.out(jsonBody[SingleSuccessResponse[AdditionalDataDTO.Data]])
.out(jsonBody[MultiSuccessResponse[AdditionalDataItemV2DTO]])

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

On one hand, I liked the SingleSuccessResponse[AdditionalDataDTO.Data] because it 'restricts' the duplication of same AD key, by the 'contract' it's immediatelly & explicitly obvious.

On another hand, I like MultiSuccessResponse[AdditionalDataItemV2DTO]] because it is more 'explicit' and precise on what is key, author, and value - and can be extended easily. Map of X and Y cannot be as easily.

So let's carry on with the implementation. It's same as for Measures. But it's important to know that we changed the contract here.

import io.circe.{Decoder, Encoder}
import io.circe.generic.semiauto.{deriveDecoder, deriveEncoder}

case class AdditionalDataItemV2DTO(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ok, this structure makes sense to me.

But when I look at model/ now, it's very ... rich. I think that AdditionalDataDTO is only used for AD Update. What do you think about renaming it to UpdateAdditionalDataDTO ?

Please double check.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Update: I noticed 1 more place where it's used, in Reader, in getAdditionalData - but I like that your structure AdditionalDataItemV2DTO more, and luckily we are not using this in UU project.

*/
type AtumPartitions = ListMap[String, String]
type AdditionalData = Map[String, Option[String]]
type AdditionalData = Map[String, Option[String]] // why did we decide for the optionality of the value here?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

IIRC AD value can be empty in general, we didn't want to restrict our users. It can be a prepared field, to be filled in later, or a part of patterns (we so far haven't really implemented / talked to that much)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

ok let's discuss the patterns use case when we get the chance

@salamonpavel
salamonpavel merged commit 4c904da into feature/347-v2-endpoints-in-dispatcher Jan 12, 2026
2 checks passed
@salamonpavel
salamonpavel deleted the feature/348-create-checkpoint-v2 branch January 12, 2026 09:50
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.

2 participants