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

#280: agent and server compatibility for Additional Data PATCH operation #283

Merged
merged 26 commits into from
Oct 3, 2024

Conversation

lsulak
Copy link
Collaborator

@lsulak lsulak commented Oct 1, 2024

Note: Additional Data = AD

What was done:

  • a lot more than I wanted :( (but most files changed are a result of moving files from server/ to model/ - REST envelope classes)
  • AD update functionality compatible between Agent <-> Server
  • Changing HTTP Backend on Agent from HttpURLConnectionBackend -> OkHttpSyncBackend - inspired by java.net.ProtocolException: Invalid HTTP method: PATCH softwaremill/sttp#316 and Get scopes integration tests working raster-foundry/raster-foundry#5306 because HttpURLConnectionBackend didn't support PATCH HTTP Method and we need it for AD update endpoint
  • Creating a general DTO Base 64 Encode function + tests
  • Moved Envelope related code from Server to Model, because Agent also needs it
  • Added E2E test using Balta to check the results - this is a new 'type' of test and will not be executed in CI yet. But if your local PG is ready & empty and the service is running locally, it will work with the proper service configuration
  • Removed a bunch of obsolete AD DTOs
  • Server supports these 2 endpoints: patchPartitioningAdditionalDataEndpointV2 and getPartitioningEndpointV2

Note: If you want to run AgentWithServerIntegrationTests then:

  • Prepare PG locally (make sure it has newest schemas / tables, and that it's empty)
  • Prepare Service - either as Dockerized one or a typical Localhost - and adjust src/test/resources/reference.conf accordingly - this is needed: atum.dispatcher.http.url="http://localhost:8080" and atum.dispatcher.type="http"
  • I personally run PG in Docker & Service in Docker and it all works very nicely

Closes #280

Release notes:

  • Support of Additional Data addition or update functionality

@lsulak lsulak self-assigned this Oct 1, 2024
@lsulak lsulak added the work in progress Work on this item is not yet finished (mainly intended for PRs) label Oct 1, 2024
Copy link

github-actions bot commented Oct 1, 2024

JaCoCo model module code coverage report - scala 2.13.11

Overall Project 59.69% -12.4%
Files changed 46.67%

File Coverage
JsonSyntaxExtensions.scala 59.29% -14.16%

Copy link

github-actions bot commented Oct 1, 2024

JaCoCo agent module code coverage report - scala 2.13.11

Overall Project 78.49% -18.64% 🍏
Files changed 39.06%

File Coverage
AtumAgent.scala 96.99% 🍏
AtumContext.scala 92.56% -0.97% 🍏
CapturingDispatcher.scala 87.43% -68%
HttpDispatcher.scala 34.12% -51.76%

Copy link

github-actions bot commented Oct 1, 2024

JaCoCo reader module code coverage report - scala 2.13.11

Overall Project 100% 🍏

There is no coverage information present for the Files changed

Copy link

github-actions bot commented Oct 1, 2024

JaCoCo server module code coverage report - scala 2.13.11

Overall Project 68.87% -1.42% 🍏
Files changed 79.83%

File Coverage
PartitioningRepositoryImpl.scala 100% 🍏
PartitioningServiceImpl.scala 100% 🍏
FlowControllerImpl.scala 100% 🍏
CheckpointControllerImpl.scala 100% 🍏
PartitioningControllerImpl.scala 91.67% 🍏
BaseController.scala 85.29% 🍏
GetPartitioningAdditionalData.scala 56.41% -49.74%

@lsulak lsulak marked this pull request as ready for review October 2, 2024 10:13
@lsulak lsulak removed the work in progress Work on this item is not yet finished (mainly intended for PRs) label Oct 2, 2024
@lsulak
Copy link
Collaborator Author

lsulak commented Oct 2, 2024

Release Notes:

  • Support of Additional Data addition or update functionality

@lsulak lsulak changed the title #280: agent and server compatibility in AD #280: agent and server compatibility for Additional Data PATCH operation Oct 2, 2024
benedeki
benedeki previously approved these changes Oct 3, 2024
Copy link
Contributor

@benedeki benedeki left a comment

Choose a reason for hiding this comment

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

Reviewed on a pair session

…gent-to-server-in-v0-3-0

# Conflicts:
#	server/src/main/scala/za/co/absa/atum/server/api/controller/BaseController.scala
#	server/src/main/scala/za/co/absa/atum/server/api/controller/FlowController.scala
#	server/src/main/scala/za/co/absa/atum/server/api/controller/FlowControllerImpl.scala
#	server/src/main/scala/za/co/absa/atum/server/api/repository/PartitioningRepository.scala
#	server/src/test/scala/za/co/absa/atum/server/api/controller/FlowControllerUnitTests.scala
Copy link
Contributor

@benedeki benedeki left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -88,19 +88,21 @@ class GetPartitioningAdditionalDataIntegrationTests extends DBTestSuite{
)

function(fncGetPartitioningAdditionalData)
.setParam("i_partitioning", partitioning1)
.setParam("i_partitioning_id", fkPartitioning1)
Copy link
Contributor

Choose a reason for hiding this comment

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

You know, that you don't have to name the params, you can put them there positionally? Especially in one param functions, it's easier

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep, I know, but I find it nicer - more readable if it's named, especially if there are more functions; but for 1-2 params I think you are right, can be ommited

.execute { queryResult =>
val results = queryResult.next()
assert(results.getInt("status").contains(11))
assert(results.getString("status_text").contains("OK"))
assert(results.getString("ad_name").contains("ad_1"))
assert(results.getString("ad_value").contains("This is the additional data for Joseph"))
assert(results.getString("ad_author").contains("Joseph"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Really need to switch to Balta 0.3, so much tidier 😉

@lsulak lsulak merged commit ca7d8f4 into master Oct 3, 2024
9 of 10 checks passed
@lsulak lsulak deleted the feature/280-adopt-agent-to-server-in-v0-3-0 branch October 3, 2024 13:34
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 Additional Data - adopt agent & test Agent <-> Server communication
2 participants