8000 SEAB-6700: Generate automatic DOIs for all new tags by svonworl · Pull Request #6074 · dockstore/dockstore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged

Conversation

svonworl
Copy link
Contributor
@svonworl svonworl commented Feb 6, 2025

Description
This PR enables automatic DOI generation for all new tags on all entries except for "old-style" tools. To that end, it:

  • Allows a Workflow owner to set the Workflow's autoGenerateDois flag via the autogeneratedois endpoint, in addition to allowing curators and admins. This will allow us to implement a toggle in the UI for non-.dockstore.yml entries.
  • Adds an integration test that confirms the above endpoint access.
  • Allows the enableAutoDois field in .dockstore.yml to be set to either true or false.
  • Turns on auto DOI generation for all existing entries (except old-style tools) via a migration changeSet that sets autoGenerateDois to true.
  • Sets the autoGenerateDois property to true for new Workflows, and adjust the data default values similarly.

Review Instructions

  • For a .dockstore.yml-based Workflow, confirm that the value of enableAutoDois is true.
  • Push a tag to a published .dockstore.yml workflow. Confirm that a DOI was automatically generated.
  • Set the enableAutoDois field to false in the .dockstore.yml. Tag , push, and confirm that a DOI was not automatically generated.
  • Set the enableAutoDois field to true 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.

  • Security and Privacy assessed

e.g. Does this change...

  • Any user data we collect, or data location?
  • Access control, authentication or authorization?
  • Encryption features?

Please make sure that you've checked the following before submitting your pull request. Thanks!

  • Check that you pass the basic style checks and unit tests by running mvn clean install
  • Ensure that the PR targets the correct branch. Check the milestone or fix version of the ticket.
  • Follow the existing JPA patterns for queries, using named parameters, to avoid SQL injection
  • If you are changing dependencies, check the Snyk status check or the dashboard to ensure you are not introducing new high/critical vulnerabilities
  • Assume that inputs to the API can be malicious, and sanitize and/or check for Denial of Service type values, e.g., massive sizes
  • Do not serve user-uploaded binary images through the Dockstore API
  • Ensure that endpoints that only allow privileged access enforce that with the @RolesAllowed annotation
  • Do not create cookies, although this may change in the future
  • If this PR is for a user-facing feature, create and link a documentation ticket for this feature (usually in the same milestone as the linked issue). Style points if you create a documentation PR directly and link that instead.

Copy link
codecov bot commented Feb 6, 2025

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 74.49%. Comparing base (ad2a6a8) to head (d48d961).
Report is 1 commits behind head on hotfix/1.16.6.

Files with missing lines Patch % Lines
...vice/resources/AuthenticatedResourceInterface.java 0.00% 0 Missing and 1 partial ⚠️
...ckstore/webservice/resources/WorkflowResource.java 50.00% 0 Missing and 1 partial ⚠️
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     
Flag Coverage Δ
bitbuckettests 26.64% <20.00%> (?)
hoverflytests 27.93% <60.00%> (?)
integrationtests 56.75% <40.00%> (?)
languageparsingtests 11.04% <20.00%> (+<0.01%) ⬆️
localstacktests 21.55% <20.00%> (+<0.01%) ⬆️
toolintegrationtests 30.01% <20.00%> (-0.01%) ⬇️
unit-tests_and_non-confidential-tests 25.84% <20.00%> (-0.01%) ⬇️
workflowintegrationtests 38.04% <20.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
sonarqubecloud bot commented Feb 6, 2025

@@ -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);
Copy link
Contributor Author

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.

Copy link
Contributor

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.

@svonworl svonworl requested review from kathy-t, denis-yuen and hyunnaye and removed request for kathy-t February 6, 2025 04:27
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;
Copy link
Contributor Author
@svonworl svonworl Feb 6, 2025

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.

Copy link
Contributor
@kathy-t kathy-t left a 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)

@svonworl
Copy link
Contributor Author
svonworl commented Feb 6, 2025

(With ticket to remove admin/curator access to the endpoint in the future)

https://ucsc-cgl.atlassian.net/browse/SEAB-6949

Copy link
Member
@denis-yuen denis-yuen left a 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

@svonworl svonworl merged commit f7ccda8 into hotfix/1.16.6 Feb 11, 2025
18 of 20 checks passed
@svonworl svonworl deleted the feature/seab-6700/generate-auto-dois-for-all-new-tags branch February 11, 2025 17:02
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.

4 participants
0