{"action":"opened","number":19,"pull_request":{"url":"https://api.github.com/repos/Skyscanner/ground-control/pulls/19","id":87543311,"html_url":"https://github.com/Skyscanner/ground-control/pull/19","diff_url":"https://github.com/Skyscanner/ground-control/pull/19.diff","patch_url":"https://github.com/Skyscanner/ground-control/pull/19.patch","issue_url":"https://api.github.com/repos/Skyscanner/ground-control/issues/19","number":19,"state":"open","locked":false,"title":"refactor scheduler","user":{"login":"gnhenderson","id":10164868,"avatar_url":"https://avatars.githubusercontent.com/u/10164868?v=3","gravatar_id":"","url":"https://api.github.com/users/gnhenderson","html_url":"https://github.com/gnhenderson","followers_url":"https://api.github.com/users/gnhenderson/followers","following_url":"https://api.github.com/users/gnhenderson/following{/other_user}","gists_url":"https://api.github.com/users/gnhenderson/gists{/gist_id}","starred_url":"https://api.github.com/users/gnhenderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnhenderson/subscriptions","organizations_url":"https://api.github.com/users/gnhenderson/orgs","repos_url":"https://api.github.com/users/gnhenderson/repos","events_url":"https://api.github.com/users/gnhenderson/events{/privacy}","received_events_url":"https://api.github.com/users/gnhenderson/received_events","type":"User","site_admin":false},"body":"### Changes\r\n* Refactor of the scheduler to break the `run()` method into smaller methods.\r\n* Attempted to logically group _task_ operations and _load balancer_ operations to allow for future refactoring and feature implementation efforts.\r\n* Slight renaming of `flyby_` variables to more generic `loadbalancer_` or `_lb_` - did not attempt to rename everything at the moment.\r\n* Made an attempt to prevent the scheduler from \"blocking\" should an individual deployment fail as one failed deployment should not prevent the scheduler from servicing other deployments.\r\n* Attempted to update scheduler functionality to _skip_ any scaling actions if a deployment has load balancer config yet the scheduler could not successfully retrieve config from the load balancer. This is to protect running services from being scaled down and dropping traffic if for any reason the load balancer returns an unexpected response (the load balancer may still be sending traffic to a service and ground control may simply be unable to contact the load balancer service for any reason). It seemed safer to not make assumptions and leave a service in its current state in scenarios when a scaling request is made and the load balancer cannot be contacted or returns unexpected responses.\r\n\r\n### Testing\r\n* All existing tests pass following the refactor effort.\r\n* Couple of new tests added.\r\n* Could not live test against the staging Flyby endpoint as service currently unavailable.","created_at":"2016-09-30T18:31:26Z","updated_at":"2016-09-30T18:31:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Skyscanner/ground-control/pulls/19/commits","review_comments_url":"https://api.github.com/repos/Skyscanner/ground-control/pulls/19/comments","review_comment_url":"https://api.github.com/repos/Skyscanner/ground-control/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Skyscanner/ground-control/issues/19/comments","statuses_url":"https://api.github.com/repos/Skyscanner/ground-control/statuses/d833260a1acc99e0e5174d43b4b9f96f491868f9","head":{"label":"Skyscanner:no-block-scheduler","ref":"no-block-scheduler","sha":"d833260a1acc99e0e5174d43b4b9f96f491868f9","user":{"login":"Skyscanner","id":522811,"avatar_url":"https://avatars.githubusercontent.com/u/522811?v=3","gravatar_id":"","url":"https://api.github.com/users/Skyscanner","html_url":"https://github.com/Skyscanner","followers_url":"https://api.github.com/users/Skyscanner/followers","following_url":"https://api.github.com/users/Skyscanner/following{/other_user}","gists_url":"https://api.github.com/users/Skyscanner/gists{/gist_id}","starred_url":"https://api.github.com/users/Skyscanner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skyscanner/subscriptions","organizations_url":"https://api.github.com/users/Skyscanner/orgs","repos_url":"https://api.github.com/users/Skyscanner/repos","events_url":"https://api.github.com/users/Skyscanner/events{/privacy}","received_events_url":"https://api.github.com/users/Skyscanner/received_events","type":"Organization","site_admin":false},"repo":{"id":66544784,"name":"ground-control","full_name":"Skyscanner/ground-control","owner":{"login":"Skyscanner","id":522811,"avatar_url":"https://avatars.githubusercontent.com/u/522811?v=3","gravatar_id":"","url":"https://api.github.com/users/Skyscanner","html_url":"https://github.com/Skyscanner","followers_url":"https://api.github.com/users/Skyscanner/followers","following_url":"https://api.github.com/users/Skyscanner/following{/other_user}","gists_url":"https://api.github.com/users/Skyscanner/gists{/gist_id}","starred_url":"https://api.github.com/users/Skyscanner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skyscanner/subscriptions","organizations_url":"https://api.github.com/users/Skyscanner/orgs","repos_url":"https://api.github.com/users/Skyscanner/repos","events_url":"https://api.github.com/users/Skyscanner/events{/privacy}","received_events_url":"https://api.github.com/users/Skyscanner/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Skyscanner/ground-control","description":"The ECS Scheduler that controls the starting, stopping and restarting of containers","fork":false,"url":"https://api.github.com/repos/Skyscanner/ground-control","forks_url":"https://api.github.com/repos/Skyscanner/ground-control/forks","keys_url":"https://api.github.com/repos/Skyscanner/ground-control/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Skyscanner/ground-control/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Skyscanner/ground-control/teams","hooks_url":"https://api.github.com/repos/Skyscanner/ground-control/hooks","issue_events_url":"https://api.github.com/repos/Skyscanner/ground-control/issues/events{/number}","events_url":"https://api.github.com/repos/Skyscanner/ground-control/events","assignees_url":"https://api.github.com/repos/Skyscanner/ground-control/assignees{/user}","branches_url":"https://api.github.com/repos/Skyscanner/ground-control/branches{/branch}","tags_url":"https://api.github.com/repos/Skyscanner/ground-control/tags","blobs_url":"https://api.github.com/repos/Skyscanner/ground-control/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Skyscanner/ground-control/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Skyscanner/ground-control/git/refs{/sha}","trees_url":"https://api.github.com/repos/Skyscanner/ground-control/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Skyscanner/ground-control/statuses/{sha}","languages_url":"https://api.github.com/repos/Skyscanner/ground-control/languages","stargazers_url":"https://api.github.com/repos/Skyscanner/ground-control/stargazers","contributors_url":"https://api.github.com/repos/Skyscanner/ground-control/contributors","subscribers_url":"https://api.github.com/repos/Skyscanner/ground-control/subscribers","subscription_url":"https://api.github.com/repos/Skyscanner/ground-control/subscription","commits_url":"https://api.github.com/repos/Skyscanner/ground-control/commits{/sha}","git_commits_url":"https://api.github.com/repos/Skyscanner/ground-control/git/commits{/sha}","comments_url":"https://api.github.com/repos/Skyscanner/ground-control/comments{/number}","issue_comment_url":"https://api.github.com/repos/Skyscanner/ground-control/issues/comments{/number}","contents_url":"https://api.github.com/repos/Skyscanner/ground-control/contents/{+path}","compare_url":"https://api.github.com/repos/Skyscanner/ground-control/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Skyscanner/ground-control/merges","archive_url":"https://api.github.com/repos/Skyscanner/ground-control/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Skyscanner/ground-control/downloads","issues_url":"https://api.github.com/repos/Skyscanner/ground-control/issues{/number}","pulls_url":"https://api.github.com/repos/Skyscanner/ground-control/pulls{/number}","milestones_url":"https://api.github.com/repos/Skyscanner/ground-control/milestones{/number}","notifications_url":"https://api.github.com/repos/Skyscanner/ground-control/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Skyscanner/ground-control/labels{/name}","releases_url":"https://api.github.com/repos/Skyscanner/ground-control/releases{/id}","deployments_url":"https://api.github.com/repos/Skyscanner/ground-control/deployments","created_at":"2016-08-25T09:29:40Z","updated_at":"2016-09-23T12:54:21Z","pushed_at":"2016-09-30T18:31:26Z","git_url":"git://github.com/Skyscanner/ground-control.git","ssh_url":"git@github.com:Skyscanner/ground-control.git","clone_url":"https://github.com/Skyscanner/ground-control.git","svn_url":"https://github.com/Skyscanner/ground-control","homepage":null,"size":83,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":4,"default_branch":"master"}},"base":{"label":"Skyscanner:master","ref":"master","sha":"e09d19b5e06296ab52312db51af936d7b6d20641","user":{"login":"Skyscanner","id":522811,"avatar_url":"https://avatars.githubusercontent.com/u/522811?v=3","gravatar_id":"","url":"https://api.github.com/users/Skyscanner","html_url":"https://github.com/Skyscanner","followers_url":"https://api.github.com/users/Skyscanner/followers","following_url":"https://api.github.com/users/Skyscanner/following{/other_user}","gists_url":"https://api.github.com/users/Skyscanner/gists{/gist_id}","starred_url":"https://api.github.com/users/Skyscanner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skyscanner/subscriptions","organizations_url":"https://api.github.com/users/Skyscanner/orgs","repos_url":"https://api.github.com/users/Skyscanner/repos","events_url":"https://api.github.com/users/Skyscanner/events{/privacy}","received_events_url":"https://api.github.com/users/Skyscanner/received_events","type":"Organization","site_admin":false},"repo":{"id":66544784,"name":"ground-control","full_name":"Skyscanner/ground-control","owner":{"login":"Skyscanner","id":522811,"avatar_url":"https://avatars.githubusercontent.com/u/522811?v=3","gravatar_id":"","url":"https://api.github.com/users/Skyscanner","html_url":"https://github.com/Skyscanner","followers_url":"https://api.github.com/users/Skyscanner/followers","following_url":"https://api.github.com/users/Skyscanner/following{/other_user}","gists_url":"https://api.github.com/users/Skyscanner/gists{/gist_id}","starred_url":"https://api.github.com/users/Skyscanner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skyscanner/subscriptions","organizations_url":"https://api.github.com/users/Skyscanner/orgs","repos_url":"https://api.github.com/users/Skyscanner/repos","events_url":"https://api.github.com/users/Skyscanner/events{/privacy}","received_events_url":"https://api.github.com/users/Skyscanner/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Skyscanner/ground-control","description":"The ECS Scheduler that controls the starting, stopping and restarting of containers","fork":false,"url":"https://api.github.com/repos/Skyscanner/ground-control","forks_url":"https://api.github.com/repos/Skyscanner/ground-control/forks","keys_url":"https://api.github.com/repos/Skyscanner/ground-control/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Skyscanner/ground-control/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Skyscanner/ground-control/teams","hooks_url":"https://api.github.com/repos/Skyscanner/ground-control/hooks","issue_events_url":"https://api.github.com/repos/Skyscanner/ground-control/issues/events{/number}","events_url":"https://api.github.com/repos/Skyscanner/ground-control/events","assignees_url":"https://api.github.com/repos/Skyscanner/ground-control/assignees{/user}","branches_url":"https://api.github.com/repos/Skyscanner/ground-control/branches{/branch}","tags_url":"https://api.github.com/repos/Skyscanner/ground-control/tags","blobs_url":"https://api.github.com/repos/Skyscanner/ground-control/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Skyscanner/ground-control/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Skyscanner/ground-control/git/refs{/sha}","trees_url":"https://api.github.com/repos/Skyscanner/ground-control/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Skyscanner/ground-control/statuses/{sha}","languages_url":"https://api.github.com/repos/Skyscanner/ground-control/languages","stargazers_url":"https://api.github.com/repos/Skyscanner/ground-control/stargazers","contributors_url":"https://api.github.com/repos/Skyscanner/ground-control/contributors","subscribers_url":"https://api.github.com/repos/Skyscanner/ground-control/subscribers","subscription_url":"https://api.github.com/repos/Skyscanner/ground-control/subscription","commits_url":"https://api.github.com/repos/Skyscanner/ground-control/commits{/sha}","git_commits_url":"https://api.github.com/repos/Skyscanner/ground-control/git/commits{/sha}","comments_url":"https://api.github.com/repos/Skyscanner/ground-control/comments{/number}","issue_comment_url":"https://api.github.com/repos/Skyscanner/ground-control/issues/comments{/number}","contents_url":"https://api.github.com/repos/Skyscanner/ground-control/contents/{+path}","compare_url":"https://api.github.com/repos/Skyscanner/ground-control/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Skyscanner/ground-control/merges","archive_url":"https://api.github.com/repos/Skyscanner/ground-control/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Skyscanner/ground-control/downloads","issues_url":"https://api.github.com/repos/Skyscanner/ground-control/issues{/number}","pulls_url":"https://api.github.com/repos/Skyscanner/ground-control/pulls{/number}","milestones_url":"https://api.github.com/repos/Skyscanner/ground-control/milestones{/number}","notifications_url":"https://api.github.com/repos/Skyscanner/ground-control/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Skyscanner/ground-control/labels{/name}","releases_url":"https://api.github.com/repos/Skyscanner/ground-control/releases{/id}","deployments_url":"https://api.github.com/repos/Skyscanner/ground-control/deployments","created_at":"2016-08-25T09:29:40Z","updated_at":"2016-09-23T12:54:21Z","pushed_at":"2016-09-30T18:31:26Z","git_url":"git://github.com/Skyscanner/ground-control.git","ssh_url":"git@github.com:Skyscanner/ground-control.git","clone_url":"https://github.com/Skyscanner/ground-control.git","svn_url":"https://github.com/Skyscanner/ground-control","homepage":null,"size":83,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Skyscanner/ground-control/pulls/19"},"html":{"href":"https://github.com/Skyscanner/ground-control/pull/19"},"issue":{"href":"https://api.github.com/repos/Skyscanner/ground-control/issues/19"},"comments":{"href":"https://api.github.com/repos/Skyscanner/ground-control/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/Skyscanner/ground-control/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/Skyscanner/ground-control/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Skyscanner/ground-control/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/Skyscanner/ground-control/statuses/d833260a1acc99e0e5174d43b4b9f96f491868f9"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":279,"deletions":131,"changed_files":2}}
{"actor":{"display_login":"gnhenderson"}}