{"action":"created","comment":{"url":"https://api.github.com/repos/release-engineering/kobo/pulls/comments/224285545","pull_request_review_id":163615014,"id":224285545,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDI4NTU0NQ==","diff_hunk":"@@ -8,7 +8,7 @@\n import logging\n \n # IMPORTANT: import taskd first to set os.environ[\"PROJECT_DEFAULT_CONFIG_FILE\"]\n-from kobo.worker.taskmanager import TaskManager, TaskContainer\n+from kobo.worker.taskmanager import TaskManager","path":"kobo/worker/main.py","position":5,"original_position":5,"commit_id":"5f676b9c761247b342ae5a1e073175ced45fbe94","original_commit_id":"5f676b9c761247b342ae5a1e073175ced45fbe94","user":{"login":"rohanpm","id":312424,"node_id":"MDQ6VXNlcjMxMjQyNA==","avatar_url":"https://avatars2.githubusercontent.com/u/312424?v=4","gravatar_id":"","url":"https://api.github.com/users/rohanpm","html_url":"https://github.com/rohanpm","followers_url":"https://api.github.com/users/rohanpm/followers","following_url":"https://api.github.com/users/rohanpm/following{/other_user}","gists_url":"https://api.github.com/users/rohanpm/gists{/gist_id}","starred_url":"https://api.github.com/users/rohanpm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohanpm/subscriptions","organizations_url":"https://api.github.com/users/rohanpm/orgs","repos_url":"https://api.github.com/users/rohanpm/repos","events_url":"https://api.github.com/users/rohanpm/events{/privacy}","received_events_url":"https://api.github.com/users/rohanpm/received_events","type":"User","site_admin":false},"body":"These changes aren't backwards-compatible, because you're reducing the set of symbols exported by these modules.\r\n\r\nThe pylint (or whatever) tool is only telling you that these imports are unused in *this file*.  But this is a library, and the tool is not able to tell you whether the imports are used from elsewhere.\r\n\r\nI made some effort to look into it myself (grepping through sources of projects using kobo).  There's no entirely robust way of doing it but I was able to confirm at least that this specific change *will* break some other code.\r\n\r\nExample 1, in kobo itself:\r\n\r\n```\r\nkobo/kobo/admin/templates/worker/__project_name__:import kobo.worker.main\r\nkobo/kobo/admin/templates/worker/__project_name__:    kobo.worker.main.TaskContainer.register_module(kobo.worker.tasks, prefix=\"task_\")\r\n```\r\n\r\nThat kobo.worker.main.TaskContainer would have worked before this change, and now it'd be broken.  Note also that this is the template which new applications will use, so that kobo.worker.main.TaskContainer reference probably made its way into several projects by now.\r\n\r\nExample 2, in pubd:\r\n\r\n```\r\nrcm-pub/pubd/__init__.py:from kobo.worker.main import *\r\nrcm-pub/pubd/__init__.py:TaskContainer.register_module(pubd.tasks)\r\n```\r\n\r\nAgain, this change would make TaskContainer undefined and break this code.\r\n\r\nI'm making this comment on just one of these changes, but same thing applies to most of the others here.\r\n\r\nI think we should value backwards-compatibility and trouble-free upgrades of kobo library for our users more than satisfying this pylint check, so I think this cleanup is a bad idea, at least for the kobo and django related imports.\r\n\r\nI don't mind the cleanup for the core modules as I don't believe anyone would have written code like \"from django.auth.models import re\".","created_at":"2018-10-11T00:52:04Z","updated_at":"2018-10-11T00:52:23Z","html_url":"https://github.com/release-engineering/kobo/pull/62#discussion_r224285545","pull_request_url":"https://api.github.com/repos/release-engineering/kobo/pulls/62","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/release-engineering/kobo/pulls/comments/224285545"},"html":{"href":"https://github.com/release-engineering/kobo/pull/62#discussion_r224285545"},"pull_request":{"href":"https://api.github.com/repos/release-engineering/kobo/pulls/62"}}},"pull_request":{"url":"https://api.github.com/repos/release-engineering/kobo/pulls/62","id":221745415,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIxNzQ1NDE1","html_url":"https://github.com/release-engineering/kobo/pull/62","diff_url":"https://github.com/release-engineering/kobo/pull/62.diff","patch_url":"https://github.com/release-engineering/kobo/pull/62.patch","issue_url":"https://api.github.com/repos/release-engineering/kobo/issues/62","number":62,"state":"open","locked":false,"title":"Remove unused imports.","user":{"login":"alexandrevicenzi","id":2637672,"node_id":"MDQ6VXNlcjI2Mzc2NzI=","avatar_url":"https://avatars3.githubusercontent.com/u/2637672?v=4","gravatar_id":"","url":"https://api.github.com/users/alexandrevicenzi","html_url":"https://github.com/alexandrevicenzi","followers_url":"https://api.github.com/users/alexandrevicenzi/followers","following_url":"https://api.github.com/users/alexandrevicenzi/following{/other_user}","gists_url":"https://api.github.com/users/alexandrevicenzi/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandrevicenzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandrevicenzi/subscriptions","organizations_url":"https://api.github.com/users/alexandrevicenzi/orgs","repos_url":"https://api.github.com/users/alexandrevicenzi/repos","events_url":"https://api.github.com/users/alexandrevicenzi/events{/privacy}","received_events_url":"https://api.github.com/users/alexandrevicenzi/received_events","type":"User","site_admin":false},"body":"If this patch gets accepted I will continue to work on code cleanup, there are many places to make improvements. Running *pyflakes* or *pylint* against the code outputs a lot of warnings and errors.\r\n\r\nNext, I plan to remove all `from module import *`.\r\n","created_at":"2018-10-10T10:59:00Z","updated_at":"2018-10-11T00:52:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"469d29ec7216e04ec2bec90f24f60b35d99a3a7e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/release-engineering/kobo/pulls/62/commits","review_comments_url":"https://api.github.com/repos/release-engineering/kobo/pulls/62/comments","review_comment_url":"https://api.github.com/repos/release-engineering/kobo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/release-engineering/kobo/issues/62/comments","statuses_url":"https://api.github.com/repos/release-engineering/kobo/statuses/5f676b9c761247b342ae5a1e073175ced45fbe94","head":{"label":"alexandrevicenzi:unused-imports","ref":"unused-imports","sha":"5f676b9c761247b342ae5a1e073175ced45fbe94","user":{"login":"alexandrevicenzi","id":2637672,"node_id":"MDQ6VXNlcjI2Mzc2NzI=","avatar_url":"https://avatars3.githubusercontent.com/u/2637672?v=4","gravatar_id":"","url":"https://api.github.com/users/alexandrevicenzi","html_url":"https://github.com/alexandrevicenzi","followers_url":"https://api.github.com/users/alexandrevicenzi/followers","following_url":"https://api.github.com/users/alexandrevicenzi/following{/other_user}","gists_url":"https://api.github.com/users/alexandrevicenzi/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandrevicenzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandrevicenzi/subscriptions","organizations_url":"https://api.github.com/users/alexandrevicenzi/orgs","repos_url":"https://api.github.com/users/alexandrevicenzi/repos","events_url":"https://api.github.com/users/alexandrevicenzi/events{/privacy}","received_events_url":"https://api.github.com/users/alexandrevicenzi/received_events","type":"User","site_admin":false},"repo":{"id":152251350,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIyNTEzNTA=","name":"kobo","full_name":"alexandrevicenzi/kobo","private":false,"owner":{"login":"alexandrevicenzi","id":2637672,"node_id":"MDQ6VXNlcjI2Mzc2NzI=","avatar_url":"https://avatars3.githubusercontent.com/u/2637672?v=4","gravatar_id":"","url":"https://api.github.com/users/alexandrevicenzi","html_url":"https://github.com/alexandrevicenzi","followers_url":"https://api.github.com/users/alexandrevicenzi/followers","following_url":"https://api.github.com/users/alexandrevicenzi/following{/other_user}","gists_url":"https://api.github.com/users/alexandrevicenzi/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandrevicenzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandrevicenzi/subscriptions","organizations_url":"https://api.github.com/users/alexandrevicenzi/orgs","repos_url":"https://api.github.com/users/alexandrevicenzi/repos","events_url":"https://api.github.com/users/alexandrevicenzi/events{/privacy}","received_events_url":"https://api.github.com/users/alexandrevicenzi/received_events","type":"User","site_admin":false},"html_url":"https://github.com/alexandrevicenzi/kobo","description":"A pile of python modules used by Red Hat release engineering to build their tools.","fork":true,"url":"https://api.github.com/repos/alexandrevicenzi/kobo","forks_url":"https://api.github.com/repos/alexandrevicenzi/kobo/forks","keys_url":"https://api.github.com/repos/alexandrevicenzi/kobo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexandrevicenzi/kobo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexandrevicenzi/kobo/teams","hooks_url":"https://api.github.com/repos/alexandrevicenzi/kobo/hooks","issue_events_url":"https://api.github.com/repos/alexandrevicenzi/kobo/issues/events{/number}","events_url":"https://api.github.com/repos/alexandrevicenzi/kobo/events","assignees_url":"https://api.github.com/repos/alexandrevicenzi/kobo/assignees{/user}","branches_url":"https://api.github.com/repos/alexandrevicenzi/kobo/branches{/branch}","tags_url":"https://api.github.com/repos/alexandrevicenzi/kobo/tags","blobs_url":"https://api.github.com/repos/alexandrevicenzi/kobo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexandrevicenzi/kobo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexandrevicenzi/kobo/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexandrevicenzi/kobo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexandrevicenzi/kobo/statuses/{sha}","languages_url":"https://api.github.com/repos/alexandrevicenzi/kobo/languages","stargazers_url":"https://api.github.com/repos/alexandrevicenzi/kobo/stargazers","contributors_url":"https://api.github.com/repos/alexandrevicenzi/kobo/contributors","subscribers_url":"https://api.github.com/repos/alexandrevicenzi/kobo/subscribers","subscription_url":"https://api.github.com/repos/alexandrevicenzi/kobo/subscription","commits_url":"https://api.github.com/repos/alexandrevicenzi/kobo/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexandrevicenzi/kobo/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexandrevicenzi/kobo/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexandrevicenzi/kobo/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexandrevicenzi/kobo/contents/{+path}","compare_url":"https://api.github.com/repos/alexandrevicenzi/kobo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexandrevicenzi/kobo/merges","archive_url":"https://api.github.com/repos/alexandrevicenzi/kobo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexandrevicenzi/kobo/downloads","issues_url":"https://api.github.com/repos/alexandrevicenzi/kobo/issues{/number}","pulls_url":"https://api.github.com/repos/alexandrevicenzi/kobo/pulls{/number}","milestones_url":"https://api.github.com/repos/alexandrevicenzi/kobo/milestones{/number}","notifications_url":"https://api.github.com/repos/alexandrevicenzi/kobo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexandrevicenzi/kobo/labels{/name}","releases_url":"https://api.github.com/repos/alexandrevicenzi/kobo/releases{/id}","deployments_url":"https://api.github.com/repos/alexandrevicenzi/kobo/deployments","created_at":"2018-10-09T12:57:52Z","updated_at":"2018-10-10T08:19:36Z","pushed_at":"2018-10-10T10:47:08Z","git_url":"git://github.com/alexandrevicenzi/kobo.git","ssh_url":"git@github.com:alexandrevicenzi/kobo.git","clone_url":"https://github.com/alexandrevicenzi/kobo.git","svn_url":"https://github.com/alexandrevicenzi/kobo","homepage":null,"size":520,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"release-engineering:master","ref":"master","sha":"aa2491a1417a0a3dcea02afa0798b7572287c522","user":{"login":"release-engineering","id":9591189,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk1OTExODk=","avatar_url":"https://avatars3.githubusercontent.com/u/9591189?v=4","gravatar_id":"","url":"https://api.github.com/users/release-engineering","html_url":"https://github.com/release-engineering","followers_url":"https://api.github.com/users/release-engineering/followers","following_url":"https://api.github.com/users/release-engineering/following{/other_user}","gists_url":"https://api.github.com/users/release-engineering/gists{/gist_id}","starred_url":"https://api.github.com/users/release-engineering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/release-engineering/subscriptions","organizations_url":"https://api.github.com/users/release-engineering/orgs","repos_url":"https://api.github.com/users/release-engineering/repos","events_url":"https://api.github.com/users/release-engineering/events{/privacy}","received_events_url":"https://api.github.com/users/release-engineering/received_events","type":"Organization","site_admin":false},"repo":{"id":52263225,"node_id":"MDEwOlJlcG9zaXRvcnk1MjI2MzIyNQ==","name":"kobo","full_name":"release-engineering/kobo","private":false,"owner":{"login":"release-engineering","id":9591189,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk1OTExODk=","avatar_url":"https://avatars3.githubusercontent.com/u/9591189?v=4","gravatar_id":"","url":"https://api.github.com/users/release-engineering","html_url":"https://github.com/release-engineering","followers_url":"https://api.github.com/users/release-engineering/followers","following_url":"https://api.github.com/users/release-engineering/following{/other_user}","gists_url":"https://api.github.com/users/release-engineering/gists{/gist_id}","starred_url":"https://api.github.com/users/release-engineering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/release-engineering/subscriptions","organizations_url":"https://api.github.com/users/release-engineering/orgs","repos_url":"https://api.github.com/users/release-engineering/repos","events_url":"https://api.github.com/users/release-engineering/events{/privacy}","received_events_url":"https://api.github.com/users/release-engineering/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/release-engineering/kobo","description":"A pile of python modules used by Red Hat release engineering to build their tools.","fork":false,"url":"https://api.github.com/repos/release-engineering/kobo","forks_url":"https://api.github.com/repos/release-engineering/kobo/forks","keys_url":"https://api.github.com/repos/release-engineering/kobo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/release-engineering/kobo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/release-engineering/kobo/teams","hooks_url":"https://api.github.com/repos/release-engineering/kobo/hooks","issue_events_url":"https://api.github.com/repos/release-engineering/kobo/issues/events{/number}","events_url":"https://api.github.com/repos/release-engineering/kobo/events","assignees_url":"https://api.github.com/repos/release-engineering/kobo/assignees{/user}","branches_url":"https://api.github.com/repos/release-engineering/kobo/branches{/branch}","tags_url":"https://api.github.com/repos/release-engineering/kobo/tags","blobs_url":"https://api.github.com/repos/release-engineering/kobo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/release-engineering/kobo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/release-engineering/kobo/git/refs{/sha}","trees_url":"https://api.github.com/repos/release-engineering/kobo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/release-engineering/kobo/statuses/{sha}","languages_url":"https://api.github.com/repos/release-engineering/kobo/languages","stargazers_url":"https://api.github.com/repos/release-engineering/kobo/stargazers","contributors_url":"https://api.github.com/repos/release-engineering/kobo/contributors","subscribers_url":"https://api.github.com/repos/release-engineering/kobo/subscribers","subscription_url":"https://api.github.com/repos/release-engineering/kobo/subscription","commits_url":"https://api.github.com/repos/release-engineering/kobo/commits{/sha}","git_commits_url":"https://api.github.com/repos/release-engineering/kobo/git/commits{/sha}","comments_url":"https://api.github.com/repos/release-engineering/kobo/comments{/number}","issue_comment_url":"https://api.github.com/repos/release-engineering/kobo/issues/comments{/number}","contents_url":"https://api.github.com/repos/release-engineering/kobo/contents/{+path}","compare_url":"https://api.github.com/repos/release-engineering/kobo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/release-engineering/kobo/merges","archive_url":"https://api.github.com/repos/release-engineering/kobo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/release-engineering/kobo/downloads","issues_url":"https://api.github.com/repos/release-engineering/kobo/issues{/number}","pulls_url":"https://api.github.com/repos/release-engineering/kobo/pulls{/number}","milestones_url":"https://api.github.com/repos/release-engineering/kobo/milestones{/number}","notifications_url":"https://api.github.com/repos/release-engineering/kobo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/release-engineering/kobo/labels{/name}","releases_url":"https://api.github.com/repos/release-engineering/kobo/releases{/id}","deployments_url":"https://api.github.com/repos/release-engineering/kobo/deployments","created_at":"2016-02-22T09:45:26Z","updated_at":"2018-10-10T02:12:40Z","pushed_at":"2018-10-10T10:59:01Z","git_url":"git://github.com/release-engineering/kobo.git","ssh_url":"git@github.com:release-engineering/kobo.git","clone_url":"https://github.com/release-engineering/kobo.git","svn_url":"https://github.com/release-engineering/kobo","homepage":null,"size":521,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":11,"open_issues":12,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/release-engineering/kobo/pulls/62"},"html":{"href":"https://github.com/release-engineering/kobo/pull/62"},"issue":{"href":"https://api.github.com/repos/release-engineering/kobo/issues/62"},"comments":{"href":"https://api.github.com/repos/release-engineering/kobo/issues/62/comments"},"review_comments":{"href":"https://api.github.com/repos/release-engineering/kobo/pulls/62/comments"},"review_comment":{"href":"https://api.github.com/repos/release-engineering/kobo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/release-engineering/kobo/pulls/62/commits"},"statuses":{"href":"https://api.github.com/repos/release-engineering/kobo/statuses/5f676b9c761247b342ae5a1e073175ced45fbe94"}},"author_association":"NONE"}}
{"actor":{"display_login":"rohanpm"}}