{"action":"created","comment":{"url":"https://api.github.com/repos/scitran/core/pulls/comments/62243218","id":62243218,"diff_hunk":"@@ -40,132 +42,124 @@\n def valid_transition(from_state, to_state):\n     return (from_state + ' --> ' + to_state) in JOB_TRANSITIONS or from_state == to_state\n \n-Category = util.Enum('Category', {\n-    'classifier': 'classifier', # discover metadata\n-    'converter':  'converter',  # translate between formats\n-    'qa':         'qa',         # quality assurance\n-    'analytical': 'analytical', # general purpose\n-})\n-\n-Gear = namedtuple('gear', ['name', 'category', 'input'])\n-\n def get_gears():\n     \"\"\"\n     Fetch the install-global gears from the database\n     \"\"\"\n \n     gear_doc  = config.db.static.find_one({'_id': 'gears'})\n-    gears_map = gear_doc['gear_list']\n-    gears = []\n+    return gear_doc['gear_list']\n \n-    for g in gears_map:\n-        cat_string = g['category']\n-        gears.append(Gear(g['name'], Category[cat_string], g['input']))\n+def get_gear_by_name(name):\n \n-    return gears\n+    # Find a gear from the list by name\n+    gear_doc = config.db.static.find_one({\n+        \"_id\": \"gears\",\n+        \"gear_list\": {\n+            \"$elemMatch\": {\n+                \"name\": name\n+            }","path":"api/jobs.py","position":45,"original_position":45,"commit_id":"abeab5b0a3b45a38fd6b72dce318fe094d9756d0","original_commit_id":"e3736b5e6271ff1f31c1c870f2c2889ab8e89b3d","user":{"login":"nagem","id":5702596,"avatar_url":"https://avatars.githubusercontent.com/u/5702596?v=3","gravatar_id":"","url":"https://api.github.com/users/nagem","html_url":"https://github.com/nagem","followers_url":"https://api.github.com/users/nagem/followers","following_url":"https://api.github.com/users/nagem/following{/other_user}","gists_url":"https://api.github.com/users/nagem/gists{/gist_id}","starred_url":"https://api.github.com/users/nagem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nagem/subscriptions","organizations_url":"https://api.github.com/users/nagem/orgs","repos_url":"https://api.github.com/users/nagem/repos","events_url":"https://api.github.com/users/nagem/events{/privacy}","received_events_url":"https://api.github.com/users/nagem/received_events","type":"User","site_admin":false},"body":"He got that from me, I mistakenly put the elemMatch in the query rather than the projection block. Here was the intention: \r\n\r\n`{'_id': 'gears'}, {'gear_list': {'$elemMatch': {'name':name}}}`","created_at":"2016-05-05T19:45:25Z","updated_at":"2016-05-05T19:45:25Z","html_url":"https://github.com/scitran/core/pull/270#discussion_r62243218","pull_request_url":"https://api.github.com/repos/scitran/core/pulls/270","_links":{"self":{"href":"https://api.github.com/repos/scitran/core/pulls/comments/62243218"},"html":{"href":"https://github.com/scitran/core/pull/270#discussion_r62243218"},"pull_request":{"href":"https://api.github.com/repos/scitran/core/pulls/270"}}},"pull_request":{"url":"https://api.github.com/repos/scitran/core/pulls/270","id":68594151,"html_url":"https://github.com/scitran/core/pull/270","diff_url":"https://github.com/scitran/core/pull/270.diff","patch_url":"https://github.com/scitran/core/pull/270.patch","issue_url":"https://api.github.com/repos/scitran/core/issues/270","number":270,"state":"open","locked":false,"title":"Upgrade gear processing to use manifests","user":{"login":"kofalt","id":265071,"avatar_url":"https://avatars.githubusercontent.com/u/265071?v=3","gravatar_id":"","url":"https://api.github.com/users/kofalt","html_url":"https://github.com/kofalt","followers_url":"https://api.github.com/users/kofalt/followers","following_url":"https://api.github.com/users/kofalt/following{/other_user}","gists_url":"https://api.github.com/users/kofalt/gists{/gist_id}","starred_url":"https://api.github.com/users/kofalt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kofalt/subscriptions","organizations_url":"https://api.github.com/users/kofalt/orgs","repos_url":"https://api.github.com/users/kofalt/repos","events_url":"https://api.github.com/users/kofalt/events{/privacy}","received_events_url":"https://api.github.com/users/kofalt/received_events","type":"User","site_admin":false},"body":"This PR upgrades `jobs.queue_job` to use gear manifests, which inform the core as to which inputs should be placed where. Critically, the `rules` scheduling module has not been ported to take advantage of this new information - that's a larger conversation - so `jobs.queue_job_legacy` was added to connect the old world to the new. Along the way, some old structures got removed, and others were moved to `containerutil` as per team discussion.","created_at":"2016-05-02T17:51:28Z","updated_at":"2016-05-05T19:45:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"43476c3f9573afdd2c11f5d1cd821bd2479bbd47","assignee":{"login":"nagem","id":5702596,"avatar_url":"https://avatars.githubusercontent.com/u/5702596?v=3","gravatar_id":"","url":"https://api.github.com/users/nagem","html_url":"https://github.com/nagem","followers_url":"https://api.github.com/users/nagem/followers","following_url":"https://api.github.com/users/nagem/following{/other_user}","gists_url":"https://api.github.com/users/nagem/gists{/gist_id}","starred_url":"https://api.github.com/users/nagem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nagem/subscriptions","organizations_url":"https://api.github.com/users/nagem/orgs","repos_url":"https://api.github.com/users/nagem/repos","events_url":"https://api.github.com/users/nagem/events{/privacy}","received_events_url":"https://api.github.com/users/nagem/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/scitran/core/pulls/270/commits","review_comments_url":"https://api.github.com/repos/scitran/core/pulls/270/comments","review_comment_url":"https://api.github.com/repos/scitran/core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scitran/core/issues/270/comments","statuses_url":"https://api.github.com/repos/scitran/core/statuses/abeab5b0a3b45a38fd6b72dce318fe094d9756d0","head":{"label":"scitran:manifests","ref":"manifests","sha":"abeab5b0a3b45a38fd6b72dce318fe094d9756d0","user":{"login":"scitran","id":7379762,"avatar_url":"https://avatars.githubusercontent.com/u/7379762?v=3","gravatar_id":"","url":"https://api.github.com/users/scitran","html_url":"https://github.com/scitran","followers_url":"https://api.github.com/users/scitran/followers","following_url":"https://api.github.com/users/scitran/following{/other_user}","gists_url":"https://api.github.com/users/scitran/gists{/gist_id}","starred_url":"https://api.github.com/users/scitran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scitran/subscriptions","organizations_url":"https://api.github.com/users/scitran/orgs","repos_url":"https://api.github.com/users/scitran/repos","events_url":"https://api.github.com/users/scitran/events{/privacy}","received_events_url":"https://api.github.com/users/scitran/received_events","type":"Organization","site_admin":false},"repo":{"id":16557832,"name":"core","full_name":"scitran/core","owner":{"login":"scitran","id":7379762,"avatar_url":"https://avatars.githubusercontent.com/u/7379762?v=3","gravatar_id":"","url":"https://api.github.com/users/scitran","html_url":"https://github.com/scitran","followers_url":"https://api.github.com/users/scitran/followers","following_url":"https://api.github.com/users/scitran/following{/other_user}","gists_url":"https://api.github.com/users/scitran/gists{/gist_id}","starred_url":"https://api.github.com/users/scitran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scitran/subscriptions","organizations_url":"https://api.github.com/users/scitran/orgs","repos_url":"https://api.github.com/users/scitran/repos","events_url":"https://api.github.com/users/scitran/events{/privacy}","received_events_url":"https://api.github.com/users/scitran/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scitran/core","description":"SciTran RESTful API","fork":false,"url":"https://api.github.com/repos/scitran/core","forks_url":"https://api.github.com/repos/scitran/core/forks","keys_url":"https://api.github.com/repos/scitran/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scitran/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scitran/core/teams","hooks_url":"https://api.github.com/repos/scitran/core/hooks","issue_events_url":"https://api.github.com/repos/scitran/core/issues/events{/number}","events_url":"https://api.github.com/repos/scitran/core/events","assignees_url":"https://api.github.com/repos/scitran/core/assignees{/user}","branches_url":"https://api.github.com/repos/scitran/core/branches{/branch}","tags_url":"https://api.github.com/repos/scitran/core/tags","blobs_url":"https://api.github.com/repos/scitran/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scitran/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scitran/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/scitran/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scitran/core/statuses/{sha}","languages_url":"https://api.github.com/repos/scitran/core/languages","stargazers_url":"https://api.github.com/repos/scitran/core/stargazers","contributors_url":"https://api.github.com/repos/scitran/core/contributors","subscribers_url":"https://api.github.com/repos/scitran/core/subscribers","subscription_url":"https://api.github.com/repos/scitran/core/subscription","commits_url":"https://api.github.com/repos/scitran/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/scitran/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/scitran/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/scitran/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/scitran/core/contents/{+path}","compare_url":"https://api.github.com/repos/scitran/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scitran/core/merges","archive_url":"https://api.github.com/repos/scitran/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scitran/core/downloads","issues_url":"https://api.github.com/repos/scitran/core/issues{/number}","pulls_url":"https://api.github.com/repos/scitran/core/pulls{/number}","milestones_url":"https://api.github.com/repos/scitran/core/milestones{/number}","notifications_url":"https://api.github.com/repos/scitran/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scitran/core/labels{/name}","releases_url":"https://api.github.com/repos/scitran/core/releases{/id}","deployments_url":"https://api.github.com/repos/scitran/core/deployments","created_at":"2014-02-05T20:48:50Z","updated_at":"2016-02-16T18:37:05Z","pushed_at":"2016-05-05T19:40:11Z","git_url":"git://github.com/scitran/core.git","ssh_url":"git@github.com:scitran/core.git","clone_url":"https://github.com/scitran/core.git","svn_url":"https://github.com/scitran/core","homepage":"","size":1330,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":40,"forks":6,"open_issues":40,"watchers":4,"default_branch":"master"}},"base":{"label":"scitran:master","ref":"master","sha":"a81343b01d5cf7296066e1cc34bb0bc286a62503","user":{"login":"scitran","id":7379762,"avatar_url":"https://avatars.githubusercontent.com/u/7379762?v=3","gravatar_id":"","url":"https://api.github.com/users/scitran","html_url":"https://github.com/scitran","followers_url":"https://api.github.com/users/scitran/followers","following_url":"https://api.github.com/users/scitran/following{/other_user}","gists_url":"https://api.github.com/users/scitran/gists{/gist_id}","starred_url":"https://api.github.com/users/scitran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scitran/subscriptions","organizations_url":"https://api.github.com/users/scitran/orgs","repos_url":"https://api.github.com/users/scitran/repos","events_url":"https://api.github.com/users/scitran/events{/privacy}","received_events_url":"https://api.github.com/users/scitran/received_events","type":"Organization","site_admin":false},"repo":{"id":16557832,"name":"core","full_name":"scitran/core","owner":{"login":"scitran","id":7379762,"avatar_url":"https://avatars.githubusercontent.com/u/7379762?v=3","gravatar_id":"","url":"https://api.github.com/users/scitran","html_url":"https://github.com/scitran","followers_url":"https://api.github.com/users/scitran/followers","following_url":"https://api.github.com/users/scitran/following{/other_user}","gists_url":"https://api.github.com/users/scitran/gists{/gist_id}","starred_url":"https://api.github.com/users/scitran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scitran/subscriptions","organizations_url":"https://api.github.com/users/scitran/orgs","repos_url":"https://api.github.com/users/scitran/repos","events_url":"https://api.github.com/users/scitran/events{/privacy}","received_events_url":"https://api.github.com/users/scitran/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scitran/core","description":"SciTran RESTful API","fork":false,"url":"https://api.github.com/repos/scitran/core","forks_url":"https://api.github.com/repos/scitran/core/forks","keys_url":"https://api.github.com/repos/scitran/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scitran/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scitran/core/teams","hooks_url":"https://api.github.com/repos/scitran/core/hooks","issue_events_url":"https://api.github.com/repos/scitran/core/issues/events{/number}","events_url":"https://api.github.com/repos/scitran/core/events","assignees_url":"https://api.github.com/repos/scitran/core/assignees{/user}","branches_url":"https://api.github.com/repos/scitran/core/branches{/branch}","tags_url":"https://api.github.com/repos/scitran/core/tags","blobs_url":"https://api.github.com/repos/scitran/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scitran/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scitran/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/scitran/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scitran/core/statuses/{sha}","languages_url":"https://api.github.com/repos/scitran/core/languages","stargazers_url":"https://api.github.com/repos/scitran/core/stargazers","contributors_url":"https://api.github.com/repos/scitran/core/contributors","subscribers_url":"https://api.github.com/repos/scitran/core/subscribers","subscription_url":"https://api.github.com/repos/scitran/core/subscription","commits_url":"https://api.github.com/repos/scitran/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/scitran/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/scitran/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/scitran/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/scitran/core/contents/{+path}","compare_url":"https://api.github.com/repos/scitran/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scitran/core/merges","archive_url":"https://api.github.com/repos/scitran/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scitran/core/downloads","issues_url":"https://api.github.com/repos/scitran/core/issues{/number}","pulls_url":"https://api.github.com/repos/scitran/core/pulls{/number}","milestones_url":"https://api.github.com/repos/scitran/core/milestones{/number}","notifications_url":"https://api.github.com/repos/scitran/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scitran/core/labels{/name}","releases_url":"https://api.github.com/repos/scitran/core/releases{/id}","deployments_url":"https://api.github.com/repos/scitran/core/deployments","created_at":"2014-02-05T20:48:50Z","updated_at":"2016-02-16T18:37:05Z","pushed_at":"2016-05-05T19:40:11Z","git_url":"git://github.com/scitran/core.git","ssh_url":"git@github.com:scitran/core.git","clone_url":"https://github.com/scitran/core.git","svn_url":"https://github.com/scitran/core","homepage":"","size":1330,"stargazers_count":4,"watchers_count":4,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":40,"forks":6,"open_issues":40,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scitran/core/pulls/270"},"html":{"href":"https://github.com/scitran/core/pull/270"},"issue":{"href":"https://api.github.com/repos/scitran/core/issues/270"},"comments":{"href":"https://api.github.com/repos/scitran/core/issues/270/comments"},"review_comments":{"href":"https://api.github.com/repos/scitran/core/pulls/270/comments"},"review_comment":{"href":"https://api.github.com/repos/scitran/core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scitran/core/pulls/270/commits"},"statuses":{"href":"https://api.github.com/repos/scitran/core/statuses/abeab5b0a3b45a38fd6b72dce318fe094d9756d0"}}}}