{"action":"created","issue":{"url":"https://api.github.com/repos/houndci/hound/issues/1102","repository_url":"https://api.github.com/repos/houndci/hound","labels_url":"https://api.github.com/repos/houndci/hound/issues/1102/labels{/name}","comments_url":"https://api.github.com/repos/houndci/hound/issues/1102/comments","events_url":"https://api.github.com/repos/houndci/hound/issues/1102/events","html_url":"https://github.com/houndci/hound/pull/1102","id":140976499,"number":1102,"title":"Add file_reviews.linter_name","user":{"login":"jbusser","id":3093239,"avatar_url":"https://avatars.githubusercontent.com/u/3093239?v=3","gravatar_id":"","url":"https://api.github.com/users/jbusser","html_url":"https://github.com/jbusser","followers_url":"https://api.github.com/users/jbusser/followers","following_url":"https://api.github.com/users/jbusser/following{/other_user}","gists_url":"https://api.github.com/users/jbusser/gists{/gist_id}","starred_url":"https://api.github.com/users/jbusser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbusser/subscriptions","organizations_url":"https://api.github.com/users/jbusser/orgs","repos_url":"https://api.github.com/users/jbusser/repos","events_url":"https://api.github.com/users/jbusser/events{/privacy}","received_events_url":"https://api.github.com/users/jbusser/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-03-15T13:46:01Z","updated_at":"2016-05-04T17:29:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/houndci/hound/pulls/1102","html_url":"https://github.com/houndci/hound/pull/1102","diff_url":"https://github.com/houndci/hound/pull/1102.diff","patch_url":"https://github.com/houndci/hound/pull/1102.patch"},"body":"[Related Github issue](https://github.com/houndci/hound/issues/1101)\r\n\r\nGenerally speaking, for any given language, Hound supports only one linter. For\r\nexample, Rubocop will handle all `.rb` files; SCSS-lint will lint `.scss` files\r\nand so on.\r\n\r\nAnd then there's JavaScript.\r\n\r\nFor JavaScript, Hound supports three linters: JShint, JSCS, and ESlint,\r\neach of which can be individually enabled or disabled. If both JShint and\r\nJSCS are enabled, however, Hound code reviews will never complete for a given\r\nbuild, and this is because `CompleteFileReivew#file_review` will only look up\r\na `FileReview` by its `filename` attribute, and when multiple linters are\r\nworking on a single file, that is not enough information. The second through nth\r\n`FileReivew` for that file never gets found, and its `completed_at` never gets\r\nupdated. When that happens, `Build#complete?` always returns false.\r\n\r\nThis change creates a migration that adds a new column to the `file_reviews`\r\ntable, which will store the name of the linter assigned to a given file review.\r\nThe corresponding `FileReview` model will acquire a model-level validation to\r\nensure the presence of this new linter-name attribute.\r\n\r\nIt then updates `Linter::Base#enqueue_job` to add the linter_name attribute to\r\nthe hash of review-job attributes so that linters can pick up this new\r\nattribute. When their reviews are complete, the linters can be configured to\r\npass the linter name back to Hound, along with any errors and the filename, just\r\nas before.\r\n\r\nThe last part of this solution involves updating\r\n`CompleteFileReview#file_review` to anticipate an optional `linter_name`\r\nattribute in its dequeued job attributes, which it will use to perform a more\r\nprecise search of `FileReview` objects in the relevant build. In order to avoid\r\na large coordinated upgrade effort, this method will fall back to the previous\r\nlocator logic, which only operates on the job's `filename` attribute."},"comment":{"url":"https://api.github.com/repos/houndci/hound/issues/comments/216940452","html_url":"https://github.com/houndci/hound/pull/1102#issuecomment-216940452","issue_url":"https://api.github.com/repos/houndci/hound/issues/1102","id":216940452,"user":{"login":"jbusser","id":3093239,"avatar_url":"https://avatars.githubusercontent.com/u/3093239?v=3","gravatar_id":"","url":"https://api.github.com/users/jbusser","html_url":"https://github.com/jbusser","followers_url":"https://api.github.com/users/jbusser/followers","following_url":"https://api.github.com/users/jbusser/following{/other_user}","gists_url":"https://api.github.com/users/jbusser/gists{/gist_id}","starred_url":"https://api.github.com/users/jbusser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbusser/subscriptions","organizations_url":"https://api.github.com/users/jbusser/orgs","repos_url":"https://api.github.com/users/jbusser/repos","events_url":"https://api.github.com/users/jbusser/events{/privacy}","received_events_url":"https://api.github.com/users/jbusser/received_events","type":"User","site_admin":false},"created_at":"2016-05-04T17:29:03Z","updated_at":"2016-05-04T17:29:03Z","body":"I just wanted to let you guys know that this is ready for another review. The Ci failure is (still) the result of the out-of-date administrate gem and not necessarily related to this change. I'm still happy to fix that in separate pull if that would help."}}