GitHub PullRequestReviewCommentEvent at 2014-12-06 02:29:34
Repository: pulp
Actor: skarmark
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/pulp/pulp/pulls/comments/21413415","id":21413415,"diff_hunk":"@@ -149,23 +108,15 @@ def set_task_failed(task_id, traceback=None, timestamp=None):\n         :param timestamp: The (optional) ISO-8601 finished timestamp (UTC).\n         :type timestamp: str\n         \"\"\"\n-        collection = TaskStatus.get_collection()\n-\n         if not timestamp:\n             now = datetime.now(dateutils.utc_tz())\n             finished = dateutils.format_iso8601_datetime(now)\n         else:\n             finished = timestamp\n \n-        update = {\n-            '$set': {\n-                'finish_time': finished,\n-                'state': constants.CALL_ERROR_STATE,\n-                'traceback': traceback\n-            }\n-        }\n-\n-        collection.update({'task_id': task_id}, update, safe=True)\n+        TaskStatus.objects(task_id=task_id).update_one(set__finish_time=finished,\n+                                                       set__state=constants.CALL_ERROR_STATE,\n+                                                       set__traceback=traceback)\n \n     @staticmethod\n     def update_task_status(task_id, delta):","path":"server/pulp/server/async/task_status_manager.py","position":158,"original_position":158,"commit_id":"abd97f5c4aed942e97d4083691996a36d5190187","original_commit_id":"617d1b3635690d63d52f19431b32ad98f5c99ef2","user":{"login":"skarmark","id":210093,"avatar_url":"https://avatars.githubusercontent.com/u/210093?v=3","gravatar_id":"","url":"https://api.github.com/users/skarmark","html_url":"https://github.com/skarmark","followers_url":"https://api.github.com/users/skarmark/followers","following_url":"https://api.github.com/users/skarmark/following{/other_user}","gists_url":"https://api.github.com/users/skarmark/gists{/gist_id}","starred_url":"https://api.github.com/users/skarmark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skarmark/subscriptions","organizations_url":"https://api.github.com/users/skarmark/orgs","repos_url":"https://api.github.com/users/skarmark/repos","events_url":"https://api.github.com/users/skarmark/events{/privacy}","received_events_url":"https://api.github.com/users/skarmark/received_events","type":"User","site_admin":false},"body":"This is being handled in remove-taskstatus-manager branch.","created_at":"2014-12-06T02:29:34Z","updated_at":"2014-12-06T02:29:34Z","html_url":"https://github.com/pulp/pulp/pull/1385#discussion_r21413415","pull_request_url":"https://api.github.com/repos/pulp/pulp/pulls/1385","_links":{"self":{"href":"https://api.github.com/repos/pulp/pulp/pulls/comments/21413415"},"html":{"href":"https://github.com/pulp/pulp/pull/1385#discussion_r21413415"},"pull_request":{"href":"https://api.github.com/repos/pulp/pulp/pulls/1385"}}},"pull_request":{"url":"https://api.github.com/repos/pulp/pulp/pulls/1385","id":25403516,"html_url":"https://github.com/pulp/pulp/pull/1385","diff_url":"https://github.com/pulp/pulp/pull/1385.diff","patch_url":"https://github.com/pulp/pulp/pull/1385.patch","issue_url":"https://api.github.com/repos/pulp/pulp/issues/1385","number":1385,"state":"open","locked":false,"title":"Mongoengine taskstatus","user":{"login":"skarmark","id":210093,"avatar_url":"https://avatars.githubusercontent.com/u/210093?v=3","gravatar_id":"","url":"https://api.github.com/users/skarmark","html_url":"https://github.com/skarmark","followers_url":"https://api.github.com/users/skarmark/followers","following_url":"https://api.github.com/users/skarmark/following{/other_user}","gists_url":"https://api.github.com/users/skarmark/gists{/gist_id}","starred_url":"https://api.github.com/users/skarmark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skarmark/subscriptions","organizations_url":"https://api.github.com/users/skarmark/orgs","repos_url":"https://api.github.com/users/skarmark/repos","events_url":"https://api.github.com/users/skarmark/events{/privacy}","received_events_url":"https://api.github.com/users/skarmark/received_events","type":"User","site_admin":false},"body":"This contains -\r\n\r\n1. Schema definition for TaskStatus inherited from mongoengine.Document\r\n2. Added fields.py to define custom fields used in pulp that are not available from mongoengine.\r\n3. Updated save method on TaskStatus to do the validation of fields as well as upserts.\r\n4. Updated task status manager with mongoengine queries\r\n5. Added and updated unit tests in various files as appropriate.\r\n6. Enabled a bunch of unit tests in test_dispatch.py which were not running because of wrong test names.\r\n\r\nSince there are a lot of in-place changes, pull request diff looks confusing at some places. It is better to look at the whole file instead of the diff.\r\n\r\n**Note**: This PR contains changes strictly related to conversion to mongoengine. Getting rid of TaskStatusManager and moving all it's functionality to the TaskStatus model plus updating a ton of relevant unit tests is being handled in a separate branch remove-taskstatus-manager.","created_at":"2014-12-03T08:48:53Z","updated_at":"2014-12-06T02:29:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a71585860d00483561e08a2dce7d8932f8b09e47","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pulp/pulp/pulls/1385/commits","review_comments_url":"https://api.github.com/repos/pulp/pulp/pulls/1385/comments","review_comment_url":"https://api.github.com/repos/pulp/pulp/pulls/comments/{number}","comments_url":"https://api.github.com/repos/pulp/pulp/issues/1385/comments","statuses_url":"https://api.github.com/repos/pulp/pulp/statuses/abd97f5c4aed942e97d4083691996a36d5190187","head":{"label":"skarmark:mongoengine-taskstatus","ref":"mongoengine-taskstatus","sha":"abd97f5c4aed942e97d4083691996a36d5190187","user":{"login":"skarmark","id":210093,"avatar_url":"https://avatars.githubusercontent.com/u/210093?v=3","gravatar_id":"","url":"https://api.github.com/users/skarmark","html_url":"https://github.com/skarmark","followers_url":"https://api.github.com/users/skarmark/followers","following_url":"https://api.github.com/users/skarmark/following{/other_user}","gists_url":"https://api.github.com/users/skarmark/gists{/gist_id}","starred_url":"https://api.github.com/users/skarmark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skarmark/subscriptions","organizations_url":"https://api.github.com/users/skarmark/orgs","repos_url":"https://api.github.com/users/skarmark/repos","events_url":"https://api.github.com/users/skarmark/events{/privacy}","received_events_url":"https://api.github.com/users/skarmark/received_events","type":"User","site_admin":false},"repo":{"id":26777213,"name":"pulp","full_name":"skarmark/pulp","owner":{"login":"skarmark","id":210093,"avatar_url":"https://avatars.githubusercontent.com/u/210093?v=3","gravatar_id":"","url":"https://api.github.com/users/skarmark","html_url":"https://github.com/skarmark","followers_url":"https://api.github.com/users/skarmark/followers","following_url":"https://api.github.com/users/skarmark/following{/other_user}","gists_url":"https://api.github.com/users/skarmark/gists{/gist_id}","starred_url":"https://api.github.com/users/skarmark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skarmark/subscriptions","organizations_url":"https://api.github.com/users/skarmark/orgs","repos_url":"https://api.github.com/users/skarmark/repos","events_url":"https://api.github.com/users/skarmark/events{/privacy}","received_events_url":"https://api.github.com/users/skarmark/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/skarmark/pulp","description":"Repository for Pulp platform code, including the server and base admin and consumer clients","fork":true,"url":"https://api.github.com/repos/skarmark/pulp","forks_url":"https://api.github.com/repos/skarmark/pulp/forks","keys_url":"https://api.github.com/repos/skarmark/pulp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/skarmark/pulp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/skarmark/pulp/teams","hooks_url":"https://api.github.com/repos/skarmark/pulp/hooks","issue_events_url":"https://api.github.com/repos/skarmark/pulp/issues/events{/number}","events_url":"https://api.github.com/repos/skarmark/pulp/events","assignees_url":"https://api.github.com/repos/skarmark/pulp/assignees{/user}","branches_url":"https://api.github.com/repos/skarmark/pulp/branches{/branch}","tags_url":"https://api.github.com/repos/skarmark/pulp/tags","blobs_url":"https://api.github.com/repos/skarmark/pulp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/skarmark/pulp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/skarmark/pulp/git/refs{/sha}","trees_url":"https://api.github.com/repos/skarmark/pulp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/skarmark/pulp/statuses/{sha}","languages_url":"https://api.github.com/repos/skarmark/pulp/languages","stargazers_url":"https://api.github.com/repos/skarmark/pulp/stargazers","contributors_url":"https://api.github.com/repos/skarmark/pulp/contributors","subscribers_url":"https://api.github.com/repos/skarmark/pulp/subscribers","subscription_url":"https://api.github.com/repos/skarmark/pulp/subscription","commits_url":"https://api.github.com/repos/skarmark/pulp/commits{/sha}","git_commits_url":"https://api.github.com/repos/skarmark/pulp/git/commits{/sha}","comments_url":"https://api.github.com/repos/skarmark/pulp/comments{/number}","issue_comment_url":"https://api.github.com/repos/skarmark/pulp/issues/comments/{number}","contents_url":"https://api.github.com/repos/skarmark/pulp/contents/{+path}","compare_url":"https://api.github.com/repos/skarmark/pulp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/skarmark/pulp/merges","archive_url":"https://api.github.com/repos/skarmark/pulp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/skarmark/pulp/downloads","issues_url":"https://api.github.com/repos/skarmark/pulp/issues{/number}","pulls_url":"https://api.github.com/repos/skarmark/pulp/pulls{/number}","milestones_url":"https://api.github.com/repos/skarmark/pulp/milestones{/number}","notifications_url":"https://api.github.com/repos/skarmark/pulp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/skarmark/pulp/labels{/name}","releases_url":"https://api.github.com/repos/skarmark/pulp/releases{/id}","created_at":"2014-11-17T21:05:14Z","updated_at":"2014-11-17T21:05:18Z","pushed_at":"2014-12-05T20:51:57Z","git_url":"git://github.com/skarmark/pulp.git","ssh_url":"git@github.com:skarmark/pulp.git","clone_url":"https://github.com/skarmark/pulp.git","svn_url":"https://github.com/skarmark/pulp","homepage":"","size":77423,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"pulp:master","ref":"master","sha":"0b9b64a320fe3bda2de497ff4519c31828b7efa1","user":{"login":"pulp","id":2103606,"avatar_url":"https://avatars.githubusercontent.com/u/2103606?v=3","gravatar_id":"","url":"https://api.github.com/users/pulp","html_url":"https://github.com/pulp","followers_url":"https://api.github.com/users/pulp/followers","following_url":"https://api.github.com/users/pulp/following{/other_user}","gists_url":"https://api.github.com/users/pulp/gists{/gist_id}","starred_url":"https://api.github.com/users/pulp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pulp/subscriptions","organizations_url":"https://api.github.com/users/pulp/orgs","repos_url":"https://api.github.com/users/pulp/repos","events_url":"https://api.github.com/users/pulp/events{/privacy}","received_events_url":"https://api.github.com/users/pulp/received_events","type":"Organization","site_admin":false},"repo":{"id":5314652,"name":"pulp","full_name":"pulp/pulp","owner":{"login":"pulp","id":2103606,"avatar_url":"https://avatars.githubusercontent.com/u/2103606?v=3","gravatar_id":"","url":"https://api.github.com/users/pulp","html_url":"https://github.com/pulp","followers_url":"https://api.github.com/users/pulp/followers","following_url":"https://api.github.com/users/pulp/following{/other_user}","gists_url":"https://api.github.com/users/pulp/gists{/gist_id}","starred_url":"https://api.github.com/users/pulp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pulp/subscriptions","organizations_url":"https://api.github.com/users/pulp/orgs","repos_url":"https://api.github.com/users/pulp/repos","events_url":"https://api.github.com/users/pulp/events{/privacy}","received_events_url":"https://api.github.com/users/pulp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pulp/pulp","description":"Repository for Pulp platform code, including the server and base admin and consumer clients","fork":false,"url":"https://api.github.com/repos/pulp/pulp","forks_url":"https://api.github.com/repos/pulp/pulp/forks","keys_url":"https://api.github.com/repos/pulp/pulp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pulp/pulp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pulp/pulp/teams","hooks_url":"https://api.github.com/repos/pulp/pulp/hooks","issue_events_url":"https://api.github.com/repos/pulp/pulp/issues/events{/number}","events_url":"https://api.github.com/repos/pulp/pulp/events","assignees_url":"https://api.github.com/repos/pulp/pulp/assignees{/user}","branches_url":"https://api.github.com/repos/pulp/pulp/branches{/branch}","tags_url":"https://api.github.com/repos/pulp/pulp/tags","blobs_url":"https://api.github.com/repos/pulp/pulp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pulp/pulp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pulp/pulp/git/refs{/sha}","trees_url":"https://api.github.com/repos/pulp/pulp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pulp/pulp/statuses/{sha}","languages_url":"https://api.github.com/repos/pulp/pulp/languages","stargazers_url":"https://api.github.com/repos/pulp/pulp/stargazers","contributors_url":"https://api.github.com/repos/pulp/pulp/contributors","subscribers_url":"https://api.github.com/repos/pulp/pulp/subscribers","subscription_url":"https://api.github.com/repos/pulp/pulp/subscription","commits_url":"https://api.github.com/repos/pulp/pulp/commits{/sha}","git_commits_url":"https://api.github.com/repos/pulp/pulp/git/commits{/sha}","comments_url":"https://api.github.com/repos/pulp/pulp/comments{/number}","issue_comment_url":"https://api.github.com/repos/pulp/pulp/issues/comments/{number}","contents_url":"https://api.github.com/repos/pulp/pulp/contents/{+path}","compare_url":"https://api.github.com/repos/pulp/pulp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pulp/pulp/merges","archive_url":"https://api.github.com/repos/pulp/pulp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pulp/pulp/downloads","issues_url":"https://api.github.com/repos/pulp/pulp/issues{/number}","pulls_url":"https://api.github.com/repos/pulp/pulp/pulls{/number}","milestones_url":"https://api.github.com/repos/pulp/pulp/milestones{/number}","notifications_url":"https://api.github.com/repos/pulp/pulp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pulp/pulp/labels{/name}","releases_url":"https://api.github.com/repos/pulp/pulp/releases{/id}","created_at":"2012-08-06T13:49:20Z","updated_at":"2014-12-05T22:01:05Z","pushed_at":"2014-12-05T22:01:04Z","git_url":"git://github.com/pulp/pulp.git","ssh_url":"git@github.com:pulp/pulp.git","clone_url":"https://github.com/pulp/pulp.git","svn_url":"https://github.com/pulp/pulp","homepage":"","size":194825,"stargazers_count":156,"watchers_count":156,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":71,"mirror_url":null,"open_issues_count":23,"forks":71,"open_issues":23,"watchers":156,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pulp/pulp/pulls/1385"},"html":{"href":"https://github.com/pulp/pulp/pull/1385"},"issue":{"href":"https://api.github.com/repos/pulp/pulp/issues/1385"},"comments":{"href":"https://api.github.com/repos/pulp/pulp/issues/1385/comments"},"review_comments":{"href":"https://api.github.com/repos/pulp/pulp/pulls/1385/comments"},"review_comment":{"href":"https://api.github.com/repos/pulp/pulp/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/pulp/pulp/pulls/1385/commits"},"statuses":{"href":"https://api.github.com/repos/pulp/pulp/statuses/abd97f5c4aed942e97d4083691996a36d5190187"}}}}