{"action":"created","comment":{"url":"https://api.github.com/repos/MartinNowak/dlang-bot/pulls/comments/92947316","pull_request_review_id":13469207,"id":92947316,"diff_hunk":"@@ -1,15 +1,48 @@\n+module app;\n+\n import vibe.d, std.algorithm, std.process, std.range, std.regex;\n+import std.datetime, std.typecons;\n \n string githubAuth, trelloSecret, trelloAuth, hookSecret, travisAuth;\n \n-version (unittest) {}\n-else shared static this()\n+string githubAPIURL = \"https://api.github.com\";\n+string travisAPIURL = \"https://api.travis-ci.org\";\n+string trelloAPIURL = \"https://api.trello.com\";\n+string bugzillaURL = \"https://issues.dlang.org\";\n+bool runAsync = true;\n+bool runTrello = true;\n+\n+SysTime lastFullPRCheck;\n+Duration timeBetweenFullPRChecks = 15.minutes;\n+\n+version(unittest){} else\n+shared static this()\n {\n     auto settings = new HTTPServerSettings;\n     settings.port = 8080;\n+    readOption(\"port|p\", &settings.port, \"Sets the port used for serving.\");\n+\n+    githubAuth = \"token \"~environment[\"GH_TOKEN\"];\n+    trelloSecret = environment[\"TRELLO_SECRET\"];\n+    trelloAuth = \"key=\"~environment[\"TRELLO_KEY\"]~\"&token=\"~environment[\"TRELLO_TOKEN\"];\n+    hookSecret = environment[\"GH_HOOK_SECRET\"];\n+    travisAuth = \"token \" ~ environment[\"TRAVIS_TOKEN\"];\n+\n+    // workaround for stupid openssl.conf on Heroku\n+    if (environment.get(\"DYNO\") !is null)\n+    {\n+        HTTPClient.setTLSSetupCallback((ctx) {\n+            ctx.useTrustedCertificateFile(\"/etc/ssl/certs/ca-certificates.crt\");\n+        });\n+    }\n+}\n+\n+void startServer(HTTPServerSettings settings)\n+{\n     settings.bindAddresses = [\"0.0.0.0\"];\n     settings.options = HTTPServerOption.defaults & ~HTTPServerOption.parseJsonBody;\n-    readOption(\"port|p\", &settings.port, \"Sets the port used for serving.\");\n+\n+    lastFullPRCheck = SysTime(DateTime(0, 1, 1, 0, 0, 0));","path":"source/app.d","position":48,"original_position":48,"commit_id":"9733ee3dedd680085e036f1e161c0781c4744724","original_commit_id":"9733ee3dedd680085e036f1e161c0781c4744724","user":{"login":"MartinNowak","id":288976,"avatar_url":"https://avatars.githubusercontent.com/u/288976?v=3","gravatar_id":"","url":"https://api.github.com/users/MartinNowak","html_url":"https://github.com/MartinNowak","followers_url":"https://api.github.com/users/MartinNowak/followers","following_url":"https://api.github.com/users/MartinNowak/following{/other_user}","gists_url":"https://api.github.com/users/MartinNowak/gists{/gist_id}","starred_url":"https://api.github.com/users/MartinNowak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartinNowak/subscriptions","organizations_url":"https://api.github.com/users/MartinNowak/orgs","repos_url":"https://api.github.com/users/MartinNowak/repos","events_url":"https://api.github.com/users/MartinNowak/events{/privacy}","received_events_url":"https://api.github.com/users/MartinNowak/received_events","type":"User","site_admin":false},"body":"Wasn't there a SysTime.min?","created_at":"2016-12-18T18:22:08Z","updated_at":"2016-12-18T18:22:08Z","html_url":"https://github.com/MartinNowak/dlang-bot/pull/15#discussion_r92947316","pull_request_url":"https://api.github.com/repos/MartinNowak/dlang-bot/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/MartinNowak/dlang-bot/pulls/comments/92947316"},"html":{"href":"https://github.com/MartinNowak/dlang-bot/pull/15#discussion_r92947316"},"pull_request":{"href":"https://api.github.com/repos/MartinNowak/dlang-bot/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/MartinNowak/dlang-bot/pulls/15","id":98480803,"html_url":"https://github.com/MartinNowak/dlang-bot/pull/15","diff_url":"https://github.com/MartinNowak/dlang-bot/pull/15.diff","patch_url":"https://github.com/MartinNowak/dlang-bot/pull/15.patch","issue_url":"https://api.github.com/repos/MartinNowak/dlang-bot/issues/15","number":15,"state":"open","locked":false,"title":"Automatically merge PRs with auto-merge","user":{"login":"wilzbach","id":4370550,"avatar_url":"https://avatars.githubusercontent.com/u/4370550?v=3","gravatar_id":"","url":"https://api.github.com/users/wilzbach","html_url":"https://github.com/wilzbach","followers_url":"https://api.github.com/users/wilzbach/followers","following_url":"https://api.github.com/users/wilzbach/following{/other_user}","gists_url":"https://api.github.com/users/wilzbach/gists{/gist_id}","starred_url":"https://api.github.com/users/wilzbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilzbach/subscriptions","organizations_url":"https://api.github.com/users/wilzbach/orgs","repos_url":"https://api.github.com/users/wilzbach/repos","events_url":"https://api.github.com/users/wilzbach/events{/privacy}","received_events_url":"https://api.github.com/users/wilzbach/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-18T17:15:22Z","updated_at":"2016-12-18T18:53:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d99d423d0cc1f8991f8961ac4959537ae641fc32","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/MartinNowak/dlang-bot/pulls/15/commits","review_comments_url":"https://api.github.com/repos/MartinNowak/dlang-bot/pulls/15/comments","review_comment_url":"https://api.github.com/repos/MartinNowak/dlang-bot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MartinNowak/dlang-bot/issues/15/comments","statuses_url":"https://api.github.com/repos/MartinNowak/dlang-bot/statuses/9733ee3dedd680085e036f1e161c0781c4744724","head":{"label":"wilzbach:merge-prs","ref":"merge-prs","sha":"9733ee3dedd680085e036f1e161c0781c4744724","user":{"login":"wilzbach","id":4370550,"avatar_url":"https://avatars.githubusercontent.com/u/4370550?v=3","gravatar_id":"","url":"https://api.github.com/users/wilzbach","html_url":"https://github.com/wilzbach","followers_url":"https://api.github.com/users/wilzbach/followers","following_url":"https://api.github.com/users/wilzbach/following{/other_user}","gists_url":"https://api.github.com/users/wilzbach/gists{/gist_id}","starred_url":"https://api.github.com/users/wilzbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilzbach/subscriptions","organizations_url":"https://api.github.com/users/wilzbach/orgs","repos_url":"https://api.github.com/users/wilzbach/repos","events_url":"https://api.github.com/users/wilzbach/events{/privacy}","received_events_url":"https://api.github.com/users/wilzbach/received_events","type":"User","site_admin":false},"repo":{"id":65111435,"name":"dlang-bot","full_name":"wilzbach/dlang-bot","owner":{"login":"wilzbach","id":4370550,"avatar_url":"https://avatars.githubusercontent.com/u/4370550?v=3","gravatar_id":"","url":"https://api.github.com/users/wilzbach","html_url":"https://github.com/wilzbach","followers_url":"https://api.github.com/users/wilzbach/followers","following_url":"https://api.github.com/users/wilzbach/following{/other_user}","gists_url":"https://api.github.com/users/wilzbach/gists{/gist_id}","starred_url":"https://api.github.com/users/wilzbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilzbach/subscriptions","organizations_url":"https://api.github.com/users/wilzbach/orgs","repos_url":"https://api.github.com/users/wilzbach/repos","events_url":"https://api.github.com/users/wilzbach/events{/privacy}","received_events_url":"https://api.github.com/users/wilzbach/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wilzbach/dlang-bot","description":"dlang-bot for automated bugzilla, github, and trello references |","fork":true,"url":"https://api.github.com/repos/wilzbach/dlang-bot","forks_url":"https://api.github.com/repos/wilzbach/dlang-bot/forks","keys_url":"https://api.github.com/repos/wilzbach/dlang-bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wilzbach/dlang-bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wilzbach/dlang-bot/teams","hooks_url":"https://api.github.com/repos/wilzbach/dlang-bot/hooks","issue_events_url":"https://api.github.com/repos/wilzbach/dlang-bot/issues/events{/number}","events_url":"https://api.github.com/repos/wilzbach/dlang-bot/events","assignees_url":"https://api.github.com/repos/wilzbach/dlang-bot/assignees{/user}","branches_url":"https://api.github.com/repos/wilzbach/dlang-bot/branches{/branch}","tags_url":"https://api.github.com/repos/wilzbach/dlang-bot/tags","blobs_url":"https://api.github.com/repos/wilzbach/dlang-bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wilzbach/dlang-bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wilzbach/dlang-bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/wilzbach/dlang-bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wilzbach/dlang-bot/statuses/{sha}","languages_url":"https://api.github.com/repos/wilzbach/dlang-bot/languages","stargazers_url":"https://api.github.com/repos/wilzbach/dlang-bot/stargazers","contributors_url":"https://api.github.com/repos/wilzbach/dlang-bot/contributors","subscribers_url":"https://api.github.com/repos/wilzbach/dlang-bot/subscribers","subscription_url":"https://api.github.com/repos/wilzbach/dlang-bot/subscription","commits_url":"https://api.github.com/repos/wilzbach/dlang-bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/wilzbach/dlang-bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/wilzbach/dlang-bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/wilzbach/dlang-bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/wilzbach/dlang-bot/contents/{+path}","compare_url":"https://api.github.com/repos/wilzbach/dlang-bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wilzbach/dlang-bot/merges","archive_url":"https://api.github.com/repos/wilzbach/dlang-bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wilzbach/dlang-bot/downloads","issues_url":"https://api.github.com/repos/wilzbach/dlang-bot/issues{/number}","pulls_url":"https://api.github.com/repos/wilzbach/dlang-bot/pulls{/number}","milestones_url":"https://api.github.com/repos/wilzbach/dlang-bot/milestones{/number}","notifications_url":"https://api.github.com/repos/wilzbach/dlang-bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wilzbach/dlang-bot/labels{/name}","releases_url":"https://api.github.com/repos/wilzbach/dlang-bot/releases{/id}","deployments_url":"https://api.github.com/repos/wilzbach/dlang-bot/deployments","created_at":"2016-08-07T02:22:18Z","updated_at":"2016-08-07T02:22:19Z","pushed_at":"2016-12-18T18:14:11Z","git_url":"git://github.com/wilzbach/dlang-bot.git","ssh_url":"git@github.com:wilzbach/dlang-bot.git","clone_url":"https://github.com/wilzbach/dlang-bot.git","svn_url":"https://github.com/wilzbach/dlang-bot","homepage":"https://dlang-bot.herokuapp.com/","size":135,"stargazers_count":0,"watchers_count":0,"language":"D","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"MartinNowak:master","ref":"master","sha":"c6ceb71deafb721aadb02761da18cbb92e53dd3b","user":{"login":"MartinNowak","id":288976,"avatar_url":"https://avatars.githubusercontent.com/u/288976?v=3","gravatar_id":"","url":"https://api.github.com/users/MartinNowak","html_url":"https://github.com/MartinNowak","followers_url":"https://api.github.com/users/MartinNowak/followers","following_url":"https://api.github.com/users/MartinNowak/following{/other_user}","gists_url":"https://api.github.com/users/MartinNowak/gists{/gist_id}","starred_url":"https://api.github.com/users/MartinNowak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartinNowak/subscriptions","organizations_url":"https://api.github.com/users/MartinNowak/orgs","repos_url":"https://api.github.com/users/MartinNowak/repos","events_url":"https://api.github.com/users/MartinNowak/events{/privacy}","received_events_url":"https://api.github.com/users/MartinNowak/received_events","type":"User","site_admin":false},"repo":{"id":45722871,"name":"dlang-bot","full_name":"MartinNowak/dlang-bot","owner":{"login":"MartinNowak","id":288976,"avatar_url":"https://avatars.githubusercontent.com/u/288976?v=3","gravatar_id":"","url":"https://api.github.com/users/MartinNowak","html_url":"https://github.com/MartinNowak","followers_url":"https://api.github.com/users/MartinNowak/followers","following_url":"https://api.github.com/users/MartinNowak/following{/other_user}","gists_url":"https://api.github.com/users/MartinNowak/gists{/gist_id}","starred_url":"https://api.github.com/users/MartinNowak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartinNowak/subscriptions","organizations_url":"https://api.github.com/users/MartinNowak/orgs","repos_url":"https://api.github.com/users/MartinNowak/repos","events_url":"https://api.github.com/users/MartinNowak/events{/privacy}","received_events_url":"https://api.github.com/users/MartinNowak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MartinNowak/dlang-bot","description":"dlang-bot for automated bugzilla, github, and trello references |","fork":false,"url":"https://api.github.com/repos/MartinNowak/dlang-bot","forks_url":"https://api.github.com/repos/MartinNowak/dlang-bot/forks","keys_url":"https://api.github.com/repos/MartinNowak/dlang-bot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MartinNowak/dlang-bot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MartinNowak/dlang-bot/teams","hooks_url":"https://api.github.com/repos/MartinNowak/dlang-bot/hooks","issue_events_url":"https://api.github.com/repos/MartinNowak/dlang-bot/issues/events{/number}","events_url":"https://api.github.com/repos/MartinNowak/dlang-bot/events","assignees_url":"https://api.github.com/repos/MartinNowak/dlang-bot/assignees{/user}","branches_url":"https://api.github.com/repos/MartinNowak/dlang-bot/branches{/branch}","tags_url":"https://api.github.com/repos/MartinNowak/dlang-bot/tags","blobs_url":"https://api.github.com/repos/MartinNowak/dlang-bot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MartinNowak/dlang-bot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MartinNowak/dlang-bot/git/refs{/sha}","trees_url":"https://api.github.com/repos/MartinNowak/dlang-bot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MartinNowak/dlang-bot/statuses/{sha}","languages_url":"https://api.github.com/repos/MartinNowak/dlang-bot/languages","stargazers_url":"https://api.github.com/repos/MartinNowak/dlang-bot/stargazers","contributors_url":"https://api.github.com/repos/MartinNowak/dlang-bot/contributors","subscribers_url":"https://api.github.com/repos/MartinNowak/dlang-bot/subscribers","subscription_url":"https://api.github.com/repos/MartinNowak/dlang-bot/subscription","commits_url":"https://api.github.com/repos/MartinNowak/dlang-bot/commits{/sha}","git_commits_url":"https://api.github.com/repos/MartinNowak/dlang-bot/git/commits{/sha}","comments_url":"https://api.github.com/repos/MartinNowak/dlang-bot/comments{/number}","issue_comment_url":"https://api.github.com/repos/MartinNowak/dlang-bot/issues/comments{/number}","contents_url":"https://api.github.com/repos/MartinNowak/dlang-bot/contents/{+path}","compare_url":"https://api.github.com/repos/MartinNowak/dlang-bot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MartinNowak/dlang-bot/merges","archive_url":"https://api.github.com/repos/MartinNowak/dlang-bot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MartinNowak/dlang-bot/downloads","issues_url":"https://api.github.com/repos/MartinNowak/dlang-bot/issues{/number}","pulls_url":"https://api.github.com/repos/MartinNowak/dlang-bot/pulls{/number}","milestones_url":"https://api.github.com/repos/MartinNowak/dlang-bot/milestones{/number}","notifications_url":"https://api.github.com/repos/MartinNowak/dlang-bot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MartinNowak/dlang-bot/labels{/name}","releases_url":"https://api.github.com/repos/MartinNowak/dlang-bot/releases{/id}","deployments_url":"https://api.github.com/repos/MartinNowak/dlang-bot/deployments","created_at":"2015-11-07T04:44:33Z","updated_at":"2016-12-18T00:33:37Z","pushed_at":"2016-12-18T18:14:12Z","git_url":"git://github.com/MartinNowak/dlang-bot.git","ssh_url":"git@github.com:MartinNowak/dlang-bot.git","clone_url":"https://github.com/MartinNowak/dlang-bot.git","svn_url":"https://github.com/MartinNowak/dlang-bot","homepage":"https://dlang-bot.herokuapp.com/","size":69,"stargazers_count":3,"watchers_count":3,"language":"D","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MartinNowak/dlang-bot/pulls/15"},"html":{"href":"https://github.com/MartinNowak/dlang-bot/pull/15"},"issue":{"href":"https://api.github.com/repos/MartinNowak/dlang-bot/issues/15"},"comments":{"href":"https://api.github.com/repos/MartinNowak/dlang-bot/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/MartinNowak/dlang-bot/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/MartinNowak/dlang-bot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MartinNowak/dlang-bot/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/MartinNowak/dlang-bot/statuses/9733ee3dedd680085e036f1e161c0781c4744724"}}}}
{"actor":{"display_login":"MartinNowak"}}