{"action":"created","comment":{"url":"https://api.github.com/repos/dod-ccpo/authnid/pulls/comments/202700404","pull_request_review_id":137444483,"id":202700404,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjcwMDQwNA==","diff_hunk":"@@ -30,25 +29,44 @@ def crl_list_from_disa_html(html):\n     return parser.crl_list\n \n \n-def write_crls(out_dir, crl_list):\n-    for crl_location in crl_list:\n-        name = re.split(\"/\", crl_location)[-1]\n-        crl = os.path.join(out_dir, name)\n-        try:\n-            with requests.get(crl_location, stream=True) as r:\n-                with open(crl, \"wb\") as crl_file:\n-                    for chunk in r.iter_content(chunk_size=1024):\n-                        if chunk:\n-                            crl_file.write(chunk)\n-        except requests.exceptions.ChunkedEncodingError:\n-            print(\"Error downloading {}, continuing anyway\".format(crl_location))\n+def write_crl(out_dir, crl_location):\n+    name = re.split(\"/\", crl_location)[-1]\n+    crl = os.path.join(out_dir, name)\n+    with requests.get(crl_location, stream=True) as r:\n+        with open(crl, \"wb\") as crl_file:\n+            for chunk in r.iter_content(chunk_size=1024):\n+                if chunk:\n+                    crl_file.write(chunk)","path":"authnid/crl/util.py","position":31,"original_position":31,"commit_id":"617bf906ffee976f4d5c73b33cbf3b7060a8c7de","original_commit_id":"617bf906ffee976f4d5c73b33cbf3b7060a8c7de","user":{"login":"patricksmithdds","id":40774582,"node_id":"MDQ6VXNlcjQwNzc0NTgy","avatar_url":"https://avatars3.githubusercontent.com/u/40774582?v=4","gravatar_id":"","url":"https://api.github.com/users/patricksmithdds","html_url":"https://github.com/patricksmithdds","followers_url":"https://api.github.com/users/patricksmithdds/followers","following_url":"https://api.github.com/users/patricksmithdds/following{/other_user}","gists_url":"https://api.github.com/users/patricksmithdds/gists{/gist_id}","starred_url":"https://api.github.com/users/patricksmithdds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patricksmithdds/subscriptions","organizations_url":"https://api.github.com/users/patricksmithdds/orgs","repos_url":"https://api.github.com/users/patricksmithdds/repos","events_url":"https://api.github.com/users/patricksmithdds/events{/privacy}","received_events_url":"https://api.github.com/users/patricksmithdds/received_events","type":"User","site_admin":false},"body":"This is more of a general question, not this PR, but: since we're writing out the chunks as we get them, if the download fails, we'll still write out a partial CRL. Does that produce a corrupted CRL that the app later ignores or a partial CRL that is handled like the others? Should we remove the file if we receive a chunked encoding error?","created_at":"2018-07-16T14:21:03Z","updated_at":"2018-07-16T14:21:36Z","html_url":"https://github.com/dod-ccpo/authnid/pull/30#discussion_r202700404","pull_request_url":"https://api.github.com/repos/dod-ccpo/authnid/pulls/30","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/dod-ccpo/authnid/pulls/comments/202700404"},"html":{"href":"https://github.com/dod-ccpo/authnid/pull/30#discussion_r202700404"},"pull_request":{"href":"https://api.github.com/repos/dod-ccpo/authnid/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/dod-ccpo/authnid/pulls/30","id":201338983,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxMzM4OTgz","html_url":"https://github.com/dod-ccpo/authnid/pull/30","diff_url":"https://github.com/dod-ccpo/authnid/pull/30.diff","patch_url":"https://github.com/dod-ccpo/authnid/pull/30.patch","issue_url":"https://api.github.com/repos/dod-ccpo/authnid/issues/30","number":30,"state":"open","locked":false,"title":"better logging in CRL sync and more careful replacement of CRL dir","user":{"login":"dandds","id":38955503,"node_id":"MDQ6VXNlcjM4OTU1NTAz","avatar_url":"https://avatars3.githubusercontent.com/u/38955503?v=4","gravatar_id":"","url":"https://api.github.com/users/dandds","html_url":"https://github.com/dandds","followers_url":"https://api.github.com/users/dandds/followers","following_url":"https://api.github.com/users/dandds/following{/other_user}","gists_url":"https://api.github.com/users/dandds/gists{/gist_id}","starred_url":"https://api.github.com/users/dandds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dandds/subscriptions","organizations_url":"https://api.github.com/users/dandds/orgs","repos_url":"https://api.github.com/users/dandds/repos","events_url":"https://api.github.com/users/dandds/events{/privacy}","received_events_url":"https://api.github.com/users/dandds/received_events","type":"User","site_admin":false},"body":"I realized that the original `sync-crls` script deletes the crl directory when it starts, meaning that it might not be there if the app tries to rebuild its CRL cache while the CRLs are being updated. This syncs to a temp dir and then rsyncs the new copies and adds better logging for the sync operation.","created_at":"2018-07-13T16:21:57Z","updated_at":"2018-07-16T14:21:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f2fbc526c53a44db30791681587778a13078c29f","assignee":null,"assignees":[],"requested_reviewers":[{"login":"briandds","id":38010414,"node_id":"MDQ6VXNlcjM4MDEwNDE0","avatar_url":"https://avatars0.githubusercontent.com/u/38010414?v=4","gravatar_id":"","url":"https://api.github.com/users/briandds","html_url":"https://github.com/briandds","followers_url":"https://api.github.com/users/briandds/followers","following_url":"https://api.github.com/users/briandds/following{/other_user}","gists_url":"https://api.github.com/users/briandds/gists{/gist_id}","starred_url":"https://api.github.com/users/briandds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briandds/subscriptions","organizations_url":"https://api.github.com/users/briandds/orgs","repos_url":"https://api.github.com/users/briandds/repos","events_url":"https://api.github.com/users/briandds/events{/privacy}","received_events_url":"https://api.github.com/users/briandds/received_events","type":"User","site_admin":false},{"login":"richard-dds","id":38955572,"node_id":"MDQ6VXNlcjM4OTU1NTcy","avatar_url":"https://avatars3.githubusercontent.com/u/38955572?v=4","gravatar_id":"","url":"https://api.github.com/users/richard-dds","html_url":"https://github.com/richard-dds","followers_url":"https://api.github.com/users/richard-dds/followers","following_url":"https://api.github.com/users/richard-dds/following{/other_user}","gists_url":"https://api.github.com/users/richard-dds/gists{/gist_id}","starred_url":"https://api.github.com/users/richard-dds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richard-dds/subscriptions","organizations_url":"https://api.github.com/users/richard-dds/orgs","repos_url":"https://api.github.com/users/richard-dds/repos","events_url":"https://api.github.com/users/richard-dds/events{/privacy}","received_events_url":"https://api.github.com/users/richard-dds/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dod-ccpo/authnid/pulls/30/commits","review_comments_url":"https://api.github.com/repos/dod-ccpo/authnid/pulls/30/comments","review_comment_url":"https://api.github.com/repos/dod-ccpo/authnid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dod-ccpo/authnid/issues/30/comments","statuses_url":"https://api.github.com/repos/dod-ccpo/authnid/statuses/617bf906ffee976f4d5c73b33cbf3b7060a8c7de","head":{"label":"dod-ccpo:logging-crl-sync","ref":"logging-crl-sync","sha":"617bf906ffee976f4d5c73b33cbf3b7060a8c7de","user":{"login":"dod-ccpo","id":38081014,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4MDgxMDE0","avatar_url":"https://avatars2.githubusercontent.com/u/38081014?v=4","gravatar_id":"","url":"https://api.github.com/users/dod-ccpo","html_url":"https://github.com/dod-ccpo","followers_url":"https://api.github.com/users/dod-ccpo/followers","following_url":"https://api.github.com/users/dod-ccpo/following{/other_user}","gists_url":"https://api.github.com/users/dod-ccpo/gists{/gist_id}","starred_url":"https://api.github.com/users/dod-ccpo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dod-ccpo/subscriptions","organizations_url":"https://api.github.com/users/dod-ccpo/orgs","repos_url":"https://api.github.com/users/dod-ccpo/repos","events_url":"https://api.github.com/users/dod-ccpo/events{/privacy}","received_events_url":"https://api.github.com/users/dod-ccpo/received_events","type":"Organization","site_admin":false},"repo":{"id":134761856,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQ3NjE4NTY=","name":"authnid","full_name":"dod-ccpo/authnid","owner":{"login":"dod-ccpo","id":38081014,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4MDgxMDE0","avatar_url":"https://avatars2.githubusercontent.com/u/38081014?v=4","gravatar_id":"","url":"https://api.github.com/users/dod-ccpo","html_url":"https://github.com/dod-ccpo","followers_url":"https://api.github.com/users/dod-ccpo/followers","following_url":"https://api.github.com/users/dod-ccpo/following{/other_user}","gists_url":"https://api.github.com/users/dod-ccpo/gists{/gist_id}","starred_url":"https://api.github.com/users/dod-ccpo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dod-ccpo/subscriptions","organizations_url":"https://api.github.com/users/dod-ccpo/orgs","repos_url":"https://api.github.com/users/dod-ccpo/repos","events_url":"https://api.github.com/users/dod-ccpo/events{/privacy}","received_events_url":"https://api.github.com/users/dod-ccpo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dod-ccpo/authnid","description":null,"fork":false,"url":"https://api.github.com/repos/dod-ccpo/authnid","forks_url":"https://api.github.com/repos/dod-ccpo/authnid/forks","keys_url":"https://api.github.com/repos/dod-ccpo/authnid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dod-ccpo/authnid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dod-ccpo/authnid/teams","hooks_url":"https://api.github.com/repos/dod-ccpo/authnid/hooks","issue_events_url":"https://api.github.com/repos/dod-ccpo/authnid/issues/events{/number}","events_url":"https://api.github.com/repos/dod-ccpo/authnid/events","assignees_url":"https://api.github.com/repos/dod-ccpo/authnid/assignees{/user}","branches_url":"https://api.github.com/repos/dod-ccpo/authnid/branches{/branch}","tags_url":"https://api.github.com/repos/dod-ccpo/authnid/tags","blobs_url":"https://api.github.com/repos/dod-ccpo/authnid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dod-ccpo/authnid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dod-ccpo/authnid/git/refs{/sha}","trees_url":"https://api.github.com/repos/dod-ccpo/authnid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dod-ccpo/authnid/statuses/{sha}","languages_url":"https://api.github.com/repos/dod-ccpo/authnid/languages","stargazers_url":"https://api.github.com/repos/dod-ccpo/authnid/stargazers","contributors_url":"https://api.github.com/repos/dod-ccpo/authnid/contributors","subscribers_url":"https://api.github.com/repos/dod-ccpo/authnid/subscribers","subscription_url":"https://api.github.com/repos/dod-ccpo/authnid/subscription","commits_url":"https://api.github.com/repos/dod-ccpo/authnid/commits{/sha}","git_commits_url":"https://api.github.com/repos/dod-ccpo/authnid/git/commits{/sha}","comments_url":"https://api.github.com/repos/dod-ccpo/authnid/comments{/number}","issue_comment_url":"https://api.github.com/repos/dod-ccpo/authnid/issues/comments{/number}","contents_url":"https://api.github.com/repos/dod-ccpo/authnid/contents/{+path}","compare_url":"https://api.github.com/repos/dod-ccpo/authnid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dod-ccpo/authnid/merges","archive_url":"https://api.github.com/repos/dod-ccpo/authnid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dod-ccpo/authnid/downloads","issues_url":"https://api.github.com/repos/dod-ccpo/authnid/issues{/number}","pulls_url":"https://api.github.com/repos/dod-ccpo/authnid/pulls{/number}","milestones_url":"https://api.github.com/repos/dod-ccpo/authnid/milestones{/number}","notifications_url":"https://api.github.com/repos/dod-ccpo/authnid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dod-ccpo/authnid/labels{/name}","releases_url":"https://api.github.com/repos/dod-ccpo/authnid/releases{/id}","deployments_url":"https://api.github.com/repos/dod-ccpo/authnid/deployments","created_at":"2018-05-24T19:49:54Z","updated_at":"2018-07-12T19:17:32Z","pushed_at":"2018-07-16T13:32:56Z","git_url":"git://github.com/dod-ccpo/authnid.git","ssh_url":"git@github.com:dod-ccpo/authnid.git","clone_url":"https://github.com/dod-ccpo/authnid.git","svn_url":"https://github.com/dod-ccpo/authnid","homepage":null,"size":262,"stargazers_count":0,"watchers_count":0,"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,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"dod-ccpo:master","ref":"master","sha":"2df365a9696047a676058eee047cfbb698ecb706","user":{"login":"dod-ccpo","id":38081014,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4MDgxMDE0","avatar_url":"https://avatars2.githubusercontent.com/u/38081014?v=4","gravatar_id":"","url":"https://api.github.com/users/dod-ccpo","html_url":"https://github.com/dod-ccpo","followers_url":"https://api.github.com/users/dod-ccpo/followers","following_url":"https://api.github.com/users/dod-ccpo/following{/other_user}","gists_url":"https://api.github.com/users/dod-ccpo/gists{/gist_id}","starred_url":"https://api.github.com/users/dod-ccpo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dod-ccpo/subscriptions","organizations_url":"https://api.github.com/users/dod-ccpo/orgs","repos_url":"https://api.github.com/users/dod-ccpo/repos","events_url":"https://api.github.com/users/dod-ccpo/events{/privacy}","received_events_url":"https://api.github.com/users/dod-ccpo/received_events","type":"Organization","site_admin":false},"repo":{"id":134761856,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQ3NjE4NTY=","name":"authnid","full_name":"dod-ccpo/authnid","owner":{"login":"dod-ccpo","id":38081014,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4MDgxMDE0","avatar_url":"https://avatars2.githubusercontent.com/u/38081014?v=4","gravatar_id":"","url":"https://api.github.com/users/dod-ccpo","html_url":"https://github.com/dod-ccpo","followers_url":"https://api.github.com/users/dod-ccpo/followers","following_url":"https://api.github.com/users/dod-ccpo/following{/other_user}","gists_url":"https://api.github.com/users/dod-ccpo/gists{/gist_id}","starred_url":"https://api.github.com/users/dod-ccpo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dod-ccpo/subscriptions","organizations_url":"https://api.github.com/users/dod-ccpo/orgs","repos_url":"https://api.github.com/users/dod-ccpo/repos","events_url":"https://api.github.com/users/dod-ccpo/events{/privacy}","received_events_url":"https://api.github.com/users/dod-ccpo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dod-ccpo/authnid","description":null,"fork":false,"url":"https://api.github.com/repos/dod-ccpo/authnid","forks_url":"https://api.github.com/repos/dod-ccpo/authnid/forks","keys_url":"https://api.github.com/repos/dod-ccpo/authnid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dod-ccpo/authnid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dod-ccpo/authnid/teams","hooks_url":"https://api.github.com/repos/dod-ccpo/authnid/hooks","issue_events_url":"https://api.github.com/repos/dod-ccpo/authnid/issues/events{/number}","events_url":"https://api.github.com/repos/dod-ccpo/authnid/events","assignees_url":"https://api.github.com/repos/dod-ccpo/authnid/assignees{/user}","branches_url":"https://api.github.com/repos/dod-ccpo/authnid/branches{/branch}","tags_url":"https://api.github.com/repos/dod-ccpo/authnid/tags","blobs_url":"https://api.github.com/repos/dod-ccpo/authnid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dod-ccpo/authnid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dod-ccpo/authnid/git/refs{/sha}","trees_url":"https://api.github.com/repos/dod-ccpo/authnid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dod-ccpo/authnid/statuses/{sha}","languages_url":"https://api.github.com/repos/dod-ccpo/authnid/languages","stargazers_url":"https://api.github.com/repos/dod-ccpo/authnid/stargazers","contributors_url":"https://api.github.com/repos/dod-ccpo/authnid/contributors","subscribers_url":"https://api.github.com/repos/dod-ccpo/authnid/subscribers","subscription_url":"https://api.github.com/repos/dod-ccpo/authnid/subscription","commits_url":"https://api.github.com/repos/dod-ccpo/authnid/commits{/sha}","git_commits_url":"https://api.github.com/repos/dod-ccpo/authnid/git/commits{/sha}","comments_url":"https://api.github.com/repos/dod-ccpo/authnid/comments{/number}","issue_comment_url":"https://api.github.com/repos/dod-ccpo/authnid/issues/comments{/number}","contents_url":"https://api.github.com/repos/dod-ccpo/authnid/contents/{+path}","compare_url":"https://api.github.com/repos/dod-ccpo/authnid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dod-ccpo/authnid/merges","archive_url":"https://api.github.com/repos/dod-ccpo/authnid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dod-ccpo/authnid/downloads","issues_url":"https://api.github.com/repos/dod-ccpo/authnid/issues{/number}","pulls_url":"https://api.github.com/repos/dod-ccpo/authnid/pulls{/number}","milestones_url":"https://api.github.com/repos/dod-ccpo/authnid/milestones{/number}","notifications_url":"https://api.github.com/repos/dod-ccpo/authnid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dod-ccpo/authnid/labels{/name}","releases_url":"https://api.github.com/repos/dod-ccpo/authnid/releases{/id}","deployments_url":"https://api.github.com/repos/dod-ccpo/authnid/deployments","created_at":"2018-05-24T19:49:54Z","updated_at":"2018-07-12T19:17:32Z","pushed_at":"2018-07-16T13:32:56Z","git_url":"git://github.com/dod-ccpo/authnid.git","ssh_url":"git@github.com:dod-ccpo/authnid.git","clone_url":"https://github.com/dod-ccpo/authnid.git","svn_url":"https://github.com/dod-ccpo/authnid","homepage":null,"size":262,"stargazers_count":0,"watchers_count":0,"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,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dod-ccpo/authnid/pulls/30"},"html":{"href":"https://github.com/dod-ccpo/authnid/pull/30"},"issue":{"href":"https://api.github.com/repos/dod-ccpo/authnid/issues/30"},"comments":{"href":"https://api.github.com/repos/dod-ccpo/authnid/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/dod-ccpo/authnid/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/dod-ccpo/authnid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dod-ccpo/authnid/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/dod-ccpo/authnid/statuses/617bf906ffee976f4d5c73b33cbf3b7060a8c7de"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"patricksmithdds"}}