{"action":"created","comment":{"url":"https://api.github.com/repos/mitodl/mitxpro/pulls/comments/356738386","pull_request_review_id":330703154,"id":356738386,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM1NjczODM4Ng==","diff_hunk":"@@ -801,19 +813,19 @@ def get_sheet_rows(self, sheet_id):\n         status_dates = (item_at_index_or_none(row, 3) for row in data_rows)\n         return zip(coupon_codes, emails, statuses, status_dates)\n \n-    def get_enumerated_sheet_rows(self, sheet_id):\n+    def get_enumerated_sheet_rows(self, worksheet):\n         \"\"\"\n         Returns enumerated raw data rows in a coupon assignment sheet.\n \n         Args:\n-            sheet_id (str): A coupon assignment spreadsheet id\n+            worksheet (pygsheets.worksheet.Worksheet): A coupon assignment worksheet\n \n         Returns:\n             iterable of (int, iterable of (str, str, str, str)):\n                 An enumerated matrix of raw row data from the sheet\n         \"\"\"\n-        sheet_rows = self.get_sheet_rows(sheet_id)\n-        return enumerate(sheet_rows, start=1)\n+        sheet_rows = self.get_sheet_rows(worksheet)\n+        return enumerate(sheet_rows, start=GOOGLE_SHEET_FIRST_ROW + 1)","path":"sheets/api.py","position":99,"original_position":99,"commit_id":"691ad12e9aa2dd3c49be6345fc37447a1b42d117","original_commit_id":"691ad12e9aa2dd3c49be6345fc37447a1b42d117","user":{"login":"noisecapella","id":863262,"node_id":"MDQ6VXNlcjg2MzI2Mg==","avatar_url":"https://avatars2.githubusercontent.com/u/863262?v=4","gravatar_id":"","url":"https://api.github.com/users/noisecapella","html_url":"https://github.com/noisecapella","followers_url":"https://api.github.com/users/noisecapella/followers","following_url":"https://api.github.com/users/noisecapella/following{/other_user}","gists_url":"https://api.github.com/users/noisecapella/gists{/gist_id}","starred_url":"https://api.github.com/users/noisecapella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noisecapella/subscriptions","organizations_url":"https://api.github.com/users/noisecapella/orgs","repos_url":"https://api.github.com/users/noisecapella/repos","events_url":"https://api.github.com/users/noisecapella/events{/privacy}","received_events_url":"https://api.github.com/users/noisecapella/received_events","type":"User","site_admin":false},"body":"What does this change do? Are we skipping the first row because it's a header row?","created_at":"2019-12-11T17:38:26Z","updated_at":"2019-12-11T17:49:31Z","html_url":"https://github.com/mitodl/mitxpro/pull/1382#discussion_r356738386","pull_request_url":"https://api.github.com/repos/mitodl/mitxpro/pulls/1382","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/mitodl/mitxpro/pulls/comments/356738386"},"html":{"href":"https://github.com/mitodl/mitxpro/pull/1382#discussion_r356738386"},"pull_request":{"href":"https://api.github.com/repos/mitodl/mitxpro/pulls/1382"}}},"pull_request":{"url":"https://api.github.com/repos/mitodl/mitxpro/pulls/1382","id":351520603,"node_id":"MDExOlB1bGxSZXF1ZXN0MzUxNTIwNjAz","html_url":"https://github.com/mitodl/mitxpro/pull/1382","diff_url":"https://github.com/mitodl/mitxpro/pull/1382.diff","patch_url":"https://github.com/mitodl/mitxpro/pull/1382.patch","issue_url":"https://api.github.com/repos/mitodl/mitxpro/issues/1382","number":1382,"state":"open","locked":false,"title":"Optimized coupon assignment sheets processing to ignore unchanged sheets","user":{"login":"gsidebo","id":14932219,"node_id":"MDQ6VXNlcjE0OTMyMjE5","avatar_url":"https://avatars2.githubusercontent.com/u/14932219?v=4","gravatar_id":"","url":"https://api.github.com/users/gsidebo","html_url":"https://github.com/gsidebo","followers_url":"https://api.github.com/users/gsidebo/followers","following_url":"https://api.github.com/users/gsidebo/following{/other_user}","gists_url":"https://api.github.com/users/gsidebo/gists{/gist_id}","starred_url":"https://api.github.com/users/gsidebo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsidebo/subscriptions","organizations_url":"https://api.github.com/users/gsidebo/orgs","repos_url":"https://api.github.com/users/gsidebo/repos","events_url":"https://api.github.com/users/gsidebo/events{/privacy}","received_events_url":"https://api.github.com/users/gsidebo/received_events","type":"User","site_admin":false},"body":"#### Pre-Flight checklist\r\n\r\n- [x] Screenshots and design review for any changes that affect layout or styling\r\n- [x] Migrations\r\n  - [x] Migration is backwards-compatible with current production code\r\n- [x] Testing\r\n  - [ ] Code is tested\r\n  - [x] Changes have been manually tested\r\n\r\n#### What are the relevant tickets?\r\nNo ticket, related to the epic #1179. \r\n\r\n#### What's this PR do?\r\nChanges assignment sheet processing logic so that we only attempt to process the sheet if it was modified since the last time it was scanned.\r\n\r\n#### How should this be manually tested?\r\nCode review only. Functional testing will be done in RC\r\n\r\n#### Any background context you want to provide?\r\nThis was done to solve a performance issue observed in RC with processing coupon assignment sheets. Not only was assignment sheet processing slow, we also observed 429 and 503 responses from the Google API which were almost definitely caused by the large number of unnecessary requests for these sheets.\r\n\r\n#### Screenshots (if appropriate)\r\n![ss 2019-12-10 at 12 29 05 ](https://user-images.githubusercontent.com/14932219/70555106-61c53500-1b4c-11ea-8fe9-3f5182f8b5df.png)\r\n\r\n\r\n","created_at":"2019-12-10T17:58:38Z","updated_at":"2019-12-11T17:49:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"19f3bc255512316cc568866e0915de77c62ead2e","assignee":{"login":"noisecapella","id":863262,"node_id":"MDQ6VXNlcjg2MzI2Mg==","avatar_url":"https://avatars2.githubusercontent.com/u/863262?v=4","gravatar_id":"","url":"https://api.github.com/users/noisecapella","html_url":"https://github.com/noisecapella","followers_url":"https://api.github.com/users/noisecapella/followers","following_url":"https://api.github.com/users/noisecapella/following{/other_user}","gists_url":"https://api.github.com/users/noisecapella/gists{/gist_id}","starred_url":"https://api.github.com/users/noisecapella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noisecapella/subscriptions","organizations_url":"https://api.github.com/users/noisecapella/orgs","repos_url":"https://api.github.com/users/noisecapella/repos","events_url":"https://api.github.com/users/noisecapella/events{/privacy}","received_events_url":"https://api.github.com/users/noisecapella/received_events","type":"User","site_admin":false},"assignees":[{"login":"noisecapella","id":863262,"node_id":"MDQ6VXNlcjg2MzI2Mg==","avatar_url":"https://avatars2.githubusercontent.com/u/863262?v=4","gravatar_id":"","url":"https://api.github.com/users/noisecapella","html_url":"https://github.com/noisecapella","followers_url":"https://api.github.com/users/noisecapella/followers","following_url":"https://api.github.com/users/noisecapella/following{/other_user}","gists_url":"https://api.github.com/users/noisecapella/gists{/gist_id}","starred_url":"https://api.github.com/users/noisecapella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noisecapella/subscriptions","organizations_url":"https://api.github.com/users/noisecapella/orgs","repos_url":"https://api.github.com/users/noisecapella/repos","events_url":"https://api.github.com/users/noisecapella/events{/privacy}","received_events_url":"https://api.github.com/users/noisecapella/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1241659722,"node_id":"MDU6TGFiZWwxMjQxNjU5NzIy","url":"https://api.github.com/repos/mitodl/mitxpro/labels/Needs%20Review","name":"Needs Review","color":"f9d0c4","default":false,"description":""}],"milestone":null,"commits_url":"https://api.github.com/repos/mitodl/mitxpro/pulls/1382/commits","review_comments_url":"https://api.github.com/repos/mitodl/mitxpro/pulls/1382/comments","review_comment_url":"https://api.github.com/repos/mitodl/mitxpro/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mitodl/mitxpro/issues/1382/comments","statuses_url":"https://api.github.com/repos/mitodl/mitxpro/statuses/691ad12e9aa2dd3c49be6345fc37447a1b42d117","head":{"label":"mitodl:assignment_sheets_optimization","ref":"assignment_sheets_optimization","sha":"691ad12e9aa2dd3c49be6345fc37447a1b42d117","user":{"login":"mitodl","id":7918516,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5MTg1MTY=","avatar_url":"https://avatars2.githubusercontent.com/u/7918516?v=4","gravatar_id":"","url":"https://api.github.com/users/mitodl","html_url":"https://github.com/mitodl","followers_url":"https://api.github.com/users/mitodl/followers","following_url":"https://api.github.com/users/mitodl/following{/other_user}","gists_url":"https://api.github.com/users/mitodl/gists{/gist_id}","starred_url":"https://api.github.com/users/mitodl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitodl/subscriptions","organizations_url":"https://api.github.com/users/mitodl/orgs","repos_url":"https://api.github.com/users/mitodl/repos","events_url":"https://api.github.com/users/mitodl/events{/privacy}","received_events_url":"https://api.github.com/users/mitodl/received_events","type":"Organization","site_admin":false},"repo":{"id":171727968,"node_id":"MDEwOlJlcG9zaXRvcnkxNzE3Mjc5Njg=","name":"mitxpro","full_name":"mitodl/mitxpro","private":false,"owner":{"login":"mitodl","id":7918516,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5MTg1MTY=","avatar_url":"https://avatars2.githubusercontent.com/u/7918516?v=4","gravatar_id":"","url":"https://api.github.com/users/mitodl","html_url":"https://github.com/mitodl","followers_url":"https://api.github.com/users/mitodl/followers","following_url":"https://api.github.com/users/mitodl/following{/other_user}","gists_url":"https://api.github.com/users/mitodl/gists{/gist_id}","starred_url":"https://api.github.com/users/mitodl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitodl/subscriptions","organizations_url":"https://api.github.com/users/mitodl/orgs","repos_url":"https://api.github.com/users/mitodl/repos","events_url":"https://api.github.com/users/mitodl/events{/privacy}","received_events_url":"https://api.github.com/users/mitodl/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mitodl/mitxpro","description":null,"fork":false,"url":"https://api.github.com/repos/mitodl/mitxpro","forks_url":"https://api.github.com/repos/mitodl/mitxpro/forks","keys_url":"https://api.github.com/repos/mitodl/mitxpro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mitodl/mitxpro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mitodl/mitxpro/teams","hooks_url":"https://api.github.com/repos/mitodl/mitxpro/hooks","issue_events_url":"https://api.github.com/repos/mitodl/mitxpro/issues/events{/number}","events_url":"https://api.github.com/repos/mitodl/mitxpro/events","assignees_url":"https://api.github.com/repos/mitodl/mitxpro/assignees{/user}","branches_url":"https://api.github.com/repos/mitodl/mitxpro/branches{/branch}","tags_url":"https://api.github.com/repos/mitodl/mitxpro/tags","blobs_url":"https://api.github.com/repos/mitodl/mitxpro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mitodl/mitxpro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mitodl/mitxpro/git/refs{/sha}","trees_url":"https://api.github.com/repos/mitodl/mitxpro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mitodl/mitxpro/statuses/{sha}","languages_url":"https://api.github.com/repos/mitodl/mitxpro/languages","stargazers_url":"https://api.github.com/repos/mitodl/mitxpro/stargazers","contributors_url":"https://api.github.com/repos/mitodl/mitxpro/contributors","subscribers_url":"https://api.github.com/repos/mitodl/mitxpro/subscribers","subscription_url":"https://api.github.com/repos/mitodl/mitxpro/subscription","commits_url":"https://api.github.com/repos/mitodl/mitxpro/commits{/sha}","git_commits_url":"https://api.github.com/repos/mitodl/mitxpro/git/commits{/sha}","comments_url":"https://api.github.com/repos/mitodl/mitxpro/comments{/number}","issue_comment_url":"https://api.github.com/repos/mitodl/mitxpro/issues/comments{/number}","contents_url":"https://api.github.com/repos/mitodl/mitxpro/contents/{+path}","compare_url":"https://api.github.com/repos/mitodl/mitxpro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mitodl/mitxpro/merges","archive_url":"https://api.github.com/repos/mitodl/mitxpro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mitodl/mitxpro/downloads","issues_url":"https://api.github.com/repos/mitodl/mitxpro/issues{/number}","pulls_url":"https://api.github.com/repos/mitodl/mitxpro/pulls{/number}","milestones_url":"https://api.github.com/repos/mitodl/mitxpro/milestones{/number}","notifications_url":"https://api.github.com/repos/mitodl/mitxpro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mitodl/mitxpro/labels{/name}","releases_url":"https://api.github.com/repos/mitodl/mitxpro/releases{/id}","deployments_url":"https://api.github.com/repos/mitodl/mitxpro/deployments","created_at":"2019-02-20T18:33:28Z","updated_at":"2019-12-10T17:43:24Z","pushed_at":"2019-12-11T17:35:02Z","git_url":"git://github.com/mitodl/mitxpro.git","ssh_url":"git@github.com:mitodl/mitxpro.git","clone_url":"https://github.com/mitodl/mitxpro.git","svn_url":"https://github.com/mitodl/mitxpro","homepage":null,"size":4179,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":122,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":122,"watchers":2,"default_branch":"master"}},"base":{"label":"mitodl:master","ref":"master","sha":"73c338445701d8055d5bc20deb8fecf2807b86a2","user":{"login":"mitodl","id":7918516,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5MTg1MTY=","avatar_url":"https://avatars2.githubusercontent.com/u/7918516?v=4","gravatar_id":"","url":"https://api.github.com/users/mitodl","html_url":"https://github.com/mitodl","followers_url":"https://api.github.com/users/mitodl/followers","following_url":"https://api.github.com/users/mitodl/following{/other_user}","gists_url":"https://api.github.com/users/mitodl/gists{/gist_id}","starred_url":"https://api.github.com/users/mitodl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitodl/subscriptions","organizations_url":"https://api.github.com/users/mitodl/orgs","repos_url":"https://api.github.com/users/mitodl/repos","events_url":"https://api.github.com/users/mitodl/events{/privacy}","received_events_url":"https://api.github.com/users/mitodl/received_events","type":"Organization","site_admin":false},"repo":{"id":171727968,"node_id":"MDEwOlJlcG9zaXRvcnkxNzE3Mjc5Njg=","name":"mitxpro","full_name":"mitodl/mitxpro","private":false,"owner":{"login":"mitodl","id":7918516,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5MTg1MTY=","avatar_url":"https://avatars2.githubusercontent.com/u/7918516?v=4","gravatar_id":"","url":"https://api.github.com/users/mitodl","html_url":"https://github.com/mitodl","followers_url":"https://api.github.com/users/mitodl/followers","following_url":"https://api.github.com/users/mitodl/following{/other_user}","gists_url":"https://api.github.com/users/mitodl/gists{/gist_id}","starred_url":"https://api.github.com/users/mitodl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitodl/subscriptions","organizations_url":"https://api.github.com/users/mitodl/orgs","repos_url":"https://api.github.com/users/mitodl/repos","events_url":"https://api.github.com/users/mitodl/events{/privacy}","received_events_url":"https://api.github.com/users/mitodl/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mitodl/mitxpro","description":null,"fork":false,"url":"https://api.github.com/repos/mitodl/mitxpro","forks_url":"https://api.github.com/repos/mitodl/mitxpro/forks","keys_url":"https://api.github.com/repos/mitodl/mitxpro/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mitodl/mitxpro/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mitodl/mitxpro/teams","hooks_url":"https://api.github.com/repos/mitodl/mitxpro/hooks","issue_events_url":"https://api.github.com/repos/mitodl/mitxpro/issues/events{/number}","events_url":"https://api.github.com/repos/mitodl/mitxpro/events","assignees_url":"https://api.github.com/repos/mitodl/mitxpro/assignees{/user}","branches_url":"https://api.github.com/repos/mitodl/mitxpro/branches{/branch}","tags_url":"https://api.github.com/repos/mitodl/mitxpro/tags","blobs_url":"https://api.github.com/repos/mitodl/mitxpro/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mitodl/mitxpro/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mitodl/mitxpro/git/refs{/sha}","trees_url":"https://api.github.com/repos/mitodl/mitxpro/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mitodl/mitxpro/statuses/{sha}","languages_url":"https://api.github.com/repos/mitodl/mitxpro/languages","stargazers_url":"https://api.github.com/repos/mitodl/mitxpro/stargazers","contributors_url":"https://api.github.com/repos/mitodl/mitxpro/contributors","subscribers_url":"https://api.github.com/repos/mitodl/mitxpro/subscribers","subscription_url":"https://api.github.com/repos/mitodl/mitxpro/subscription","commits_url":"https://api.github.com/repos/mitodl/mitxpro/commits{/sha}","git_commits_url":"https://api.github.com/repos/mitodl/mitxpro/git/commits{/sha}","comments_url":"https://api.github.com/repos/mitodl/mitxpro/comments{/number}","issue_comment_url":"https://api.github.com/repos/mitodl/mitxpro/issues/comments{/number}","contents_url":"https://api.github.com/repos/mitodl/mitxpro/contents/{+path}","compare_url":"https://api.github.com/repos/mitodl/mitxpro/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mitodl/mitxpro/merges","archive_url":"https://api.github.com/repos/mitodl/mitxpro/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mitodl/mitxpro/downloads","issues_url":"https://api.github.com/repos/mitodl/mitxpro/issues{/number}","pulls_url":"https://api.github.com/repos/mitodl/mitxpro/pulls{/number}","milestones_url":"https://api.github.com/repos/mitodl/mitxpro/milestones{/number}","notifications_url":"https://api.github.com/repos/mitodl/mitxpro/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mitodl/mitxpro/labels{/name}","releases_url":"https://api.github.com/repos/mitodl/mitxpro/releases{/id}","deployments_url":"https://api.github.com/repos/mitodl/mitxpro/deployments","created_at":"2019-02-20T18:33:28Z","updated_at":"2019-12-10T17:43:24Z","pushed_at":"2019-12-11T17:35:02Z","git_url":"git://github.com/mitodl/mitxpro.git","ssh_url":"git@github.com:mitodl/mitxpro.git","clone_url":"https://github.com/mitodl/mitxpro.git","svn_url":"https://github.com/mitodl/mitxpro","homepage":null,"size":4179,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":122,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":122,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mitodl/mitxpro/pulls/1382"},"html":{"href":"https://github.com/mitodl/mitxpro/pull/1382"},"issue":{"href":"https://api.github.com/repos/mitodl/mitxpro/issues/1382"},"comments":{"href":"https://api.github.com/repos/mitodl/mitxpro/issues/1382/comments"},"review_comments":{"href":"https://api.github.com/repos/mitodl/mitxpro/pulls/1382/comments"},"review_comment":{"href":"https://api.github.com/repos/mitodl/mitxpro/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mitodl/mitxpro/pulls/1382/commits"},"statuses":{"href":"https://api.github.com/repos/mitodl/mitxpro/statuses/691ad12e9aa2dd3c49be6345fc37447a1b42d117"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"noisecapella"}}