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
Curation tasks using the scripts and processes functionality #2820
Curation tasks using the scripts and processes functionality #2820
Conversation
fix so that -t plugin-key instead of entire config & Added test voor noop curate output
e3d5c54
to
fec0456
Compare
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.
@jonas-atmire : Overall, this code looks good. Just a minor request inline.
However, I will note this PR looks like it has the same security issue as the "metadata-import" script has... It should not allow specifying the --email
param from the Admin UI. Instead, it should define that automatically to be the current user. See #2822
You may want to touch base with @KevinVdV on whether this issue needs to be resolved more generally. In general, no one should be allowed to bypass authorizations when running Scripts from the Admin UI. So, the --email
param should be banned from the REST API & Admin UI for all scripts. If need be, we can solve this in a follow-up PR, but I'd like a clear plan for how we plan to resolve it prior to merging this PR.
I'm also surprised to see that the REST API is unable to return the results of the Curation Task. No matter which task I run, the results are only written to the log files, which makes this endpoint less useful -- you need commandline access anyhow to see the output, so why not just run it from commandline?
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.
👍 Thanks @jonas-atmire . I've re-reviewed this and tested it with DSpace/dspace-angular#799 and everything is now working as expected.
As we previously discussed, the task output & security issues with the --eperson
flag will be handled in separate PRs. So, this looks good to me as-is. Thanks again!
Merging this with one approval, as this backend has received several reviews from me & testing via the corresponding Angular PR from several individuals. |
This re-creates curate.cfg based on the out-of-box curate.cfg for DSpace 7, adding only those configurations that are relevant for RTS in DSpace 7. Notably, the ui-related configurations have been removed due to curation tasks now executing from the scripts and processes functionality: DSpace/DSpace#2820 In addition, this corrects an error in the sample (commented) configs for bagit and checkm, where the plugin syntax was not updated to use the new way of specifying multiple values as of DSpace 6.
This re-creates curate.cfg based on the out-of-box curate.cfg for DSpace 7, adding only those configurations that are relevant for RTS in DSpace 7. Notably, the ui-related configurations have been removed due to curation tasks now executing from the scripts and processes functionality: DSpace/DSpace#2820 In addition, this corrects an error in the sample (commented) configs for bagit and checkm, where the plugin syntax was not updated to use the new way of specifying multiple values as of DSpace 6.
References
Add references/links to any related tickets or PRs.
Description
This PR adds in the functionality of the curation tasks to the recently merged scripts and processes functionality.
Documentation on the curation task can be found above.
Instructions for Reviewers
List of changes in this PR:
Starting a curation task can be done by performing a POST request on the endpoint
All parameter values should be provided in the body that has to use the multipart/form-data content type.
The simples of this is with a properties parameter, than contains JSON with the required options, ie the following properties will start the 'noop' curation task(-t) for the provided eperson(-e) and handle (-i)
When using the '-T' option, this allows the code to handle a text file containing a list of tasknames to be performed. (An example which is also used in the IT can be found here
Note:
CurationScriptIT at present does not yet contain the check to see if calling the 'noop' task actually ends up on (This IS logged in the dspace logs, but not explicitly returned as a particular status, apart from the scripts and processes returning the properties that have been sent to the endpoint, but that is not a marker to see if it has been executed or not)
We need to investigate to properly and cleanly mock the 'NoOpCurationTask' (In combination with the autowiring that is being done in the class), after which we can verify if the 'perform' method has been called correctly.
Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
pom.xml
), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.