Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Move to dropbox api v2 #901

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

Closed
wants to merge 5 commits into from
Closed

Move to dropbox api v2 #901

wants to merge 5 commits into from

Conversation

vtm9
Copy link

@vtm9 vtm9 commented Oct 1, 2017

No description provided.

@vtm9 vtm9 changed the base branch from master to v4-stable October 1, 2017 12:39
@colinbm
Copy link

colinbm commented Oct 2, 2017

@vtm9 Thanks for doing this - I'm currently using your branch, and it's working great, except... The cycler is failing for me with error:

DropboxApi::Errors::HttpError: HTTP 400: Error in call to API function "files/delete": request body: path: '<path>/<model>/2017.09.23.03.00.03' did not match pattern '(/(.|[\r\n])*)|(ns:[0-9]+(/.*)?)|(id:.*)'

This looks like it's expecting a full path, including the /Apps/Backup.gem/ (which is where the DB app is configured to write to. But this was working as is on V1.

Not sure if this is just me, or an issue needing fixed.

@vtm9
Copy link
Author

vtm9 commented Oct 2, 2017

@colinbm, thanks. I fixed it.

@hiphapis hiphapis mentioned this pull request Oct 10, 2017
@nynhex
Copy link
Contributor

nynhex commented Oct 10, 2017

I'll review this and do some thorough testing on your branch. If it passes, and @stuartellis and @tombruijn are ok with it, I will merge into master and we can cut a new release if everyone agrees.

@stuartellis
Copy link
Contributor

In the interests of moving things forward, I have merged PR #857 to master, which adds Docker with a skeleton integration test suite (in the integration/ directory). You will see that the Rake tasks now have a "docker" namespace:

rake docker:build          # Build testing containers with Docker Compose
rake docker:clean          # Remove Docker containers for Backup
rake docker:clobber        # Remove Docker containers and images for Backup
rake docker:integration    # Run RSpec integration tests with Docker Compose
rake docker:shell          # Start a container environment with an interactive shell
rake docker:spec           # Run RSpec unit tests with Docker Compose

This PR does not change the Travis CI configuration in any way: it just hopefully enables you to run to write and/or run integration tests on a development workstation. I have looked at running Docker on Travis CI, but that is more invasive, so will do a separate PR just for that. PR #832 has ports of a lot of tests to Docker, but I will do another clean PR for those.

@mdarii
Copy link

mdarii commented Oct 16, 2017

Hi, any estimation when that branch will be merged into master?

Gemfile Outdated
@@ -25,7 +25,7 @@ group :production do
gem 'fog'
# gem 'excon' - use version specified by fog
gem 'unf' # for fog/AWS
gem 'dropbox-sdk', '1.6.5'
gem 'dropbox_api', github: 'vtm9/dropbox_api', branch: 'chunked_file_uploader'
Copy link
Member

Choose a reason for hiding this comment

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

Can you update the gemspec to use this gem as well?

Gemfile Outdated
@@ -25,7 +25,7 @@ group :production do
gem 'fog'
# gem 'excon' - use version specified by fog
gem 'unf' # for fog/AWS
gem 'dropbox-sdk', '1.6.5'
gem 'dropbox_api', github: 'vtm9/dropbox_api', branch: 'chunked_file_uploader'
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer not to ship this with a git repo as a dependency instead of a published Ruby gem.

Any way we can ship this with a published Ruby gem version?

@tombruijn
Copy link
Member

Is it fully functional now? If so, was the idea to add integration tests for Dropbox before shipping this @stuartellis ?

@vtm9
Copy link
Author

vtm9 commented Oct 16, 2017

I plan this week to finish the tests and to remove the dependence of dropbox_api from my repository

@stuartellis
Copy link
Contributor

Thank you @vtm9 !

@tombruijn - Yes, Dropbox was previously marked as a no-guarantees "extra", so if has some appropriate tests and depends on a published gem, I would be OK with shipping that. I agree that we should probably avoid shipping with git gem dependencies.

@stuartellis
Copy link
Contributor

stuartellis commented Oct 18, 2017

Just to let people know - @tombruijn added a number of improvements to the initial Docker support as PR #904, which I have now merged to the master branch. These do not change the integration tests, but it will create new Docker images and behave slightly differently.

We now have:

 rake docker:clobber        # Remove Docker containers and images for Backup
 rake docker:integration    # Run RSpec integration tests with Docker Compose
 rake docker:prepare        # Prepare the bundle on the Docker machine
 rake docker:shell          # Start a container environment with an interactive shell
 rake docker:spec           # Run RSpec unit tests with Docker Compose

First run docker:prepare, which installs the gem dependencies for Backup on the host machine.

You can then run docker:integration, docker:spec and docker:shell. Each of these tasks now automatically builds and rebuilds Docker images, and will clean up Docker containers on exit.

