Skip to content
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

4124 workflow clean rollback #4165

Closed
wants to merge 6 commits into from

Conversation

michbarsinai
Copy link
Member

@michbarsinai michbarsinai commented Sep 26, 2017

Related Issues

Pull Request Checklist

General discussion

The core issue here was the fact that when an InReview dataset is starting the pre-publication workflow, it should be locked twice: first for the in-review, then for the workflow. This way, if the workflow fails, the InReview lock stays.

To implement this, Datasets now have multiple locks. The API became simpler, though, because of the new method dataset.isLockedFor( DatasetLock.Reason ). Using this is an improvement over (dataset.getLock() != null && dataset.getLock().getReason == REASON.

It's also a nice infrastructure for having multiple locks (e.g. a few PIs have to approve publication, multiple background processes...)

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 12.467% when pulling 42368a1 on 4124-workflow-clean-rollback into c84e899 on develop.

@@ -553,28 +547,18 @@ public DatasetLock addDatasetLock(Long datasetId, DatasetLock.Reason reason, Lon
}

@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void removeDatasetLock(Long datasetId) {
public void removeDatasetLock(Long datasetId, DatasetLock.Reason aReason) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like with this implementation that multiple locks could be removed if they share the same reason. I am assuming that we are ensuring only one lock per reason is added, or that in all cases we want all locks of a reason to be removed. Even if one of these two are true, maybe this should be renamed to reflect what is happening with the filter.

@matthew-a-dunlap
Copy link
Contributor

Looks good to me aside from my one question!

@michbarsinai
Copy link
Member Author

Good catch, thanks @matthew-a-dunlap!
Method renamed to reflect that multiple locks might be removed. Also added some documentation and removed an unused and outdated method for returning lock info (checkDatasetLockInfo).

@michbarsinai
Copy link
Member Author

The build failure seems to arise from problems in the geotoolkit repo: https://travis-ci.org/IQSS/dataverse/builds/288195273#L1784

Need to try and rebuild after Monday noon.

Copy link
Contributor

@matthew-a-dunlap matthew-a-dunlap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change, looks good to me!

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 12.46% when pulling 06a003a on 4124-workflow-clean-rollback into c84e899 on develop.

@OneToOne(mappedBy = "dataset", cascade = {CascadeType.REMOVE, CascadeType.MERGE, CascadeType.PERSIST}, orphanRemoval = true)
private DatasetLock datasetLock;
@OneToMany(mappedBy = "dataset", cascade = CascadeType.ALL, orphanRemoval = true)
private Set<DatasetLock> datasetLocks;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ha! This change to support multiple locks is what @sekmiller and I believe we need for #4139 to fix a bug related to dataset leaving the in review state when the curator uploads a tabular file: #4139 (comment)

@pdurbin
Copy link
Member

pdurbin commented Oct 18, 2017

Closing in favor of pull request #4216.

@pdurbin pdurbin closed this Oct 18, 2017
@pdurbin pdurbin removed their assignment Jul 26, 2019
@poikilotherm poikilotherm deleted the 4124-workflow-clean-rollback branch July 1, 2020 16:28
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