{"action":"created","comment":{"url":"https://api.github.com/repos/openfun/arnold/pulls/comments/201584906","pull_request_review_id":136110786,"id":201584906,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMTU4NDkwNg==","diff_hunk":"@@ -5,41 +5,59 @@\n from copy import deepcopy\n \n from ansible.errors import AnsibleFilterError\n-from deepmerge import always_merger\n \n \n def merge_with_app(base, new):\n     \"\"\"Merge data from the \"new\" application to the \"base\" application\"\"\"\n \n     if not isinstance(base, dict) or not isinstance(new, dict):\n-        raise AnsibleFilterError(\"input apps definitions should be 'dict' types\")\n+        raise AnsibleFilterError(\n+            \"input apps definitions should be 'dict' types\"\n+        )\n \n     if base.get(\"name\") is None or new.get(\"name\") is None:\n-        raise AnsibleFilterError(\"input apps should have a name key\")\n+        raise AnsibleFilterError(\"input apps should have a 'name' key\")\n \n     if base[\"name\"] != new[\"name\"]:\n         raise AnsibleFilterError(\"input apps should have the same name\")\n \n+    if not base[\"name\"]:\n+        raise AnsibleFilterError(\"input apps name cannot be empty\")\n+\n     result = deepcopy(base)\n \n     # Add or override services metadata\n-    for service in result[\"services\"]:\n-        new_app_selected_services = filter(\n-            lambda s: s.get(\"name\") == service.get(\"name\"), new[\"services\"]\n-        )\n+    for base_service in result[\"services\"]:\n+        new_app_selected_services = [\n+            s\n+            for s in new[\"services\"]\n+            if s.get(\"name\") == base_service.get(\"name\")\n+        ]","path":"plugins/filter/merge.py","position":38,"original_position":38,"commit_id":"505040f90eb7a2a1169a909650ec11e98221592a","original_commit_id":"505040f90eb7a2a1169a909650ec11e98221592a","user":{"login":"sampaccoud","id":1427165,"node_id":"MDQ6VXNlcjE0MjcxNjU=","avatar_url":"https://avatars3.githubusercontent.com/u/1427165?v=4","gravatar_id":"","url":"https://api.github.com/users/sampaccoud","html_url":"https://github.com/sampaccoud","followers_url":"https://api.github.com/users/sampaccoud/followers","following_url":"https://api.github.com/users/sampaccoud/following{/other_user}","gists_url":"https://api.github.com/users/sampaccoud/gists{/gist_id}","starred_url":"https://api.github.com/users/sampaccoud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sampaccoud/subscriptions","organizations_url":"https://api.github.com/users/sampaccoud/orgs","repos_url":"https://api.github.com/users/sampaccoud/repos","events_url":"https://api.github.com/users/sampaccoud/events{/privacy}","received_events_url":"https://api.github.com/users/sampaccoud/received_events","type":"User","site_admin":false},"body":"why did you switch from filter to list comprehension?","created_at":"2018-07-11T07:11:22Z","updated_at":"2018-07-11T07:30:36Z","html_url":"https://github.com/openfun/arnold/pull/76#discussion_r201584906","pull_request_url":"https://api.github.com/repos/openfun/arnold/pulls/76","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/openfun/arnold/pulls/comments/201584906"},"html":{"href":"https://github.com/openfun/arnold/pull/76#discussion_r201584906"},"pull_request":{"href":"https://api.github.com/repos/openfun/arnold/pulls/76"}}},"pull_request":{"url":"https://api.github.com/repos/openfun/arnold/pulls/76","id":199768257,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5NzY4MjU3","html_url":"https://github.com/openfun/arnold/pull/76","diff_url":"https://github.com/openfun/arnold/pull/76.diff","patch_url":"https://github.com/openfun/arnold/pull/76.patch","issue_url":"https://api.github.com/repos/openfun/arnold/issues/76","number":76,"state":"open","locked":false,"title":"Refactor plugins","user":{"login":"jmaupetit","id":956157,"node_id":"MDQ6VXNlcjk1NjE1Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/956157?v=4","gravatar_id":"","url":"https://api.github.com/users/jmaupetit","html_url":"https://github.com/jmaupetit","followers_url":"https://api.github.com/users/jmaupetit/followers","following_url":"https://api.github.com/users/jmaupetit/following{/other_user}","gists_url":"https://api.github.com/users/jmaupetit/gists{/gist_id}","starred_url":"https://api.github.com/users/jmaupetit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmaupetit/subscriptions","organizations_url":"https://api.github.com/users/jmaupetit/orgs","repos_url":"https://api.github.com/users/jmaupetit/repos","events_url":"https://api.github.com/users/jmaupetit/events{/privacy}","received_events_url":"https://api.github.com/users/jmaupetit/received_events","type":"User","site_admin":false},"body":"## Purpose\r\n\r\nCurrent \"plugins\" implementation is far from academic. We should follow Ansible's recommendations to improve them.\r\n\r\n## Proposal\r\n\r\n- [x] Switch the app lookup call to a real lookup plugin\r\n- [x] Fix merge filter implementation (remove `deepmerge` and make our own)\r\n- [x] Add tests for plugins\r\n- [x] Automate tests execution in the CI\r\n- [x] Add python code linters (pylint, flake8, isort)\r\n","created_at":"2018-07-06T14:45:06Z","updated_at":"2018-07-11T07:30:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e11eb08ef38527546fa53015760eb4f04252f2e4","assignee":{"login":"jmaupetit","id":956157,"node_id":"MDQ6VXNlcjk1NjE1Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/956157?v=4","gravatar_id":"","url":"https://api.github.com/users/jmaupetit","html_url":"https://github.com/jmaupetit","followers_url":"https://api.github.com/users/jmaupetit/followers","following_url":"https://api.github.com/users/jmaupetit/following{/other_user}","gists_url":"https://api.github.com/users/jmaupetit/gists{/gist_id}","starred_url":"https://api.github.com/users/jmaupetit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmaupetit/subscriptions","organizations_url":"https://api.github.com/users/jmaupetit/orgs","repos_url":"https://api.github.com/users/jmaupetit/repos","events_url":"https://api.github.com/users/jmaupetit/events{/privacy}","received_events_url":"https://api.github.com/users/jmaupetit/received_events","type":"User","site_admin":false},"assignees":[{"login":"jmaupetit","id":956157,"node_id":"MDQ6VXNlcjk1NjE1Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/956157?v=4","gravatar_id":"","url":"https://api.github.com/users/jmaupetit","html_url":"https://github.com/jmaupetit","followers_url":"https://api.github.com/users/jmaupetit/followers","following_url":"https://api.github.com/users/jmaupetit/following{/other_user}","gists_url":"https://api.github.com/users/jmaupetit/gists{/gist_id}","starred_url":"https://api.github.com/users/jmaupetit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmaupetit/subscriptions","organizations_url":"https://api.github.com/users/jmaupetit/orgs","repos_url":"https://api.github.com/users/jmaupetit/repos","events_url":"https://api.github.com/users/jmaupetit/events{/privacy}","received_events_url":"https://api.github.com/users/jmaupetit/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"cchaudier","id":2980075,"node_id":"MDQ6VXNlcjI5ODAwNzU=","avatar_url":"https://avatars0.githubusercontent.com/u/2980075?v=4","gravatar_id":"","url":"https://api.github.com/users/cchaudier","html_url":"https://github.com/cchaudier","followers_url":"https://api.github.com/users/cchaudier/followers","following_url":"https://api.github.com/users/cchaudier/following{/other_user}","gists_url":"https://api.github.com/users/cchaudier/gists{/gist_id}","starred_url":"https://api.github.com/users/cchaudier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cchaudier/subscriptions","organizations_url":"https://api.github.com/users/cchaudier/orgs","repos_url":"https://api.github.com/users/cchaudier/repos","events_url":"https://api.github.com/users/cchaudier/events{/privacy}","received_events_url":"https://api.github.com/users/cchaudier/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":942035861,"node_id":"MDU6TGFiZWw5NDIwMzU4NjE=","url":"https://api.github.com/repos/openfun/arnold/labels/feature","name":"feature","color":"0052cc","default":false},{"id":942035865,"node_id":"MDU6TGFiZWw5NDIwMzU4NjU=","url":"https://api.github.com/repos/openfun/arnold/labels/needs%20review","name":"needs review","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/openfun/arnold/pulls/76/commits","review_comments_url":"https://api.github.com/repos/openfun/arnold/pulls/76/comments","review_comment_url":"https://api.github.com/repos/openfun/arnold/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openfun/arnold/issues/76/comments","statuses_url":"https://api.github.com/repos/openfun/arnold/statuses/505040f90eb7a2a1169a909650ec11e98221592a","head":{"label":"openfun:refactor-plugins","ref":"refactor-plugins","sha":"505040f90eb7a2a1169a909650ec11e98221592a","user":{"login":"openfun","id":7224891,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcyMjQ4OTE=","avatar_url":"https://avatars2.githubusercontent.com/u/7224891?v=4","gravatar_id":"","url":"https://api.github.com/users/openfun","html_url":"https://github.com/openfun","followers_url":"https://api.github.com/users/openfun/followers","following_url":"https://api.github.com/users/openfun/following{/other_user}","gists_url":"https://api.github.com/users/openfun/gists{/gist_id}","starred_url":"https://api.github.com/users/openfun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openfun/subscriptions","organizations_url":"https://api.github.com/users/openfun/orgs","repos_url":"https://api.github.com/users/openfun/repos","events_url":"https://api.github.com/users/openfun/events{/privacy}","received_events_url":"https://api.github.com/users/openfun/received_events","type":"Organization","site_admin":false},"repo":{"id":133722058,"node_id":"MDEwOlJlcG9zaXRvcnkxMzM3MjIwNTg=","name":"arnold","full_name":"openfun/arnold","owner":{"login":"openfun","id":7224891,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcyMjQ4OTE=","avatar_url":"https://avatars2.githubusercontent.com/u/7224891?v=4","gravatar_id":"","url":"https://api.github.com/users/openfun","html_url":"https://github.com/openfun","followers_url":"https://api.github.com/users/openfun/followers","following_url":"https://api.github.com/users/openfun/following{/other_user}","gists_url":"https://api.github.com/users/openfun/gists{/gist_id}","starred_url":"https://api.github.com/users/openfun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openfun/subscriptions","organizations_url":"https://api.github.com/users/openfun/orgs","repos_url":"https://api.github.com/users/openfun/repos","events_url":"https://api.github.com/users/openfun/events{/privacy}","received_events_url":"https://api.github.com/users/openfun/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openfun/arnold","description":":octopus: A FUN way to deploy dockerized applications to OpenShift with Ansible","fork":false,"url":"https://api.github.com/repos/openfun/arnold","forks_url":"https://api.github.com/repos/openfun/arnold/forks","keys_url":"https://api.github.com/repos/openfun/arnold/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openfun/arnold/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openfun/arnold/teams","hooks_url":"https://api.github.com/repos/openfun/arnold/hooks","issue_events_url":"https://api.github.com/repos/openfun/arnold/issues/events{/number}","events_url":"https://api.github.com/repos/openfun/arnold/events","assignees_url":"https://api.github.com/repos/openfun/arnold/assignees{/user}","branches_url":"https://api.github.com/repos/openfun/arnold/branches{/branch}","tags_url":"https://api.github.com/repos/openfun/arnold/tags","blobs_url":"https://api.github.com/repos/openfun/arnold/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openfun/arnold/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openfun/arnold/git/refs{/sha}","trees_url":"https://api.github.com/repos/openfun/arnold/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openfun/arnold/statuses/{sha}","languages_url":"https://api.github.com/repos/openfun/arnold/languages","stargazers_url":"https://api.github.com/repos/openfun/arnold/stargazers","contributors_url":"https://api.github.com/repos/openfun/arnold/contributors","subscribers_url":"https://api.github.com/repos/openfun/arnold/subscribers","subscription_url":"https://api.github.com/repos/openfun/arnold/subscription","commits_url":"https://api.github.com/repos/openfun/arnold/commits{/sha}","git_commits_url":"https://api.github.com/repos/openfun/arnold/git/commits{/sha}","comments_url":"https://api.github.com/repos/openfun/arnold/comments{/number}","issue_comment_url":"https://api.github.com/repos/openfun/arnold/issues/comments{/number}","contents_url":"https://api.github.com/repos/openfun/arnold/contents/{+path}","compare_url":"https://api.github.com/repos/openfun/arnold/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openfun/arnold/merges","archive_url":"https://api.github.com/repos/openfun/arnold/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openfun/arnold/downloads","issues_url":"https://api.github.com/repos/openfun/arnold/issues{/number}","pulls_url":"https://api.github.com/repos/openfun/arnold/pulls{/number}","milestones_url":"https://api.github.com/repos/openfun/arnold/milestones{/number}","notifications_url":"https://api.github.com/repos/openfun/arnold/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openfun/arnold/labels{/name}","releases_url":"https://api.github.com/repos/openfun/arnold/releases{/id}","deployments_url":"https://api.github.com/repos/openfun/arnold/deployments","created_at":"2018-05-16T20:56:15Z","updated_at":"2018-07-02T12:05:17Z","pushed_at":"2018-07-10T20:20:45Z","git_url":"git://github.com/openfun/arnold.git","ssh_url":"git@github.com:openfun/arnold.git","clone_url":"https://github.com/openfun/arnold.git","svn_url":"https://github.com/openfun/arnold","homepage":"","size":361,"stargazers_count":10,"watchers_count":10,"language":"Shell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":30,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":30,"watchers":10,"default_branch":"master"}},"base":{"label":"openfun:master","ref":"master","sha":"14fb1c02222a5470dd9b528a096b0be2f164cffd","user":{"login":"openfun","id":7224891,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcyMjQ4OTE=","avatar_url":"https://avatars2.githubusercontent.com/u/7224891?v=4","gravatar_id":"","url":"https://api.github.com/users/openfun","html_url":"https://github.com/openfun","followers_url":"https://api.github.com/users/openfun/followers","following_url":"https://api.github.com/users/openfun/following{/other_user}","gists_url":"https://api.github.com/users/openfun/gists{/gist_id}","starred_url":"https://api.github.com/users/openfun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openfun/subscriptions","organizations_url":"https://api.github.com/users/openfun/orgs","repos_url":"https://api.github.com/users/openfun/repos","events_url":"https://api.github.com/users/openfun/events{/privacy}","received_events_url":"https://api.github.com/users/openfun/received_events","type":"Organization","site_admin":false},"repo":{"id":133722058,"node_id":"MDEwOlJlcG9zaXRvcnkxMzM3MjIwNTg=","name":"arnold","full_name":"openfun/arnold","owner":{"login":"openfun","id":7224891,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcyMjQ4OTE=","avatar_url":"https://avatars2.githubusercontent.com/u/7224891?v=4","gravatar_id":"","url":"https://api.github.com/users/openfun","html_url":"https://github.com/openfun","followers_url":"https://api.github.com/users/openfun/followers","following_url":"https://api.github.com/users/openfun/following{/other_user}","gists_url":"https://api.github.com/users/openfun/gists{/gist_id}","starred_url":"https://api.github.com/users/openfun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openfun/subscriptions","organizations_url":"https://api.github.com/users/openfun/orgs","repos_url":"https://api.github.com/users/openfun/repos","events_url":"https://api.github.com/users/openfun/events{/privacy}","received_events_url":"https://api.github.com/users/openfun/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openfun/arnold","description":":octopus: A FUN way to deploy dockerized applications to OpenShift with Ansible","fork":false,"url":"https://api.github.com/repos/openfun/arnold","forks_url":"https://api.github.com/repos/openfun/arnold/forks","keys_url":"https://api.github.com/repos/openfun/arnold/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openfun/arnold/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openfun/arnold/teams","hooks_url":"https://api.github.com/repos/openfun/arnold/hooks","issue_events_url":"https://api.github.com/repos/openfun/arnold/issues/events{/number}","events_url":"https://api.github.com/repos/openfun/arnold/events","assignees_url":"https://api.github.com/repos/openfun/arnold/assignees{/user}","branches_url":"https://api.github.com/repos/openfun/arnold/branches{/branch}","tags_url":"https://api.github.com/repos/openfun/arnold/tags","blobs_url":"https://api.github.com/repos/openfun/arnold/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openfun/arnold/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openfun/arnold/git/refs{/sha}","trees_url":"https://api.github.com/repos/openfun/arnold/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openfun/arnold/statuses/{sha}","languages_url":"https://api.github.com/repos/openfun/arnold/languages","stargazers_url":"https://api.github.com/repos/openfun/arnold/stargazers","contributors_url":"https://api.github.com/repos/openfun/arnold/contributors","subscribers_url":"https://api.github.com/repos/openfun/arnold/subscribers","subscription_url":"https://api.github.com/repos/openfun/arnold/subscription","commits_url":"https://api.github.com/repos/openfun/arnold/commits{/sha}","git_commits_url":"https://api.github.com/repos/openfun/arnold/git/commits{/sha}","comments_url":"https://api.github.com/repos/openfun/arnold/comments{/number}","issue_comment_url":"https://api.github.com/repos/openfun/arnold/issues/comments{/number}","contents_url":"https://api.github.com/repos/openfun/arnold/contents/{+path}","compare_url":"https://api.github.com/repos/openfun/arnold/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openfun/arnold/merges","archive_url":"https://api.github.com/repos/openfun/arnold/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openfun/arnold/downloads","issues_url":"https://api.github.com/repos/openfun/arnold/issues{/number}","pulls_url":"https://api.github.com/repos/openfun/arnold/pulls{/number}","milestones_url":"https://api.github.com/repos/openfun/arnold/milestones{/number}","notifications_url":"https://api.github.com/repos/openfun/arnold/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openfun/arnold/labels{/name}","releases_url":"https://api.github.com/repos/openfun/arnold/releases{/id}","deployments_url":"https://api.github.com/repos/openfun/arnold/deployments","created_at":"2018-05-16T20:56:15Z","updated_at":"2018-07-02T12:05:17Z","pushed_at":"2018-07-10T20:20:45Z","git_url":"git://github.com/openfun/arnold.git","ssh_url":"git@github.com:openfun/arnold.git","clone_url":"https://github.com/openfun/arnold.git","svn_url":"https://github.com/openfun/arnold","homepage":"","size":361,"stargazers_count":10,"watchers_count":10,"language":"Shell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":30,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":30,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openfun/arnold/pulls/76"},"html":{"href":"https://github.com/openfun/arnold/pull/76"},"issue":{"href":"https://api.github.com/repos/openfun/arnold/issues/76"},"comments":{"href":"https://api.github.com/repos/openfun/arnold/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/openfun/arnold/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/openfun/arnold/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openfun/arnold/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/openfun/arnold/statuses/505040f90eb7a2a1169a909650ec11e98221592a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"sampaccoud"}}