{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/pulls/comments/44647590","id":44647590,"diff_hunk":"@@ -0,0 +1,120 @@\n+\"\"\"\n+\n+Usage:\n+    scripts/make-g-cloud-7-live.py <data_api_url> <data_api_token> <draft_bucket> <documents_bucket> [--dry-run]\n+\"\"\"\n+import sys\n+sys.path.insert(0, '.')\n+\n+from itertools import islice\n+import random\n+import re\n+\n+from docopt import docopt\n+from dmutils.apiclient import DataAPIClient\n+from dmutils.s3 import S3\n+\n+DOCUMENT_KEYS = [\n+    'pricingDocumentURL', 'serviceDefinitionDocumentURL',\n+    'sfiaRateDocumentURL', 'termsAndConditionsDocumentURL',\n+]\n+FRAMEWORK_SLUG = 'g-cloud-7'\n+\n+\n+def assert_equal(one, two):\n+    if one != two:\n+        raise AssertionError(\"{} != {}\".format(one, two))\n+\n+\n+def find_suppliers_on_framework(client, framework_slug):\n+    return (\n+        supplier for supplier in client.find_framework_suppliers(FRAMEWORK_SLUG)['supplierFrameworks']\n+        if supplier['onFramework']\n+    )\n+\n+\n+def find_submitted_draft_services(client, supplier, framework_slug):\n+    return (\n+        draft_service for draft_service in\n+        client.find_draft_services(supplier['supplierId'], framework=framework_slug)['services']\n+        if draft_service['status'] == 'submitted' and not supplier.get('serviceId')","path":"scripts/make-g-cloud-7-live.py","position":40,"original_position":40,"commit_id":"115f2ad5baa7c41cc025a9b4e4383003c54a653a","original_commit_id":"115f2ad5baa7c41cc025a9b4e4383003c54a653a","user":{"login":"TheDoubleK","id":6525554,"avatar_url":"https://avatars.githubusercontent.com/u/6525554?v=3","gravatar_id":"","url":"https://api.github.com/users/TheDoubleK","html_url":"https://github.com/TheDoubleK","followers_url":"https://api.github.com/users/TheDoubleK/followers","following_url":"https://api.github.com/users/TheDoubleK/following{/other_user}","gists_url":"https://api.github.com/users/TheDoubleK/gists{/gist_id}","starred_url":"https://api.github.com/users/TheDoubleK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheDoubleK/subscriptions","organizations_url":"https://api.github.com/users/TheDoubleK/orgs","repos_url":"https://api.github.com/users/TheDoubleK/repos","events_url":"https://api.github.com/users/TheDoubleK/events{/privacy}","received_events_url":"https://api.github.com/users/TheDoubleK/received_events","type":"User","site_admin":false},"body":"Should this be `and not service.get('serviceId')` as suppliers don't have service IDs?","created_at":"2015-11-12T11:39:28Z","updated_at":"2015-11-12T11:39:28Z","html_url":"https://github.com/alphagov/digitalmarketplace-scripts/pull/12#discussion_r44647590","pull_request_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/pulls/comments/44647590"},"html":{"href":"https://github.com/alphagov/digitalmarketplace-scripts/pull/12#discussion_r44647590"},"pull_request":{"href":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/pulls/12","id":50493081,"html_url":"https://github.com/alphagov/digitalmarketplace-scripts/pull/12","diff_url":"https://github.com/alphagov/digitalmarketplace-scripts/pull/12.diff","patch_url":"https://github.com/alphagov/digitalmarketplace-scripts/pull/12.patch","issue_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/issues/12","number":12,"state":"open","locked":false,"title":"WIP: Make g cloud 7 live","user":{"login":"robyoung","id":14287,"avatar_url":"https://avatars.githubusercontent.com/u/14287?v=3","gravatar_id":"","url":"https://api.github.com/users/robyoung","html_url":"https://github.com/robyoung","followers_url":"https://api.github.com/users/robyoung/followers","following_url":"https://api.github.com/users/robyoung/following{/other_user}","gists_url":"https://api.github.com/users/robyoung/gists{/gist_id}","starred_url":"https://api.github.com/users/robyoung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robyoung/subscriptions","organizations_url":"https://api.github.com/users/robyoung/orgs","repos_url":"https://api.github.com/users/robyoung/repos","events_url":"https://api.github.com/users/robyoung/events{/privacy}","received_events_url":"https://api.github.com/users/robyoung/received_events","type":"User","site_admin":false},"body":"This is the script for launching G-Cloud 7. Opening for early review.","created_at":"2015-11-12T10:16:51Z","updated_at":"2015-11-12T11:39:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a4906d1106504c44bcfdb1b108ad19ee50f26adc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/pulls/12/commits","review_comments_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/pulls/12/comments","review_comment_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/issues/12/comments","statuses_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/statuses/115f2ad5baa7c41cc025a9b4e4383003c54a653a","head":{"label":"alphagov:make-g-cloud-7-live","ref":"make-g-cloud-7-live","sha":"115f2ad5baa7c41cc025a9b4e4383003c54a653a","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":43547966,"name":"digitalmarketplace-scripts","full_name":"alphagov/digitalmarketplace-scripts","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/digitalmarketplace-scripts","description":"Various scripts that run against the Digital Marketplace APIs","fork":false,"url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts","forks_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/forks","keys_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/teams","hooks_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/hooks","issue_events_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/events","assignees_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/tags","blobs_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/languages","stargazers_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/stargazers","contributors_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/contributors","subscribers_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/subscribers","subscription_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/subscription","commits_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/merges","archive_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/downloads","issues_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/releases{/id}","created_at":"2015-10-02T10:51:07Z","updated_at":"2015-10-02T13:12:45Z","pushed_at":"2015-11-12T10:16:52Z","git_url":"git://github.com/alphagov/digitalmarketplace-scripts.git","ssh_url":"git@github.com:alphagov/digitalmarketplace-scripts.git","clone_url":"https://github.com/alphagov/digitalmarketplace-scripts.git","svn_url":"https://github.com/alphagov/digitalmarketplace-scripts","homepage":null,"size":304,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"dac669035f75ac799ab7ab4f5138cf4e6e02a3dd","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":43547966,"name":"digitalmarketplace-scripts","full_name":"alphagov/digitalmarketplace-scripts","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/digitalmarketplace-scripts","description":"Various scripts that run against the Digital Marketplace APIs","fork":false,"url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts","forks_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/forks","keys_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/teams","hooks_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/hooks","issue_events_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/events","assignees_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/tags","blobs_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/languages","stargazers_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/stargazers","contributors_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/contributors","subscribers_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/subscribers","subscription_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/subscription","commits_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/merges","archive_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/downloads","issues_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/releases{/id}","created_at":"2015-10-02T10:51:07Z","updated_at":"2015-10-02T13:12:45Z","pushed_at":"2015-11-12T10:16:52Z","git_url":"git://github.com/alphagov/digitalmarketplace-scripts.git","ssh_url":"git@github.com:alphagov/digitalmarketplace-scripts.git","clone_url":"https://github.com/alphagov/digitalmarketplace-scripts.git","svn_url":"https://github.com/alphagov/digitalmarketplace-scripts","homepage":null,"size":304,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/pulls/12"},"html":{"href":"https://github.com/alphagov/digitalmarketplace-scripts/pull/12"},"issue":{"href":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/issues/12"},"comments":{"href":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/digitalmarketplace-scripts/statuses/115f2ad5baa7c41cc025a9b4e4383003c54a653a"}}}}