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

Pivotal ID # 188131969: Archieve submission request #868

Merged
merged 3 commits into from
Aug 20, 2024

Conversation

Juan-EBI
Copy link
Contributor

@Juan-EBI Juan-EBI requested a review from jhoanmanuelms August 19, 2024 08:53
Copy link
Contributor

@jhoanmanuelms jhoanmanuelms left a comment

Choose a reason for hiding this comment

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

LGTM. Please consider my comments before merging

) {
client
.post()
.uri("$SUBMISSION_REQUEST_URL/$accNo/$version/archieve")
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: archive (the same typo is present in the ticket name)

@@ -1,6 +1,6 @@
package ebi.ac.uk.db

const val MONGO_VERSION = "mongo:4.0.10"
const val MONGO_VERSION = "mongo:4.4.22"
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@@ -127,6 +127,11 @@ interface SubmissionRequestPersistenceService {
accNo: String,
version: Int,
): Boolean

suspend fun archieveRequest(
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: archive

val created = result.matchedCount < 1
return submissionRequestRepository.getByAccNoAndStatusIn(request.accNo, PROCESSING) to created
}

suspend fun archieveRequest(
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: archive

@@ -49,6 +49,22 @@ class SubmissionRequestMongoPersistenceService(
return request.map { it.accNo to it.version }
}

override suspend fun archieveRequest(
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: archive

) {
@AfterEach
fun afterEach() =
runBlocking {
testInstance.deleteAll()
}

@Test
fun archieveRequest() =
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: archive


val archievedFiles =
archieveRequestFiles()
.every(REPORT_RATE) { "$accNo, $version archieved file ${it.index}, path='${it.value.path}'" }
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: archive

filesRepository.save(rqtF2)
testInstance.saveRequest(request)

val result = testInstance.archieveRequest("abc-123", 2)
Copy link
Contributor

Choose a reason for hiding this comment

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

The test should also include validations for the request no longer being present in the requests collection

) {
require(
requestRepository.existsByAccNoAndVersionAndStatus(accNo, version, PROCESSED),
) { "Request $accNo, $version can not be archieved as not processed" }
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: "Request $accNo, $version can't be archived since it's not processed"

accNo: String,
version: Int,
) {
requestPersistenceService.archieveRequest(accNo, version)
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: archive

@Juan-EBI Juan-EBI merged commit c8cc4ba into master Aug 20, 2024
1 check passed
@Juan-EBI Juan-EBI deleted the feature/pivotal-188131969 branch August 22, 2024 11:33
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