IQSS / dataverse

Open source research data repository software
http://dataverse.org
Other
882 stars 494 forks source link

Deaccessioned dataset file edit fix. #10901

Closed jp-tosca closed 1 month ago

jp-tosca commented 1 month ago

What this PR does / why we need it: It was reported on #9351 that trying to update any of the files for a deaccessioned dataset would result in an error message.

My test showed that this would only happen when the only previous version available is deaccessioned, for example if you create a dataset and have version 1, then make version 2 and deaccession version 2 it will not show this error.

While reviewing this issue we found that even if the UI would fail this was possible on the API due a parameter sent that would cause to bypass a check, this caused that even the new test would pass with the old code.

You can test this by:

  1. Deploy develop branch
  2. Create a dataset with file
  3. Publish the dataset
  4. Deaccession the dataset
  5. Try to delete a file and you will see an error
  6. Get the id of the file (lmk if you need help with this step)
  7. Try to delete the file with http://localhost:8080/api/files/ and you will succeed (you shouldn't)
  8. Undeploy and make the changes to the file Files.java on your develop branch, deploy and repeat steps 1-7, you should get an error message on both.
  9. This is where the fix comes in, once that the fix from this branch from UpdateDatasetVersionCommand are deployed the functionality should be restored.

Which issue(s) this PR closes:

Closes #9351

Is there a release notes update needed for this change?: Yes

github-actions[bot] commented 1 month ago

:package: Pushed preview images as

ghcr.io/gdcc/dataverse:9351-edit-optionds-deaccessioned-dataset-fix
ghcr.io/gdcc/configbaker:9351-edit-optionds-deaccessioned-dataset-fix

:ship: See on GHCR. Use by referencing with full name as printed above, mind the registry name.

github-actions[bot] commented 1 month ago

:package: Pushed preview images as

ghcr.io/gdcc/dataverse:9351-edit-optionds-deaccessioned-dataset-fix
ghcr.io/gdcc/configbaker:9351-edit-optionds-deaccessioned-dataset-fix

:ship: See on GHCR. Use by referencing with full name as printed above, mind the registry name.

github-actions[bot] commented 1 month ago

:package: Pushed preview images as

ghcr.io/gdcc/dataverse:9351-edit-optionds-deaccessioned-dataset-fix
ghcr.io/gdcc/configbaker:9351-edit-optionds-deaccessioned-dataset-fix

:ship: See on GHCR. Use by referencing with full name as printed above, mind the registry name.

github-actions[bot] commented 1 month ago

:package: Pushed preview images as

ghcr.io/gdcc/dataverse:9351-edit-optionds-deaccessioned-dataset-fix
ghcr.io/gdcc/configbaker:9351-edit-optionds-deaccessioned-dataset-fix

:ship: See on GHCR. Use by referencing with full name as printed above, mind the registry name.

github-actions[bot] commented 1 month ago

:package: Pushed preview images as

ghcr.io/gdcc/dataverse:9351-edit-optionds-deaccessioned-dataset-fix
ghcr.io/gdcc/configbaker:9351-edit-optionds-deaccessioned-dataset-fix

:ship: See on GHCR. Use by referencing with full name as printed above, mind the registry name.

github-actions[bot] commented 1 month ago

:package: Pushed preview images as

ghcr.io/gdcc/dataverse:9351-edit-optionds-deaccessioned-dataset-fix
ghcr.io/gdcc/configbaker:9351-edit-optionds-deaccessioned-dataset-fix

:ship: See on GHCR. Use by referencing with full name as printed above, mind the registry name.

github-actions[bot] commented 1 month ago

:package: Pushed preview images as

ghcr.io/gdcc/dataverse:9351-edit-optionds-deaccessioned-dataset-fix
ghcr.io/gdcc/configbaker:9351-edit-optionds-deaccessioned-dataset-fix

:ship: See on GHCR. Use by referencing with full name as printed above, mind the registry name.

jp-tosca commented 1 month ago

Changes should be good to review @qqmyers, the copy still needs to be created on the api but not sent as a parameter, after making these changes both UI and the API should fail before the changes and the change should resolve this issue for both.

github-actions[bot] commented 1 month ago

:package: Pushed preview images as

ghcr.io/gdcc/dataverse:9351-edit-optionds-deaccessioned-dataset-fix
ghcr.io/gdcc/configbaker:9351-edit-optionds-deaccessioned-dataset-fix

:ship: See on GHCR. Use by referencing with full name as printed above, mind the registry name.

github-actions[bot] commented 1 month ago

:package: Pushed preview images as

ghcr.io/gdcc/dataverse:9351-edit-optionds-deaccessioned-dataset-fix
ghcr.io/gdcc/configbaker:9351-edit-optionds-deaccessioned-dataset-fix

:ship: See on GHCR. Use by referencing with full name as printed above, mind the registry name.

github-actions[bot] commented 1 month ago

:package: Pushed preview images as

ghcr.io/gdcc/dataverse:9351-edit-optionds-deaccessioned-dataset-fix
ghcr.io/gdcc/configbaker:9351-edit-optionds-deaccessioned-dataset-fix

:ship: See on GHCR. Use by referencing with full name as printed above, mind the registry name.

ofahimIQSS commented 1 month ago

I tested this ticket a little bit differently. I pushed the ticket to internal to test the fix. Fix looks good and no error message was displayed after deleting a file from a deaccessioned dataset. I was able to reproduce the defect in demo (without the fix) so I could see what the issue was. I attached screenshots of the testing below.
10901 Testing.docx