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

Version files #793

Merged
merged 10 commits into from
Aug 28, 2020
Merged

Version files #793

merged 10 commits into from
Aug 28, 2020

Conversation

elizoller
Copy link
Member

@elizoller elizoller commented Aug 17, 2020

GitHub Issue: (Islandora/documentation#740)

What does this Pull Request do?

Connects the replacement of a Fedora flysystem file in Drupal to the versioning of an existing resource in Fedora.

What's new?

  • requires a third party module now - file_replace
  • extensions to the flysystem adapter

How should this be tested?

  • Create an islandora object with an attached media and file (being stored in fedora)
  • install the file_replace module (composer require drupal/file_replace and drush pm-enable file_replace (or use this PR: add file_replace module to provide an interface for replacing files Islandora-Devops/islandora-playbook#184)
  • pull down this PR
  • go to the file replace page for your file like /admin/content/files/replace/{{fid}}
  • replace the file
  • get your fedora url for that file - ie. http://localhost:8080/fcrepo/rest/2020-08/Barton_CHANS_2010.pdf
  • hit the fcr:versions endpoint for - you should see a new version (should have an ldp:contains at the end that ends with the date stamp for when you made the version) ie. curl -v http://localhost:8080/fcrepo/rest/2020-08/Barton_CHANS_2010.pdf/fcr:versions

Additional Notes:

I'll need to package up a PR to islandora-playbook to add this module if people are ok with it

Interested parties

@Islandora/8-x-committers

@mjordan
Copy link

mjordan commented Aug 22, 2020

Works as expected. When I go to the Fedora URL with fcr:versions appended, I see:

cloud_version

Then when I GET the URL behind that link (using wget for example) I do indeed get the previous version of my file. 👍

One thing that is somewhat confusing in the Fedora HTML UI is that if you click on the link, you get redirected to the HTML page for the binary resource, where, if you click on "Download Content", you get the latest version, not the one you expect. But, that should probably be expected since the Fedora HTML UI says under "Versioning", "Versioning of binary resources is not currently available through the HTML UI."

@elizoller if you remove the debugging code, I can merge. Nice work, binary versioning in Fedora FTW!

@mjordan
Copy link

mjordan commented Aug 22, 2020

But also, Travis says Drupal\Tests\islandora\Kernel\JwtEventSubscriberTest is failing.

src/Flysystem/Adapter/FedoraAdapter.php Outdated Show resolved Hide resolved
src/Flysystem/Adapter/FedoraAdapter.php Outdated Show resolved Hide resolved
Copy link
Member

@whikloj whikloj left a comment

Choose a reason for hiding this comment

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

To go along with the ones @mjordan found, I found 2 more. Some of them could remain at the debug level, but should have the wording cleaned up to be more useful.

src/Flysystem/Adapter/FedoraAdapter.php Outdated Show resolved Hide resolved
src/Flysystem/Adapter/FedoraAdapter.php Outdated Show resolved Hide resolved
@elizoller
Copy link
Member Author

@mjordan @whikloj i reduced the logging. i'm not sure how to tell travis to include the new dependency - or if the islandora-playbook PR needs to be merged first for that

@elizoller
Copy link
Member Author

i believe Islandora-Devops/islandora-playbook#184 would need to be merged in order for travis to be happy about the new dependency.

@mjordan
Copy link

mjordan commented Aug 25, 2020

@elizoller I'll try to get to Islandora-Devops/islandora-playbook#184 this evening, then try a build.

@elizoller
Copy link
Member Author

@mjordan travis is happy!

@elizoller
Copy link
Member Author

@mjordan @whikloj better?

@whikloj
Copy link
Member

whikloj commented Aug 28, 2020

I'm good with how the code looks, but I haven't tested this yet. So I'll see if I have the cycles available unless @mjordan does.

@mjordan
Copy link

mjordan commented Aug 28, 2020

Retesting now

@mjordan
Copy link

mjordan commented Aug 28, 2020

I'm happy with this. Watchdog now looks like:

versions_watchdog

Copy link

@mjordan mjordan left a comment

Choose a reason for hiding this comment

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

Works as expected.

src/Flysystem/Adapter/FedoraAdapter.php Outdated Show resolved Hide resolved
src/Flysystem/Adapter/FedoraAdapter.php Outdated Show resolved Hide resolved
@mjordan mjordan merged commit 173483e into Islandora:8.x-1.x Aug 28, 2020
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.

3 participants