Refactor/orchestrator/golden record task reserve - #1828
Conversation
…rser-operation pattern
…without main site
…ns following pool pattern
…I versions following pool pattern" This reverts commit ffb36cd.
…BusinessPartnerRequest in request and parsed models
…apper with deep internal request DTOs
…nRecordTaskCreate with unified internal request models
# Conflicts: # bpdm-pool/src/main/kotlin/org/eclipse/tractusx/bpdm/pool/service/parser/address/AddressSiteMembershipParser.kt
…inessPartnerRelationsRequest mapper
…or enum conversions
…skResolve with parser-operation architecture
…skReserve with parser-operation architecture
…eout in GoldenRecordTaskReserveOperation
nicoprow
left a comment
There was a problem hiding this comment.
Overall looks good to me. The logifentifiers methods that keep coming up in the services are good candidates for extraction though. Basically it is mapping logic for internal logging purposes. The code convention does not cover this case. I would propose creating a LogExtensions file in the Orchestrator util package (mapper package is also a valid candidate)
| private fun calculateTaskPendingTimeout(task: GoldenRecordTaskDb): Instant = | ||
| task.createdAt.instant.plus(taskConfigProperties.taskPendingTimeout) | ||
|
|
||
| private fun Collection<GoldenRecordTaskDb>.toLogIdentifiers() = |
There was a problem hiding this comment.
At this point you duplicate the log identifier mapping function. Maybe extract it to a log extensions file in the mapper or util package to just draw from the same method. The method is quite small but I saw it several times already
There was a problem hiding this comment.
Done Extracted toLogIdentifiers() to LogExtensions.kt in the util package. All operations can now reuse this shared logging extension.
…nsions util for reuse across operations
nicoprow
left a comment
There was a problem hiding this comment.
Some duplication errors otherwise looks fine
| ?.let { tasks -> logger.info { "Failed ${tasks.size} golden record tasks in step $step: ${toLogIdentifiers(tasks as Collection<GoldenRecordTaskDb>)}" } } | ||
| } | ||
|
|
||
| private fun toLogIdentifiers(tasks: Collection<GoldenRecordTaskDb>): String = |
There was a problem hiding this comment.
could be moved to LogExtensions
| } | ||
| } | ||
|
|
||
| private fun toUuidOrNull(uuidString: String): UUID? = |
There was a problem hiding this comment.
Duplicated method in several services. Can be extracted to util package
| } | ||
| } | ||
|
|
||
| private fun toUuidOrNull(uuidString: String): UUID? = |
… to util package for reuse
Description
Pre-review checks
Please ensure to do as many of the following checks as possible, before asking for committer review: