dockstore / dockstore

Our VM/Docker sharing infrastructure and management component
https://dockstore.org/
Apache License 2.0
116 stars 27 forks source link

SEAB-6449: Improve TransactionHelper #5909

Closed svonworl closed 1 week ago

svonworl commented 2 weeks ago

Description While investigating https://ucsc-cgl.atlassian.net/browse/SEAB-6448 and https://ucsc-cgl.atlassian.net/browse/SEAB-6449, it appeared beneficial to make some tweaks to TransactionHelper.

Accordingly, this PR improves TransactionHelper to make it more flexible and easy to use, as follows:

To demonstrate the new TransactionHelper transaction() method that returns a value, I used it to simplify the portion of the push processing code where we link the "version update" transaction to the "doi generation" transaction. Whilst doing so, I noticed a small bug: if the DOI generation code threw, two LambdaEvents would be logged, one a success, and the other, a failure. This PR fixes said bug.

Review Instructions Register a workflow via the .dockstore.yml path, and make sure the workflow appears correctly in Dockstore.

Issue https://ucsc-cgl.atlassian.net/browse/SEAB-6448 https://ucsc-cgl.atlassian.net/browse/SEAB-6449

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!

sonarcloud[bot] commented 2 weeks ago

Quality Gate Failed Quality Gate failed

Failed conditions
70.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 66.66667% with 16 lines in your changes missing coverage. Please review.

Project coverage is 74.32%. Comparing base (b881d9c) to head (92f4e65). Report is 1 commits behind head on develop.

Files Patch % Lines
...ockstore/webservice/helpers/TransactionHelper.java 59.25% 9 Missing and 2 partials :warning:
...webservice/resources/AbstractWorkflowResource.java 76.19% 3 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #5909 +/- ## ============================================= - Coverage 74.36% 74.32% -0.05% + Complexity 5368 5367 -1 ============================================= Files 375 375 Lines 19418 19420 +2 Branches 2030 2031 +1 ============================================= - Hits 14441 14433 -8 - Misses 4007 4015 +8 - Partials 970 972 +2 ``` | [Flag](https://app.codecov.io/gh/dockstore/dockstore/pull/5909/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dockstore) | Coverage Δ | | |---|---|---| | [bitbuckettests](https://app.codecov.io/gh/dockstore/dockstore/pull/5909/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dockstore) | `26.93% <0.00%> (-0.01%)` | :arrow_down: | | [hoverflytests](https://app.codecov.io/gh/dockstore/dockstore/pull/5909/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dockstore) | `27.40% <47.91%> (+0.01%)` | :arrow_up: | | [integrationtests](https://app.codecov.io/gh/dockstore/dockstore/pull/5909/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dockstore) | `56.84% <66.66%> (-0.05%)` | :arrow_down: | | [languageparsingtests](https://app.codecov.io/gh/dockstore/dockstore/pull/5909/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dockstore) | `11.09% <0.00%> (-0.01%)` | :arrow_down: | | [localstacktests](https://app.codecov.io/gh/dockstore/dockstore/pull/5909/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dockstore) | `21.59% <0.00%> (-0.01%)` | :arrow_down: | | [toolintegrationtests](https://app.codecov.io/gh/dockstore/dockstore/pull/5909/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dockstore) | `30.33% <0.00%> (-0.01%)` | :arrow_down: | | [unit-tests_and_non-confidential-tests](https://app.codecov.io/gh/dockstore/dockstore/pull/5909/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dockstore) | `25.99% <0.00%> (-0.01%)` | :arrow_down: | | [workflowintegrationtests](https://app.codecov.io/gh/dockstore/dockstore/pull/5909/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dockstore) | `38.22% <47.91%> (+0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dockstore#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.