This repository has been archived by the owner on Sep 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
uploadGeneratetoken: Add support to optionally create new revision #146
Open
jcfr
wants to merge
3
commits into
midasplatform:master
Choose a base branch
from
jcfr:update-uploadGeneratetoken-with-create-additional-revision
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
uploadGeneratetoken: Add support to optionally create new revision #146
jcfr
wants to merge
3
commits into
midasplatform:master
from
jcfr:update-uploadGeneratetoken-with-create-additional-revision
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit updates the "uploadGeneratetoken" API introducing the new parameter "create_additional_revision" allowing to optionally change the default behavior and ensure a new revision is created when: - a bitstream associated with the file already exists on the server - and the checksum parameter is specified - and the item updated has at least one revision Since the http uploader doesn't specify the "checksum" parameter, the problem is only reproducible using the web API. For example, considering the following configuration: folder |--- item1 --- revision1 | |--- bitstream1 (filename1) | |--- item2 --- revision1 | |--- bitstream2 (filename2) By default, trying to associate bitstream1 with item2 will result in this configuration: folder |--- item1 --- revision1 | |--- bitstream1 (filename1) | |--- item2 --- revision1 | |--- bitstream2 (filename2) | |--- bitstream1 (filename1) By setting the option "create_additional_revision" to True, the following configuration will be obtained: folder |--- item1 --- revision1 | |--- bitstream1 (filename1) | |--- item2 -|--- revision1 | | |--- bitstream2 (filename2) | | | |--- revision2 | | |--- bitstream1 (filename1)
Cc: @jamiesnape @cpatrick |
The following snippet allow to reproduce the configuration:
Item1: Item2: |
jcfr
added a commit
to Slicer/Midas
that referenced
this pull request
Oct 27, 2015
Backported from PR midasplatform#146 This commit updates the "uploadGeneratetoken" API introducing the new parameter "create_additional_revision" allowing to optionally change the default behavior and ensure a new revision is created when: - a bitstream associated with the file already exists on the server - and the checksum parameter is specified - and the item updated has at least one revision Since the http uploader doesn't specify the "checksum" parameter, the problem is only reproducible using the web API. For example, considering the following configuration: folder |--- item1 --- revision1 | |--- bitstream1 (filename1) | |--- item2 --- revision1 | |--- bitstream2 (filename2) By default, trying to associate bitstream1 with item2 will result in this configuration: folder |--- item1 --- revision1 | |--- bitstream1 (filename1) | |--- item2 --- revision1 | |--- bitstream2 (filename2) | |--- bitstream1 (filename1) By setting the option "create_additional_revision" to True, the following configuration will be obtained: folder |--- item1 --- revision1 | |--- bitstream1 (filename1) | |--- item2 -|--- revision1 | | |--- bitstream2 (filename2) | | | |--- revision2 | | |--- bitstream1 (filename1)
jcfr
added a commit
to jcfr/pydas
that referenced
this pull request
Oct 27, 2015
…ional_revision" This commit add supporte from parameter introduced in midasplatform/Midas#146
And now by using an updated
with
If you scroll right, you can see the introduction of We obtain the expected results: Item 1: Item 2: |
This commit improves the support for "create_additional_revision" introduced in a previous commit. It will not create an additional revision if last revision has one bitstream and checkum matches
jcfr
added a commit
to Slicer/Midas
that referenced
this pull request
Oct 27, 2015
Backported from PR midasplatform#146 This commit improves the support for "create_additional_revision" introduced in a previous commit. It will not create an additional revision if last revision has one bitstream and checkum matches
I just realized the test are broken, I will fix the style. |
// do not create an additional revision if last revision has one bitstream and checkum matches | ||
if ($create_additional_revision && $revision) { | ||
$bitstreams = $revision->getBitstreams(); | ||
if (count($bitstreams) == 1 && $args['checksum'] == $bitstreams[0]->getChecksum()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
===
Thanks for your review, comments have been addressed in a follow up commit. |
jcfr
force-pushed
the
update-uploadGeneratetoken-with-create-additional-revision
branch
2 times, most recently
from
October 27, 2015 21:17
1fe3c0a
to
730712e
Compare
jcfr
force-pushed
the
update-uploadGeneratetoken-with-create-additional-revision
branch
from
October 27, 2015 21:18
730712e
to
4139b77
Compare
And now Style-CI is 😄 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit updates the "uploadGeneratetoken" API introducing the new
parameter "create_additional_revision" allowing to optionally change
the default behavior and ensure a new revision is created when:
Since the http uploader doesn't specify the "checksum" parameter, the
problem is only reproducible using the web API.
For example, considering the following configuration:
By default, trying to associate bitstream1 with item2 will result in
this configuration:
By setting the option "create_additional_revision" to True, the
following configuration will be obtained: