Prevent "DRAFT" from appearing in citation file downloaded from a published dataset
What this PR does / why we need it:
When a citation is downloaded for a dataset from the cite dataset dropdown, the latest version is cited regardless of the version currently displayed or the format selected. This fix allows the citations to be downloaded with the selected version number, displayed in the URL such as "version=1.0"
Which issue(s) this PR closes:
- Closes #8952
@okaradeniz thanks for the pull request! I didn't think hard about the logic but you seem to be in the right area of the code.
I just clicked "approve and run" to see if the API tests pass. However, I don't see any new tests. Would it be possible to add tests?
I suspect that this functionality is not testable via API, however, unless you also addressed this issue:
- #3140
coverage: 20.709% (+0.1%) from 20.578% when pulling 76c67b8333c29cdca0139b11a730c9e2502e14aa on okaradeniz:8952_citation_version_fix into 1dd5fa4717cef2667fa19491d5d2ba778480a472 on IQSS:develop.
Thanks, you're right. This only addresses #8952 https://github.com/IQSS/dataverse/issues/8952, fixing just the citation download via UI, so it's not testable via API.
On Fri, Jul 14, 2023 at 3:26 PM Philip Durbin @.***> wrote:
@okaradeniz https://github.com/okaradeniz thanks for the pull request! I didn't think hard about the logic but you seem to be in the right area of the code.
I just clicked "approve and run" to see if the API tests pass. However, I don't see any new tests. Would it be possible to add tests?
I suspect that this functionality is not testable via API, however, unless you also addressed this issue:
— Reply to this email directly, view it on GitHub https://github.com/IQSS/dataverse/pull/9705#issuecomment-1635864566, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL6QB5GGOXDSR7KGAJSDOWTXQFCHHANCNFSM6AAAAAA2KEMD2M . You are receiving this because you were mentioned.Message ID: @.***>
@okaradeniz uh oh. There are merge conflicts. Would you be able to resolve them?
@pdurbin thanks! I resolved the conflict and pushed the changes to this branch. Please let me know if anything else to do about this.
Huh, https://jenkins.dataverse.org/job/IQSS-Dataverse-Develop-PR/job/PR-9705/4/consoleFull is showing this:
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Source /opt/dataverse/dataverse/target/dataverse-6.1.war not found"}
I'm not sure why. 🤔
Looks like one issue may be an old pom - bad merge: https://github.com/okaradeniz/dataverse/blob/2113412552c2cadec30a93dc7e3ef3be2382cd1d/modules/dataverse-parent/pom.xml#L134
Bah. Thanks, @qqmyers !
@okaradeniz what do you think? Do you want to make a fresh pull request?
ooh ok, I see now. I'll do the merge again
Bah. Thanks, @qqmyers !
@okaradeniz what do you think? Do you want to make a fresh pull request?
Yeah, I think that'll be easier. Thanks!
@okaradeniz - Can you merge with the latest develop branch? It looks like this PR builds a v6.1 war file instead of the now expected 6.2 war so the IT tests don't run.
As Jim mentioned, Integration Tests are failing. I will look at this in a few:
testMoveLinkedDataset – edu.harvard.iq.dataverse.api.MoveIT
6s
Error
expected: <0> but was: <1>
Stacktrace
org.opentest4j.AssertionFailedError: expected: <0> but was: <1>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:150)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:145)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:531)
at edu.harvard.iq.dataverse.api.MoveIT.testMoveLinkedDataset(MoveIT.java:311)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Thanks! I've looked at the MoveIT test but couldn't find how these changes are failing it. Please let me know if I need to make any changes.
The test works fine locally, I just sent another build. Hopefully, this one will be successful. 🤔
I was able to check that this was the case on develop and this change fixes it, thanks a lot @okaradeniz