{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/treeherder/issues/1568","repository_url":"https://api.github.com/repos/mozilla/treeherder","labels_url":"https://api.github.com/repos/mozilla/treeherder/issues/1568/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/treeherder/issues/1568/comments","events_url":"https://api.github.com/repos/mozilla/treeherder/issues/1568/events","html_url":"https://github.com/mozilla/treeherder/pull/1568","id":158797185,"number":1568,"title":"Bug 1266062 - Move bug job map and job notes to ORM from datasource","user":{"login":"wlach","id":20569,"avatar_url":"https://avatars.githubusercontent.com/u/20569?v=3","gravatar_id":"","url":"https://api.github.com/users/wlach","html_url":"https://github.com/wlach","followers_url":"https://api.github.com/users/wlach/followers","following_url":"https://api.github.com/users/wlach/following{/other_user}","gists_url":"https://api.github.com/users/wlach/gists{/gist_id}","starred_url":"https://api.github.com/users/wlach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wlach/subscriptions","organizations_url":"https://api.github.com/users/wlach/orgs","repos_url":"https://api.github.com/users/wlach/repos","events_url":"https://api.github.com/users/wlach/events{/privacy}","received_events_url":"https://api.github.com/users/wlach/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-06T23:20:32Z","updated_at":"2016-06-07T17:41:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mozilla/treeherder/pulls/1568","html_url":"https://github.com/mozilla/treeherder/pull/1568","diff_url":"https://github.com/mozilla/treeherder/pull/1568.diff","patch_url":"https://github.com/mozilla/treeherder/pull/1568.patch"},"body":"\n\n<!-- Reviewable:start -->\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"35\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/mozilla/treeherder/1568)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/mozilla/treeherder/issues/comments/224357400","html_url":"https://github.com/mozilla/treeherder/pull/1568#issuecomment-224357400","issue_url":"https://api.github.com/repos/mozilla/treeherder/issues/1568","id":224357400,"user":{"login":"jgraham","id":294864,"avatar_url":"https://avatars.githubusercontent.com/u/294864?v=3","gravatar_id":"","url":"https://api.github.com/users/jgraham","html_url":"https://github.com/jgraham","followers_url":"https://api.github.com/users/jgraham/followers","following_url":"https://api.github.com/users/jgraham/following{/other_user}","gists_url":"https://api.github.com/users/jgraham/gists{/gist_id}","starred_url":"https://api.github.com/users/jgraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgraham/subscriptions","organizations_url":"https://api.github.com/users/jgraham/orgs","repos_url":"https://api.github.com/users/jgraham/repos","events_url":"https://api.github.com/users/jgraham/events{/privacy}","received_events_url":"https://api.github.com/users/jgraham/received_events","type":"User","site_admin":false},"created_at":"2016-06-07T17:41:27Z","updated_at":"2016-06-07T17:41:27Z","body":"\n\n\n\n\n\nReview status: 0 of 17 files reviewed at latest revision, 4 unresolved discussions, some commit checks failed.\n\n---\n\n*[treeherder/model/models.py, line 628 \\[r2\\]](https://reviewable.io:443/reviews/mozilla/treeherder/1568#-KJfsv9UfXOMTJiWoGj9:-KJfsv9UfXOMTJiWoGjA:-620848257) ([raw file](https://github.com/mozilla/treeherder/blob/d1cd3121fe3960554948931975a162532f06b243/treeherder/model/models.py#L628)):*\n> ```Python\n>     job = FlexibleForeignKey(Job)\n>     bug_id = models.PositiveIntegerField(db_index=True)\n>     submit_timestamp = models.DateTimeField(auto_now_add=True)\n> ```\n\nIt is somewhat backwards incompatible, but elsewhere we have called this `created`.j\n\n---\n\n*[treeherder/model/models.py, line 669 \\[r2\\]](https://reviewable.io:443/reviews/mozilla/treeherder/1568#-KJftsMsQ55LzX9PPxrD:-KJftsMsQ55LzX9PPxrE:1183047372) ([raw file](https://github.com/mozilla/treeherder/blob/d1cd3121fe3960554948931975a162532f06b243/treeherder/model/models.py#L669)):*\n> ```Python\n>             # if we have a user, then update the autoclassification relations\n>             if self.user:\n>                 jm.update_autoclassification_bug(self.job.project_specific_id,\n> ```\n\nThis seems to be the only reason that the jobs model is used here? It wouldn't be *so* hard to make the autoclassification stuff a method on `Job`, which would need the artifact model (until we get rid of the bug_suggestions artifacts), but not actually the job model.\n\nI'm also OK with doing that later though.\n\n---\n\n*[treeherder/model/models.py, line 691 \\[r2\\]](https://reviewable.io:443/reviews/mozilla/treeherder/1568#-KJfv-8KcUK3z7iidhBR:-KJfv-8KcUK3z7iidhBS:-1414288537) ([raw file](https://github.com/mozilla/treeherder/blob/d1cd3121fe3960554948931975a162532f06b243/treeherder/model/models.py#L691)):*\n> ```Python\n>     user = models.ForeignKey(User, null=True)  # null if autoclassified\n>     text = models.TextField()\n>     timestamp = models.DateTimeField(auto_now_add=True)\n> ```\n\nAgain, renaming this `created` would give the illusion of consistency._g\n\n---\n\n*[treeherder/webapp/api/note.py, line 14 \\[r2\\]](https://reviewable.io:443/reviews/mozilla/treeherder/1568#-KJfwydrsOjW2eOpVnm_:-KJfwydsHYGKVUV8ugHO:118917114) ([raw file](https://github.com/mozilla/treeherder/blob/d1cd3121fe3960554948931975a162532f06b243/treeherder/webapp/api/note.py#L14)):*\n> ```Python\n> \n>     @staticmethod\n>     def _get_note_as_dict(note):\n> ```\n\nI wonder if these `_as_dict` methods should go in the model?\n\n---\n\n\n*Comments from [Reviewable](https://reviewable.io:443/reviews/mozilla/treeherder/1568)*\n<!-- Sent from Reviewable.io -->\n"}}
{"actor":{"display_login":"jgraham"}}