-
Notifications
You must be signed in to change notification settings - Fork 29
SEAB-6700: Generate automatic DOIs for all new tags #6074
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
SEAB-6700: Generate automatic DOIs for all new tags #6074
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## hotfix/1.16.6 #6074 +/- ##
====================================================
+ Coverage 45.16% 74.49% +29.32%
- Complexity 3414 5510 +2096
====================================================
Files 381 381
Lines 19800 19804 +4
Branches 2044 2046 +2
====================================================
+ Hits 8943 14753 +5810
+ Misses 10017 4069 -5948
- Partials 840 982 +142
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
@@ -2358,6 +2358,8 @@ public boolean updateAutoDoiGeneration(@Parameter(hidden = true) @Auth User user | |||
@RequestBody(description = "The request to update DOI generation", required = true, content = @Content(schema = @Schema(implementation = AutoDoiRequest.class))) AutoDoiRequest autoDoiRequest) { | |||
final Workflow workflow = workflowDAO.findById(workflowId); | |||
checkNotNullEntry(workflow); | |||
boolean canChange = canWrite(user, workflow) || isAdmin(user) || isCurator(user); |
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.
Here, we provide access to workflow owners, and maintain admin/curator access, in case we need to patch up a problem by hand.
Per our preferred practices, we are supposed to use the @RolesAllowed
annotation to implement admin/curator access. However, what we're trying to do here is allow access a combination of owner users and admins/curators, which our current annotation setup doesn't support. Thus, the code here, instead.
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.
I lean towards just removing the admin/curator access since we will have a UI toggle for users to control. Another reason is that this endpoint won't be logged as a privileged endpoint and we may eventually forget about its admin/curator access in the future.
UPDATE apptool SET autogeneratedois = TRUE WHERE NOT archived; | ||
UPDATE notebook SET autogeneratedois = TRUE WHERE NOT archived; | ||
UPDATE service SET autogeneratedois = TRUE WHERE NOT archived; | ||
UPDATE workflow SET autogeneratedois = TRUE WHERE NOT archived; |
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.
Because we don't have any easy way to determine the provenance of if any existing false
values (they could be the initial column value, or they could have been set to false in .dockstore.yml
), this code potentially reverts any previous opt-outs. But, an inspection of a recent database dump indicates that the only opt-outs so far are due to our own testing, so we're ok here, I think.
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.
(With ticket to remove admin/curator access to the endpoint in the future)
|
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.
Approved description in principle, unable to review code in detail
Description
This PR enables automatic DOI generation for all new tags on all entries except for "old-style" tools. To that end, it:
autoGenerateDois
flag via theautogeneratedois
endpoint, in addition to allowing curators and admins. This will allow us to implement a toggle in the UI for non-.dockstore.yml
entries.enableAutoDois
field in.dockstore.yml
to be set to eithertrue
orfalse
.changeSet
that setsautoGenerateDois
to true.autoGenerateDois
property totrue
for new Workflows, and adjust the data default values similarly.Review Instructions
.dockstore.yml
-based Workflow, confirm that the value ofenableAutoDois
istrue
..dockstore.yml
workflow. Confirm that a DOI was automatically generated.enableAutoDois
field tofalse
in the.dockstore.yml
. Tag , push, and confirm that a DOI was not automatically generated.enableAutoDois
field totrue
in the.dockstore.yml
. Tag, push, and confirm that a DOI was automatically generated.Perform a similar test on a manually-registered workflow, in which you change the value of
autoGenerateDois
using the endpoint, instead of.dockstore.yml
.Issue
https://ucsc-cgl.atlassian.net/browse/SEAB-6700
Security and Privacy
If there are any concerns that require extra attention from the security team, highlight them here and check the box when complete.
e.g. Does this change...
Please make sure that you've checked the following before submitting your pull request. Thanks!
mvn clean install
@RolesAllowed
annotation