{"action":"created","comment":{"url":"https://api.github.com/repos/CartoDB/cartodb/pulls/comments/116764837","pull_request_review_id":38407188,"id":116764837,"diff_hunk":"@@ -133,9 +121,9 @@ def get_resources_list(filter=[])\n           self.filter = filter\n \n           @formats.each do |search_query|\n-            response = @client.search('/', search_query)\n-            response.each do |item|\n-              all_results.push(format_item_data(item))\n+            response = @client.search(search_query, '')","path":"services/datasources/lib/datasources/url/dropbox.rb","position":96,"original_position":96,"commit_id":"2dcfb2c354c77daca50b4292d13d204872cf3d2f","original_commit_id":"2dcfb2c354c77daca50b4292d13d204872cf3d2f","user":{"login":"javitonino","id":7569673,"avatar_url":"https://avatars0.githubusercontent.com/u/7569673?v=3","gravatar_id":"","url":"https://api.github.com/users/javitonino","html_url":"https://github.com/javitonino","followers_url":"https://api.github.com/users/javitonino/followers","following_url":"https://api.github.com/users/javitonino/following{/other_user}","gists_url":"https://api.github.com/users/javitonino/gists{/gist_id}","starred_url":"https://api.github.com/users/javitonino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javitonino/subscriptions","organizations_url":"https://api.github.com/users/javitonino/orgs","repos_url":"https://api.github.com/users/javitonino/repos","events_url":"https://api.github.com/users/javitonino/events{/privacy}","received_events_url":"https://api.github.com/users/javitonino/received_events","type":"User","site_admin":false},"body":"Curious about the change of `''` to `'/'`. I guess it's an API difference and nothing else, can you confirm?","created_at":"2017-05-16T14:49:45Z","updated_at":"2017-05-16T14:55:49Z","html_url":"https://github.com/CartoDB/cartodb/pull/12099#discussion_r116764837","pull_request_url":"https://api.github.com/repos/CartoDB/cartodb/pulls/12099","_links":{"self":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/comments/116764837"},"html":{"href":"https://github.com/CartoDB/cartodb/pull/12099#discussion_r116764837"},"pull_request":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/12099"}}},"pull_request":{"url":"https://api.github.com/repos/CartoDB/cartodb/pulls/12099","id":119623241,"html_url":"https://github.com/CartoDB/cartodb/pull/12099","diff_url":"https://github.com/CartoDB/cartodb/pull/12099.diff","patch_url":"https://github.com/CartoDB/cartodb/pull/12099.patch","issue_url":"https://api.github.com/repos/CartoDB/cartodb/issues/12099","number":12099,"state":"open","locked":false,"title":"Migrate to dropbox api v2 [WIP]","user":{"login":"juanignaciosl","id":932968,"avatar_url":"https://avatars1.githubusercontent.com/u/932968?v=3","gravatar_id":"","url":"https://api.github.com/users/juanignaciosl","html_url":"https://github.com/juanignaciosl","followers_url":"https://api.github.com/users/juanignaciosl/followers","following_url":"https://api.github.com/users/juanignaciosl/following{/other_user}","gists_url":"https://api.github.com/users/juanignaciosl/gists{/gist_id}","starred_url":"https://api.github.com/users/juanignaciosl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juanignaciosl/subscriptions","organizations_url":"https://api.github.com/users/juanignaciosl/orgs","repos_url":"https://api.github.com/users/juanignaciosl/repos","events_url":"https://api.github.com/users/juanignaciosl/events{/privacy}","received_events_url":"https://api.github.com/users/juanignaciosl/received_events","type":"User","site_admin":false},"body":"This closes #8303.\r\n\r\nDisclaimers:\r\n- In this PR, when we mention that \"there's an error with the sync\", \"the sync is broken\" and so on we mean that \"the table is no longer synchronized with the file\".\r\n- There is no scenario where any table should be deleted or any map should be broken because of this.\r\n\r\nFor acceptance, this PR shouldn't only _work_ but also be backwards compatible, so I'll write down the full path for the migration.\r\n\r\nDuring the process we'll create 3 syncs:\r\n\r\n- S1 will be used to check that it will be broken and then recovered.\r\n- S2 will be used to check that, without breaking in the middle, we can sync across the migration.\r\n- S3 will be used to check internals.\r\n\r\n**Acceptance**\r\n\r\n1. Deploy `master`, and check Dropbox configuration. It should point to a Dropbox app with \"Documents\" permission (the old one).\r\n2. Connect to Dropbox. You should get [a warning message about old version being retired](https://github.com/CartoDB/cartodb-management/issues/4936#issuecomment-301021131).\r\n3. Disconnect from Dropbox.\r\n4. Connect to Dropbox. Steps 3 and 4 are just a validation that you're not having issues disconnecting.\r\n5. Import a file without sync (let's call it \"F\" file). Create a map (\"FM\") on it.\r\n6. Import a file with sync (\"S1\") and create a map (\"S1M\") on it.\r\n7. Change the S1 sync file and force sync (you can manipulate `synchronizations.ran_at` at to avoid waiting). Everything's ok.\r\n8. Import another file with sync (\"S2\"), with a day interval (we don't want this to be triggered automatically yet). Create a map (\"S2M\") with it.\r\n9. Import another file with sync (\"S3\"), with a day interval (we don't want this to be triggered automatically yet). Create a map (\"S3M\") with it.\r\n\r\nUntil now, you've validated that current integration works for you, and you've set up a scenario to validate that migration will work.\r\n\r\nThen...\r\n- wipe permissions. `SynchronizationOauth.where(service: 'dropbox').each(&:destroy)` **TODO: script**\r\n\r\n10. Trigger S3 sync at Rails console (`CartoDB::Synchronization::Member.new(id: '8e5cebae-36f1-11e7-b3d5-784f436d1355').fetch.run`). It will fail (`CartoDB::Datasources::DropboxPermissionError: No Dropbox client @ dropbox`). Check the error at Rollbar and write it down. That's an expected error during the migration, between the steps of permission wiping and configuration changing.\r\n\r\n- change the Dropbox configuration to use a new one that has \"Full\" permission (because \"Documents\" one is no longer supported).\r\n- deploy this branch\r\n\r\n11. Change the S1 sync file and force sync. It should fail, because credentials are not ok. Table and S1M should still be there.\r\n\r\n**TODO: what happens if I try importing Dropbox at this point?**\r\n\r\n12. Go to your account. You should appear as disconnected from Dropbox.\r\n13. Trigger S3 sync. It will fail. That's an expected error (you have revoked your Dropbox credentials).\r\n14. Go to your account. Connect Dropbox again.\r\n15. Go to S1 dataset. It should display an error. Force the sync. It should work and the error should be gone. S1M should be updated.\r\n16. Change S2 file again and force the sync. It should work. S2M should be updated.\r\n17. Import a file without sync.\r\n18. Disconnect Dropbox.\r\n\r\nAt this point, you've validated that the migration itself works ok. Now, the last step is checking that it works for new users:\r\n\r\n16. Import a Dropbox file without sync. You should be prompted for permission.\r\n17. Import with sync.\r\n18. Change the sync file and force sync.\r\n19. Disconnect from Dropbox.\r\n\r\n\r\n\r\n\r\nDowntime check:\r\n\r\n1. deploy master again, but keep the new configuration.\r\n2. Try connecting again and importing a file.\r\n\r\nIf that works, it means that we can use the new configuration with the old code (v1 endpoints), so we won't have downtime.\r\n\r\n\r\n\r\nAdditional acceptance:\r\n- This changes a small detail on sync flow (it resets error message and code when a sync is enqueued), so sync state transitions (ok -> ok, ok -> fail, fail -> ok, fail -> fail) should be tested as well.","created_at":"2017-05-09T09:55:39Z","updated_at":"2017-05-16T14:55:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8d44a6a6a5b887032d4f8a29cf15ee16b7860f8e","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/CartoDB/cartodb/pulls/12099/commits","review_comments_url":"https://api.github.com/repos/CartoDB/cartodb/pulls/12099/comments","review_comment_url":"https://api.github.com/repos/CartoDB/cartodb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CartoDB/cartodb/issues/12099/comments","statuses_url":"https://api.github.com/repos/CartoDB/cartodb/statuses/2dcfb2c354c77daca50b4292d13d204872cf3d2f","head":{"label":"CartoDB:8303-Migrate_to_dropbox_api_v2","ref":"8303-Migrate_to_dropbox_api_v2","sha":"2dcfb2c354c77daca50b4292d13d204872cf3d2f","user":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars3.githubusercontent.com/u/1799254?v=3","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"repo":{"id":4909355,"name":"cartodb","full_name":"CartoDB/cartodb","owner":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars3.githubusercontent.com/u/1799254?v=3","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CartoDB/cartodb","description":"Location Intelligence & Data Visualization tool","fork":false,"url":"https://api.github.com/repos/CartoDB/cartodb","forks_url":"https://api.github.com/repos/CartoDB/cartodb/forks","keys_url":"https://api.github.com/repos/CartoDB/cartodb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CartoDB/cartodb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CartoDB/cartodb/teams","hooks_url":"https://api.github.com/repos/CartoDB/cartodb/hooks","issue_events_url":"https://api.github.com/repos/CartoDB/cartodb/issues/events{/number}","events_url":"https://api.github.com/repos/CartoDB/cartodb/events","assignees_url":"https://api.github.com/repos/CartoDB/cartodb/assignees{/user}","branches_url":"https://api.github.com/repos/CartoDB/cartodb/branches{/branch}","tags_url":"https://api.github.com/repos/CartoDB/cartodb/tags","blobs_url":"https://api.github.com/repos/CartoDB/cartodb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CartoDB/cartodb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CartoDB/cartodb/git/refs{/sha}","trees_url":"https://api.github.com/repos/CartoDB/cartodb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CartoDB/cartodb/statuses/{sha}","languages_url":"https://api.github.com/repos/CartoDB/cartodb/languages","stargazers_url":"https://api.github.com/repos/CartoDB/cartodb/stargazers","contributors_url":"https://api.github.com/repos/CartoDB/cartodb/contributors","subscribers_url":"https://api.github.com/repos/CartoDB/cartodb/subscribers","subscription_url":"https://api.github.com/repos/CartoDB/cartodb/subscription","commits_url":"https://api.github.com/repos/CartoDB/cartodb/commits{/sha}","git_commits_url":"https://api.github.com/repos/CartoDB/cartodb/git/commits{/sha}","comments_url":"https://api.github.com/repos/CartoDB/cartodb/comments{/number}","issue_comment_url":"https://api.github.com/repos/CartoDB/cartodb/issues/comments{/number}","contents_url":"https://api.github.com/repos/CartoDB/cartodb/contents/{+path}","compare_url":"https://api.github.com/repos/CartoDB/cartodb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CartoDB/cartodb/merges","archive_url":"https://api.github.com/repos/CartoDB/cartodb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CartoDB/cartodb/downloads","issues_url":"https://api.github.com/repos/CartoDB/cartodb/issues{/number}","pulls_url":"https://api.github.com/repos/CartoDB/cartodb/pulls{/number}","milestones_url":"https://api.github.com/repos/CartoDB/cartodb/milestones{/number}","notifications_url":"https://api.github.com/repos/CartoDB/cartodb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CartoDB/cartodb/labels{/name}","releases_url":"https://api.github.com/repos/CartoDB/cartodb/releases{/id}","deployments_url":"https://api.github.com/repos/CartoDB/cartodb/deployments","created_at":"2012-07-05T15:23:45Z","updated_at":"2017-05-15T22:29:51Z","pushed_at":"2017-05-16T14:00:52Z","git_url":"git://github.com/CartoDB/cartodb.git","ssh_url":"git@github.com:CartoDB/cartodb.git","clone_url":"https://github.com/CartoDB/cartodb.git","svn_url":"https://github.com/CartoDB/cartodb","homepage":"http://carto.com","size":351230,"stargazers_count":1468,"watchers_count":1468,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":415,"mirror_url":null,"open_issues_count":740,"forks":415,"open_issues":740,"watchers":1468,"default_branch":"master"}},"base":{"label":"CartoDB:master","ref":"master","sha":"3c901a319a1bebc22a88d4818e602fddadf0b33c","user":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars3.githubusercontent.com/u/1799254?v=3","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"repo":{"id":4909355,"name":"cartodb","full_name":"CartoDB/cartodb","owner":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars3.githubusercontent.com/u/1799254?v=3","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CartoDB/cartodb","description":"Location Intelligence & Data Visualization tool","fork":false,"url":"https://api.github.com/repos/CartoDB/cartodb","forks_url":"https://api.github.com/repos/CartoDB/cartodb/forks","keys_url":"https://api.github.com/repos/CartoDB/cartodb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CartoDB/cartodb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CartoDB/cartodb/teams","hooks_url":"https://api.github.com/repos/CartoDB/cartodb/hooks","issue_events_url":"https://api.github.com/repos/CartoDB/cartodb/issues/events{/number}","events_url":"https://api.github.com/repos/CartoDB/cartodb/events","assignees_url":"https://api.github.com/repos/CartoDB/cartodb/assignees{/user}","branches_url":"https://api.github.com/repos/CartoDB/cartodb/branches{/branch}","tags_url":"https://api.github.com/repos/CartoDB/cartodb/tags","blobs_url":"https://api.github.com/repos/CartoDB/cartodb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CartoDB/cartodb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CartoDB/cartodb/git/refs{/sha}","trees_url":"https://api.github.com/repos/CartoDB/cartodb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CartoDB/cartodb/statuses/{sha}","languages_url":"https://api.github.com/repos/CartoDB/cartodb/languages","stargazers_url":"https://api.github.com/repos/CartoDB/cartodb/stargazers","contributors_url":"https://api.github.com/repos/CartoDB/cartodb/contributors","subscribers_url":"https://api.github.com/repos/CartoDB/cartodb/subscribers","subscription_url":"https://api.github.com/repos/CartoDB/cartodb/subscription","commits_url":"https://api.github.com/repos/CartoDB/cartodb/commits{/sha}","git_commits_url":"https://api.github.com/repos/CartoDB/cartodb/git/commits{/sha}","comments_url":"https://api.github.com/repos/CartoDB/cartodb/comments{/number}","issue_comment_url":"https://api.github.com/repos/CartoDB/cartodb/issues/comments{/number}","contents_url":"https://api.github.com/repos/CartoDB/cartodb/contents/{+path}","compare_url":"https://api.github.com/repos/CartoDB/cartodb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CartoDB/cartodb/merges","archive_url":"https://api.github.com/repos/CartoDB/cartodb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CartoDB/cartodb/downloads","issues_url":"https://api.github.com/repos/CartoDB/cartodb/issues{/number}","pulls_url":"https://api.github.com/repos/CartoDB/cartodb/pulls{/number}","milestones_url":"https://api.github.com/repos/CartoDB/cartodb/milestones{/number}","notifications_url":"https://api.github.com/repos/CartoDB/cartodb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CartoDB/cartodb/labels{/name}","releases_url":"https://api.github.com/repos/CartoDB/cartodb/releases{/id}","deployments_url":"https://api.github.com/repos/CartoDB/cartodb/deployments","created_at":"2012-07-05T15:23:45Z","updated_at":"2017-05-15T22:29:51Z","pushed_at":"2017-05-16T14:00:52Z","git_url":"git://github.com/CartoDB/cartodb.git","ssh_url":"git@github.com:CartoDB/cartodb.git","clone_url":"https://github.com/CartoDB/cartodb.git","svn_url":"https://github.com/CartoDB/cartodb","homepage":"http://carto.com","size":351230,"stargazers_count":1468,"watchers_count":1468,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":415,"mirror_url":null,"open_issues_count":740,"forks":415,"open_issues":740,"watchers":1468,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/12099"},"html":{"href":"https://github.com/CartoDB/cartodb/pull/12099"},"issue":{"href":"https://api.github.com/repos/CartoDB/cartodb/issues/12099"},"comments":{"href":"https://api.github.com/repos/CartoDB/cartodb/issues/12099/comments"},"review_comments":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/12099/comments"},"review_comment":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/12099/commits"},"statuses":{"href":"https://api.github.com/repos/CartoDB/cartodb/statuses/2dcfb2c354c77daca50b4292d13d204872cf3d2f"}}}}
{"actor":{"display_login":"javitonino"}}