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

Versioning #75

Merged
merged 18 commits into from
Jun 20, 2019
Merged

Versioning #75

merged 18 commits into from
Jun 20, 2019

Conversation

elizoller
Copy link
Member

GitHub Issue: (Islandora/documentation#740)

What does this Pull Request do?

Bring chullo up to meet the versioning API spec

What's new?

  • add interface for new createVersion and getVersions methods
  • add method for createVersion - sends a POST request to the timemapURI to create a version in Fedora. optionally sets a specific Memento-Datetime, optionally accepts the content body.
  • add method for getVersions - uses timemapURI from header and makes a get request
  • add a helper function to extract the timemapURI from the headers of a Fedora resource URI

How should this be tested?

In theory, write a PHP script which calls these methods. In reality, might be easier to use Milliner in an existing Islandora site, something like - Islandora/Crayfish@dev...asulibraries:versioning which will hopefully be the start of a corresponding PR.

Additional Notes:

Fedora Versioning API Spec - https://wiki.duraspace.org/display/FEDORA5x/RESTful+HTTP+API+-+Versioning#RESTfulHTTPAPI-Versioning-BluePOSTCreateanewversionedresource(anewLDPRm)

Interested parties

@Islandora-CLAW/committers

@elizoller
Copy link
Member Author

note: i will work on tests for this also.

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.

@elizoller this is good work, I have some suggestions but as I haven't tested this if you have reasons for the path you took please let me know.

src/FedoraApi.php Outdated Show resolved Hide resolved
src/FedoraApi.php Show resolved Hide resolved
src/FedoraApi.php Outdated Show resolved Hide resolved
src/FedoraApi.php Show resolved Hide resolved
src/FedoraApi.php Show resolved Hide resolved
src/FedoraApi.php Show resolved Hide resolved
src/IFedoraApi.php Outdated Show resolved Hide resolved
src/FedoraApi.php Outdated Show resolved Hide resolved
@elizoller
Copy link
Member Author

I think I got those suggestions above resolved. And added some tests. How does it look?

@whikloj
Copy link
Member

whikloj commented Jun 20, 2019

@elizoller can you make a change to the .travis.yml and add

branches:
  only:
    - /master/
+   - /^dev/

Travis isn't running because now we are using dev as our "development" branch, is this correct @dannylamb or should we be merging to master?

@elizoller
Copy link
Member Author

Going to look more at the test for createVersion based on https://codecov.io/gh/Islandora-CLAW/chullo/src/48baf212cca7540247eb152725d5525c6906b543/src/FedoraApi.php 😞

@codecov
Copy link

codecov bot commented Jun 20, 2019

Codecov Report

Merging #75 into dev will increase coverage by 2.98%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##                dev    #75      +/-   ##
==========================================
+ Coverage     97.01%   100%   +2.98%     
- Complexity       12     20       +8     
==========================================
  Files             1      1              
  Lines            67     98      +31     
==========================================
+ Hits             65     98      +33     
+ Misses            2      0       -2
Impacted Files Coverage Δ Complexity Δ
src/FedoraApi.php 100% <100%> (+2.98%) 20 <8> (+8) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc60e9c...cf3dfff. Read the comment docs.

@dannylamb
Copy link
Contributor

@whikloj merge to dev, please. that's why I set it up as the default branch, just to nudge us in that direction.

@dannylamb
Copy link
Contributor

nice wall of green there @elizoller 🎉

@whikloj whikloj merged commit f2fb0f5 into Islandora:dev Jun 20, 2019
@whikloj
Copy link
Member

whikloj commented Jun 20, 2019

Nicely done @elizoller

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