-
Notifications
You must be signed in to change notification settings - Fork 27
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
Autocreate Zenodo DOIs and create shared access links #5879
Merged
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
0f3515f
Add flag for automatic doi creation by dockstore zenodo account
kathy-t 1dca34c
Merge branch 'develop' into feature/zenodo-prototype
kathy-t f77e4a9
Use existing community object
kathy-t ce8b4ce
Use 2.0.3-zeta.0 tag for zenodo client
kathy-t be9664d
Allow automatic DOIs for services
kathy-t 1cafb53
Add hoverfly tests for automatic DOI creation - GH apps
kathy-t 24ed60e
Weird, how about this
kathy-t 421c78c
Try extending BaseIT to mimic WebhookIT which doesn't seem to use the…
kathy-t 7278ab4
Remove unused imports
kathy-t 7749335
Use hoverfly cert for integration tests
kathy-t 3261305
Revert hoverfly fix attempts
kathy-t 7202265
Create hoverfly-tests profile
kathy-t b57a4b7
Fix typos
kathy-t 11bf333
Exclude
kathy-t 22b5075
Disable migrations cache
kathy-t 78a7a52
Comment out problematic line to see what happens
kathy-t afec59e
Revert "Comment out problematic line to see what happens"
kathy-t e8e0d5a
Try switching it
kathy-t 12966fa
Move more tests to HoverflyTest
kathy-t 947b442
Remove nonconfidential label for hoverfly tests
kathy-t 443d805
Relax snapshotting, allow multiple DOIs, add more tests
kathy-t dddcd59
Merge branch 'develop' into feature/zenodo-prototype
kathy-t 299ebfd
Fix test
kathy-t d1f6a4b
Fix up access links
kathy-t 4d49c1c
Add order of precedence doi test
kathy-t b13bfc1
Fix import order
kathy-t 4925bfb
Fix tests
kathy-t 6333c92
Fix whitespace
kathy-t 299b8ff
Fix orcid export tests
kathy-t 88612e6
Move ORCID hoverfly tests from EntryResourceIT to OrcidIT
kathy-t 665e809
Fix more tests: don't allow DOI editing
kathy-t 5af2333
Remove hoverfly tag from EntryResourceIT
kathy-t fff2878
Remove unused import
kathy-t 7d1b34a
Fix checkstyle
kathy-t bf4431c
PR feedback
kathy-t 3c63413
Merge branch 'develop' into feature/zenodo-prototype
kathy-t 37fee58
Update zenodo client version
kathy-t 2a92f49
PR feedback
kathy-t 810394a
Fix tests, more cleanup
kathy-t 58bb2b5
Merge branch 'develop' into feature/zenodo-prototype
kathy-t f5f000f
Fix tests
kathy-t File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
dockstore-webservice/src/main/java/io/dockstore/webservice/jdbi/DoiDAO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright 2024 OICR and UCSC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.dockstore.webservice.jdbi; | ||
|
||
import io.dockstore.webservice.core.Doi; | ||
import io.dropwizard.hibernate.AbstractDAO; | ||
import org.hibernate.SessionFactory; | ||
|
||
public class DoiDAO extends AbstractDAO<Doi> { | ||
|
||
public DoiDAO(SessionFactory sessionFactory) { | ||
super(sessionFactory); | ||
} | ||
|
||
public Doi findById(Long id) { | ||
return get(id); | ||
} | ||
|
||
public Doi findByName(String doiName) { | ||
return uniqueResult(namedTypedQuery("io.dockstore.webservice.core.Doi.findByName").setParameter("doiName", doiName)); | ||
} | ||
|
||
public long create(Doi doi) { | ||
return persist(doi).getId(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -295,6 +295,7 @@ public Workflow refresh(@ApiParam(hidden = true) @Parameter(hidden = true, name | |
@ApiParam(value = "workflow ID", required = true) @PathParam("workflowId") Long workflowId, | ||
@ApiParam(value = "completely refresh all versions, even if they have not changed", defaultValue = "true") @QueryParam("hardRefresh") @DefaultValue("true") Boolean hardRefresh) { | ||
Workflow workflow = refreshWorkflow(user, workflowId, Optional.empty(), hardRefresh); | ||
automaticallyRegisterDockstoreDOIForRecentTags(workflow, user, this); | ||
EntryVersionHelper.removeSourceFilesFromEntry(workflow, sessionFactory); | ||
return workflow; | ||
} | ||
|
@@ -374,8 +375,6 @@ private Workflow refreshWorkflow(User user, Long workflowId, Optional<String> ve | |
// Update file formats in each version and then the entry | ||
FileFormatHelper.updateFileFormats(existingWorkflow, newWorkflow.getWorkflowVersions(), fileFormatDAO, true); | ||
|
||
automaticallyRegisterDockstoreDOIForRecentTags(existingWorkflow, user, this); | ||
|
||
// Keep this code that updates the existing workflow BEFORE refreshing its checker workflow below. Refreshing the checker workflow will eventually call | ||
// EntryVersionHelper.removeSourceFilesFromEntry() which performs a session.flush and commits to the db. It's important the parent workflow is updated completely before committing to the db.. | ||
existingWorkflow.getWorkflowVersions().forEach(Version::updateVerified); | ||
|
@@ -755,7 +754,9 @@ public Workflow publish(@ApiParam(hidden = true) @Parameter(hidden = true, name | |
checkNotArchived(workflow); | ||
|
||
Workflow publishedWorkflow = publishWorkflow(workflow, request.getPublish(), userDAO.findById(user.getId())); | ||
automaticallyRegisterDockstoreDOIForRecentTags(workflow, user, this); | ||
if (request.getPublish()) { | ||
automaticallyRegisterDockstoreDOIForRecentTags(workflow, user, this); | ||
} | ||
Hibernate.initialize(publishedWorkflow.getWorkflowVersions()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto with above comment |
||
return publishedWorkflow; | ||
} | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could add the explanation for the user message though we'll have it in the logs. UI requires a snapshot anyway, so not big deal