{"action":"created","comment":{"url":"https://api.github.com/repos/Nextdoor/kingpin/pulls/comments/71193474","id":71193474,"diff_hunk":"@@ -422,31 +798,126 @@ def _get_containers_from_tasks(task_list):\n                 }\n             ]\n \n-    Returns: All containers as a flat list.\n-\n+    Returns:\n+        All containers as a flat list.\n     \"\"\"\n     containers = []\n     for task_overview in task_list:\n         containers.extend(task_overview['containers'])\n     return containers\n \n \n-def _load_task_definition(task_definition_file, parameters):\n+def _load_task_definition(task_definition_file, tokens):\n     \"\"\"Loads and verifies a task definition template file, and interpolates\n-    parameters.\n+    tokens.\n \n     Args:\n         task_definition_file: task definition file to load.\n-        parameters: dict of key/value pairs to interpolate into the file.\n+        tokens: dict of key/value pairs to interpolate into the file.\n \n     Returns:\n-        Parsed and interpolated task definition dict.\n+        Resulting task definition dict.\n     \"\"\"\n-    task_definition_file = utils.convert_script_to_dict(\n-        task_definition_file, parameters)\n+    task_definition = utils.convert_script_to_dict(\n+        task_definition_file, tokens)\n     try:\n-        jsonschema.validate(task_definition_file,\n+        jsonschema.validate(task_definition,\n                             TASK_DEFINITION_SCHEMA)\n     except jsonschema.exceptions.ValidationError as e:\n         raise exceptions.InvalidOptions(e)\n-    return task_definition_file\n+    return task_definition\n+\n+\n+def _load_service_definition(service_definition_file, tokens):\n+    \"\"\"Loads and verifies a service definition template file, and interpolates\n+    tokens. The service definition template file can be None.\n+\n+    Args:\n+        service_definition_file: service definition file to load.\n+            If None, this returns only defaults.\n+        tokens: dict of key/value pairs to interpolate into the file.\n+\n+    Returns:\n+        Resulting service definition dict.\n+    \"\"\"\n+    if service_definition_file is None:\n+        service_definition = {}\n+    else:\n+        service_definition = utils.convert_script_to_dict(\n+            service_definition_file, tokens)\n+        try:\n+            jsonschema.validate(service_definition,\n+                                SERVICE_DEFINITION_SCHEMA)\n+\n+        except jsonschema.exceptions.ValidationError as e:\n+            raise exceptions.InvalidOptions(e)\n+\n+    # Set default values.\n+    service_definition.setdefault(\n+        'loadBalancers', [])\n+    service_definition.setdefault(\n+        'deploymentConfiguration', {})\n+    return service_definition\n+\n+\n+def _get_immutable_field_errors(old_params, new_params, immutable_fields):\n+    \"\"\"Compares two dicts of params to ensure that all of the specified\n+    immutable fields are the same between them.\n+\n+    Args:\n+        old_params: old parameters to use.\n+        new_params: new parameters to compare with.\n+        immutable_fields: list of immutable fields.\n+\n+    Returns:\n+        A list of error descriptions, or None.\n+    \"\"\"\n+    errors = []\n+    for immutable_field_name in immutable_fields:\n+        new_field = new_params.get(immutable_field_name, None)\n+        old_field = old_params.get(immutable_field_name, None)\n+\n+        if new_field != old_field:\n+            errors.append(\n+                \"Field \\'{field}\\' cannot be updated.\\n\"\n+                'Old value: {old}\\n'\n+                'New value: {new}'.format(\n+                    field=immutable_field_name,\n+                    old=old_field,\n+                    new=new_field))\n+\n+    return errors\n+\n+\n+def _get_sorted_new_log_events(events, start_timestamp, seen_events):","path":"kingpin/actors/aws/ecs.py","position":665,"original_position":665,"commit_id":"c8ad2fe1e50668e3f72d44d0fc2eeae932e78a20","original_commit_id":"c8ad2fe1e50668e3f72d44d0fc2eeae932e78a20","user":{"login":"swaggy","id":2256129,"avatar_url":"https://avatars.githubusercontent.com/u/2256129?v=3","gravatar_id":"","url":"https://api.github.com/users/swaggy","html_url":"https://github.com/swaggy","followers_url":"https://api.github.com/users/swaggy/followers","following_url":"https://api.github.com/users/swaggy/following{/other_user}","gists_url":"https://api.github.com/users/swaggy/gists{/gist_id}","starred_url":"https://api.github.com/users/swaggy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swaggy/subscriptions","organizations_url":"https://api.github.com/users/swaggy/orgs","repos_url":"https://api.github.com/users/swaggy/repos","events_url":"https://api.github.com/users/swaggy/events{/privacy}","received_events_url":"https://api.github.com/users/swaggy/received_events","type":"User","site_admin":false},"body":"Yeah it's great. 💩 ","created_at":"2016-07-18T17:42:38Z","updated_at":"2016-07-18T17:42:38Z","html_url":"https://github.com/Nextdoor/kingpin/pull/385#discussion_r71193474","pull_request_url":"https://api.github.com/repos/Nextdoor/kingpin/pulls/385","_links":{"self":{"href":"https://api.github.com/repos/Nextdoor/kingpin/pulls/comments/71193474"},"html":{"href":"https://github.com/Nextdoor/kingpin/pull/385#discussion_r71193474"},"pull_request":{"href":"https://api.github.com/repos/Nextdoor/kingpin/pulls/385"}}},"pull_request":{"url":"https://api.github.com/repos/Nextdoor/kingpin/pulls/385","id":77331511,"html_url":"https://github.com/Nextdoor/kingpin/pull/385","diff_url":"https://github.com/Nextdoor/kingpin/pull/385.diff","patch_url":"https://github.com/Nextdoor/kingpin/pull/385.patch","issue_url":"https://api.github.com/repos/Nextdoor/kingpin/issues/385","number":385,"state":"open","locked":false,"title":"Add ecs service actor.","user":{"login":"swaggy","id":2256129,"avatar_url":"https://avatars.githubusercontent.com/u/2256129?v=3","gravatar_id":"","url":"https://api.github.com/users/swaggy","html_url":"https://github.com/swaggy","followers_url":"https://api.github.com/users/swaggy/followers","following_url":"https://api.github.com/users/swaggy/following{/other_user}","gists_url":"https://api.github.com/users/swaggy/gists{/gist_id}","starred_url":"https://api.github.com/users/swaggy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swaggy/subscriptions","organizations_url":"https://api.github.com/users/swaggy/orgs","repos_url":"https://api.github.com/users/swaggy/repos","events_url":"https://api.github.com/users/swaggy/events{/privacy}","received_events_url":"https://api.github.com/users/swaggy/received_events","type":"User","site_admin":false},"body":"Add ECS service actor. Still working on unit tests, then integration tests.\r\n\r\n@mikhail @diranged ","created_at":"2016-07-13T17:45:26Z","updated_at":"2016-07-18T17:42:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7ebbf66b3925bb16212e7f0ffe42f4d74985eedb","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Nextdoor/kingpin/pulls/385/commits","review_comments_url":"https://api.github.com/repos/Nextdoor/kingpin/pulls/385/comments","review_comment_url":"https://api.github.com/repos/Nextdoor/kingpin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Nextdoor/kingpin/issues/385/comments","statuses_url":"https://api.github.com/repos/Nextdoor/kingpin/statuses/c8ad2fe1e50668e3f72d44d0fc2eeae932e78a20","head":{"label":"Nextdoor:add_ecs_service_actor","ref":"add_ecs_service_actor","sha":"c8ad2fe1e50668e3f72d44d0fc2eeae932e78a20","user":{"login":"Nextdoor","id":605176,"avatar_url":"https://avatars.githubusercontent.com/u/605176?v=3","gravatar_id":"","url":"https://api.github.com/users/Nextdoor","html_url":"https://github.com/Nextdoor","followers_url":"https://api.github.com/users/Nextdoor/followers","following_url":"https://api.github.com/users/Nextdoor/following{/other_user}","gists_url":"https://api.github.com/users/Nextdoor/gists{/gist_id}","starred_url":"https://api.github.com/users/Nextdoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nextdoor/subscriptions","organizations_url":"https://api.github.com/users/Nextdoor/orgs","repos_url":"https://api.github.com/users/Nextdoor/repos","events_url":"https://api.github.com/users/Nextdoor/events{/privacy}","received_events_url":"https://api.github.com/users/Nextdoor/received_events","type":"Organization","site_admin":false},"repo":{"id":22902460,"name":"kingpin","full_name":"Nextdoor/kingpin","owner":{"login":"Nextdoor","id":605176,"avatar_url":"https://avatars.githubusercontent.com/u/605176?v=3","gravatar_id":"","url":"https://api.github.com/users/Nextdoor","html_url":"https://github.com/Nextdoor","followers_url":"https://api.github.com/users/Nextdoor/followers","following_url":"https://api.github.com/users/Nextdoor/following{/other_user}","gists_url":"https://api.github.com/users/Nextdoor/gists{/gist_id}","starred_url":"https://api.github.com/users/Nextdoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nextdoor/subscriptions","organizations_url":"https://api.github.com/users/Nextdoor/orgs","repos_url":"https://api.github.com/users/Nextdoor/repos","events_url":"https://api.github.com/users/Nextdoor/events{/privacy}","received_events_url":"https://api.github.com/users/Nextdoor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Nextdoor/kingpin","description":"Deployment Automation Engine","fork":false,"url":"https://api.github.com/repos/Nextdoor/kingpin","forks_url":"https://api.github.com/repos/Nextdoor/kingpin/forks","keys_url":"https://api.github.com/repos/Nextdoor/kingpin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nextdoor/kingpin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nextdoor/kingpin/teams","hooks_url":"https://api.github.com/repos/Nextdoor/kingpin/hooks","issue_events_url":"https://api.github.com/repos/Nextdoor/kingpin/issues/events{/number}","events_url":"https://api.github.com/repos/Nextdoor/kingpin/events","assignees_url":"https://api.github.com/repos/Nextdoor/kingpin/assignees{/user}","branches_url":"https://api.github.com/repos/Nextdoor/kingpin/branches{/branch}","tags_url":"https://api.github.com/repos/Nextdoor/kingpin/tags","blobs_url":"https://api.github.com/repos/Nextdoor/kingpin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nextdoor/kingpin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nextdoor/kingpin/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nextdoor/kingpin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nextdoor/kingpin/statuses/{sha}","languages_url":"https://api.github.com/repos/Nextdoor/kingpin/languages","stargazers_url":"https://api.github.com/repos/Nextdoor/kingpin/stargazers","contributors_url":"https://api.github.com/repos/Nextdoor/kingpin/contributors","subscribers_url":"https://api.github.com/repos/Nextdoor/kingpin/subscribers","subscription_url":"https://api.github.com/repos/Nextdoor/kingpin/subscription","commits_url":"https://api.github.com/repos/Nextdoor/kingpin/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nextdoor/kingpin/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nextdoor/kingpin/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nextdoor/kingpin/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nextdoor/kingpin/contents/{+path}","compare_url":"https://api.github.com/repos/Nextdoor/kingpin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nextdoor/kingpin/merges","archive_url":"https://api.github.com/repos/Nextdoor/kingpin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nextdoor/kingpin/downloads","issues_url":"https://api.github.com/repos/Nextdoor/kingpin/issues{/number}","pulls_url":"https://api.github.com/repos/Nextdoor/kingpin/pulls{/number}","milestones_url":"https://api.github.com/repos/Nextdoor/kingpin/milestones{/number}","notifications_url":"https://api.github.com/repos/Nextdoor/kingpin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nextdoor/kingpin/labels{/name}","releases_url":"https://api.github.com/repos/Nextdoor/kingpin/releases{/id}","deployments_url":"https://api.github.com/repos/Nextdoor/kingpin/deployments","created_at":"2014-08-13T04:23:40Z","updated_at":"2016-05-17T23:39:53Z","pushed_at":"2016-07-18T06:14:24Z","git_url":"git://github.com/Nextdoor/kingpin.git","ssh_url":"git@github.com:Nextdoor/kingpin.git","clone_url":"https://github.com/Nextdoor/kingpin.git","svn_url":"https://github.com/Nextdoor/kingpin","homepage":"","size":1370,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":35,"forks":4,"open_issues":35,"watchers":8,"default_branch":"master"}},"base":{"label":"Nextdoor:master","ref":"master","sha":"75e7826946d624f811337de4a11a53c0939605ab","user":{"login":"Nextdoor","id":605176,"avatar_url":"https://avatars.githubusercontent.com/u/605176?v=3","gravatar_id":"","url":"https://api.github.com/users/Nextdoor","html_url":"https://github.com/Nextdoor","followers_url":"https://api.github.com/users/Nextdoor/followers","following_url":"https://api.github.com/users/Nextdoor/following{/other_user}","gists_url":"https://api.github.com/users/Nextdoor/gists{/gist_id}","starred_url":"https://api.github.com/users/Nextdoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nextdoor/subscriptions","organizations_url":"https://api.github.com/users/Nextdoor/orgs","repos_url":"https://api.github.com/users/Nextdoor/repos","events_url":"https://api.github.com/users/Nextdoor/events{/privacy}","received_events_url":"https://api.github.com/users/Nextdoor/received_events","type":"Organization","site_admin":false},"repo":{"id":22902460,"name":"kingpin","full_name":"Nextdoor/kingpin","owner":{"login":"Nextdoor","id":605176,"avatar_url":"https://avatars.githubusercontent.com/u/605176?v=3","gravatar_id":"","url":"https://api.github.com/users/Nextdoor","html_url":"https://github.com/Nextdoor","followers_url":"https://api.github.com/users/Nextdoor/followers","following_url":"https://api.github.com/users/Nextdoor/following{/other_user}","gists_url":"https://api.github.com/users/Nextdoor/gists{/gist_id}","starred_url":"https://api.github.com/users/Nextdoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nextdoor/subscriptions","organizations_url":"https://api.github.com/users/Nextdoor/orgs","repos_url":"https://api.github.com/users/Nextdoor/repos","events_url":"https://api.github.com/users/Nextdoor/events{/privacy}","received_events_url":"https://api.github.com/users/Nextdoor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Nextdoor/kingpin","description":"Deployment Automation Engine","fork":false,"url":"https://api.github.com/repos/Nextdoor/kingpin","forks_url":"https://api.github.com/repos/Nextdoor/kingpin/forks","keys_url":"https://api.github.com/repos/Nextdoor/kingpin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nextdoor/kingpin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nextdoor/kingpin/teams","hooks_url":"https://api.github.com/repos/Nextdoor/kingpin/hooks","issue_events_url":"https://api.github.com/repos/Nextdoor/kingpin/issues/events{/number}","events_url":"https://api.github.com/repos/Nextdoor/kingpin/events","assignees_url":"https://api.github.com/repos/Nextdoor/kingpin/assignees{/user}","branches_url":"https://api.github.com/repos/Nextdoor/kingpin/branches{/branch}","tags_url":"https://api.github.com/repos/Nextdoor/kingpin/tags","blobs_url":"https://api.github.com/repos/Nextdoor/kingpin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nextdoor/kingpin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nextdoor/kingpin/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nextdoor/kingpin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nextdoor/kingpin/statuses/{sha}","languages_url":"https://api.github.com/repos/Nextdoor/kingpin/languages","stargazers_url":"https://api.github.com/repos/Nextdoor/kingpin/stargazers","contributors_url":"https://api.github.com/repos/Nextdoor/kingpin/contributors","subscribers_url":"https://api.github.com/repos/Nextdoor/kingpin/subscribers","subscription_url":"https://api.github.com/repos/Nextdoor/kingpin/subscription","commits_url":"https://api.github.com/repos/Nextdoor/kingpin/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nextdoor/kingpin/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nextdoor/kingpin/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nextdoor/kingpin/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nextdoor/kingpin/contents/{+path}","compare_url":"https://api.github.com/repos/Nextdoor/kingpin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nextdoor/kingpin/merges","archive_url":"https://api.github.com/repos/Nextdoor/kingpin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nextdoor/kingpin/downloads","issues_url":"https://api.github.com/repos/Nextdoor/kingpin/issues{/number}","pulls_url":"https://api.github.com/repos/Nextdoor/kingpin/pulls{/number}","milestones_url":"https://api.github.com/repos/Nextdoor/kingpin/milestones{/number}","notifications_url":"https://api.github.com/repos/Nextdoor/kingpin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nextdoor/kingpin/labels{/name}","releases_url":"https://api.github.com/repos/Nextdoor/kingpin/releases{/id}","deployments_url":"https://api.github.com/repos/Nextdoor/kingpin/deployments","created_at":"2014-08-13T04:23:40Z","updated_at":"2016-05-17T23:39:53Z","pushed_at":"2016-07-18T06:14:24Z","git_url":"git://github.com/Nextdoor/kingpin.git","ssh_url":"git@github.com:Nextdoor/kingpin.git","clone_url":"https://github.com/Nextdoor/kingpin.git","svn_url":"https://github.com/Nextdoor/kingpin","homepage":"","size":1370,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":35,"forks":4,"open_issues":35,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Nextdoor/kingpin/pulls/385"},"html":{"href":"https://github.com/Nextdoor/kingpin/pull/385"},"issue":{"href":"https://api.github.com/repos/Nextdoor/kingpin/issues/385"},"comments":{"href":"https://api.github.com/repos/Nextdoor/kingpin/issues/385/comments"},"review_comments":{"href":"https://api.github.com/repos/Nextdoor/kingpin/pulls/385/comments"},"review_comment":{"href":"https://api.github.com/repos/Nextdoor/kingpin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Nextdoor/kingpin/pulls/385/commits"},"statuses":{"href":"https://api.github.com/repos/Nextdoor/kingpin/statuses/c8ad2fe1e50668e3f72d44d0fc2eeae932e78a20"}}}}
{"actor":{"display_login":"swaggy"}}