This means you do not need to run docker:build or docker:clean tasks. Once a Docker image has been built for testing Backup, there will be always be one backup/test-suite Docker image until you delete it (as the docker:clobber task does).

You can safely just delete the obsolete containers and images from the first version of Docker support. These used the name ruby_backup_tester.

@vtm9 vtm9 changed the base branch from v4-stable to master October 22, 2017 08:17
@vtm9
Copy link
Author

vtm9 commented Oct 22, 2017

@stuartellis, @tombruijn. I have added integration tests and updated the base branch to master. Everything works well.

@vtm9 vtm9 changed the title (WIP) Move to dropbox api v2 Move to dropbox api v2 Oct 22, 2017
storage:
dropbox:
specs_enabled: true
api_token: qlv6P0K5_KAAAAAAAAAwmTZY-GE45tpYiA3gZD1-sn4DlB1qJltrnTpUXC0qo3OG
Copy link
Member

@tombruijn tombruijn Oct 22, 2017

Choose a reason for hiding this comment

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

@vtm9 Is this your Dropbox API token? You may want to reset it in Dropbox and remove it from this PR before anyone abuses it

Copy link
Member

@tombruijn tombruijn left a comment

Choose a reason for hiding this comment

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

Please remove some files

password: <your password>
authentication: :plain
encryption: :starttls
openssl_verify_mode:
Copy link
Member

Choose a reason for hiding this comment

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

I think this whole file can be removed and put in the .gitignore file. Instead, devs should use the integration/live.yml.template file, right?

Gemfile.lock Outdated
yard

BUNDLED WITH
1.15.4
Copy link
Member

Choose a reason for hiding this comment

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

This file should not be checked in. It's ignored in the .gitignore file. Did you add it manually?

@vtm9
Copy link
Author

vtm9 commented Oct 22, 2017

@tombruijn, thanks. Forgot add .gitignore

@mdarii
Copy link

mdarii commented Oct 26, 2017

Hi, sorry for same question, but do you have any updates when we get new version of gem backup with support of Dropbox?

@stuartellis
Copy link
Contributor

stuartellis commented Oct 29, 2017

@mdarii - No, I am afraid that we cannot make commitments at the moment. I also have to point out that this feature is an "extra", and will not have a lot of support, so I do not really recommend that you use it for anything important unless you are willing to help out with fixing any issues.

@nynhex
Copy link
Contributor

nynhex commented Oct 29, 2017

@stuartellis Agreed, Dropbox is considered a "nicety" to have, however, I think we should focus any continued development on s3 and local storage since the Amazon API won't be deprecated anytime soon and has a slower cycle than Dropbox. I tried to give v2 api dropbox a whirl to cut a release but haven't had the time, unfortunately. If someone picks up v2 api and can either commit to maintaining it or will make it to where the rest of us can EASILY maintain it, then I think it's ok.

@nynhex
Copy link
Contributor

nynhex commented Oct 29, 2017

@vtm9 Why would you drop the dependency on dropbox_api? Are you planning to do this without the wrapper? Looks like in the latest commits in your branch it's still using it. I have no problems with dependencies, however due to ever-changing gems/wrapper, I feel we should version lock the dependency if you have it working.

Copy link
Contributor

@nynhex nynhex left a comment

Choose a reason for hiding this comment

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

This looks good and appears relevant. Currently testing and it seems to be cycling. Any issues you've seen so far @vtm9 ?

@vtm9
Copy link
Author

vtm9 commented Oct 30, 2017

@nynhex, this branch works well for me.
I lock dropbox_api version in gemspec:

  gem.add_dependency "dropbox_api", "0.1.10"

@tombruijn, I fixed the problem with .gitignore

There are a few problems with builds in some ruby versions and platforms:

$ rvm use 2.2.0 --install --binary --fuzzy
ruby-2.2.0 is not installed - installing.
Searching for binary rubies, this might take some time.
Requested binary installation but no rubies are available to download, consider skipping --binary flag.
Gemset '' does not exist, 'rvm ruby-2.2.0 do rvm gemset create ' first, or append '--create'.
The command "rvm use 2.2.0 --install --binary --fuzzy" failed and exited with 2 during .
Your build has been stopped.

@tombruijn tombruijn mentioned this pull request Nov 8, 2017
@nynhex
Copy link
Contributor

nynhex commented Oct 21, 2018

Closing PR as it's stale state.
@vtm9 If you look at rvm's repo or search on the web there are many references to the Gemset '' thing. This is an issue with RVM. If you can spend some time documenting issues by Ruby version/platform that would be helpful. The more verbosity the better.

If you want to take a stab at it to ensure it works on modern Ruby versions, please re-submit a PR and we can discuss merging

@nynhex nynhex closed this Oct 21, 2018
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.

6 participants