-
Notifications
You must be signed in to change notification settings - Fork 1
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
Deployment tests data cleanup enhancements #119
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Only two little comments about null checks and possibly handling them and logging them.
ResponseEntity<Void> csrfResponse = restClient.get() | ||
.uri("/security/csrf") | ||
.exchange((request, response) -> new ResponseEntity<>(null, response.getHeaders(), HttpStatus.OK)); | ||
String xsrfToken = csrfResponse.getHeaders().get("DSPACE-XSRF-TOKEN").get(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May want to null check on this in case DSPACE-XSRF-TOKEN
is null or empty list. Possibly log if it's null. This would be helpful with debugging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
.body(bodyPair) | ||
.retrieve() | ||
.toBodilessEntity(); | ||
String authToken = authResponse.getHeaders().get("Authorization").get(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May want a null check here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
The following changes have been made to the deployment tests data cleanup feature:
pass.test.skip.deposits
that istrue
by default. If this property is true, any deposit for a submission associated with the deployment test grant will not be deposited into the downstream repository.DevNullTransport
that will be used in the skip deposits case that will do nothing with the package contents but will create theRepositoryCopy
and set the Deposit.depositStatus toACCEPTED
.pass.test.skip.deposits
isfalse
, then the deployment tests deposits will be made in the downstream repositories.DspaceDepositService
is used to delete the DSpace deposits. The deposit will be deleted from DSpace in about an hour after it was created.DspaceDepositService
code is invoked as part of theDeploymentTestDataJob
which run periodically to clean up deployment test data.