{"action":"created","issue":{"url":"https://api.github.com/repos/sford/yet-another-commit-checker/issues/91","labels_url":"https://api.github.com/repos/sford/yet-another-commit-checker/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/sford/yet-another-commit-checker/issues/91/comments","events_url":"https://api.github.com/repos/sford/yet-another-commit-checker/issues/91/events","html_url":"https://github.com/sford/yet-another-commit-checker/issues/91","id":116799442,"number":91,"title":"Commits rejected even when valid jira issue supplied","user":{"login":"roxspring","id":783694,"avatar_url":"https://avatars.githubusercontent.com/u/783694?v=3","gravatar_id":"","url":"https://api.github.com/users/roxspring","html_url":"https://github.com/roxspring","followers_url":"https://api.github.com/users/roxspring/followers","following_url":"https://api.github.com/users/roxspring/following{/other_user}","gists_url":"https://api.github.com/users/roxspring/gists{/gist_id}","starred_url":"https://api.github.com/users/roxspring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roxspring/subscriptions","organizations_url":"https://api.github.com/users/roxspring/orgs","repos_url":"https://api.github.com/users/roxspring/repos","events_url":"https://api.github.com/users/roxspring/events{/privacy}","received_events_url":"https://api.github.com/users/roxspring/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-11-13T16:13:42Z","updated_at":"2015-11-13T18:23:06Z","closed_at":"2015-11-13T18:23:06Z","body":"We're using v1.6 and checking for valid jira issue ids when developers commit changes and it works well.  When releasing, our build system makes additional changes and needs to push those back to the repo but these changes regularly get rejected with \"No JIRA Issue found in commit message\" even when there very clearly is one (the same one) an example commit log is shown below. The only appreciable difference between commits is that the build server is connecting via ssh with a key rather than users connecting via https with a password.  I've also tried disabling the check for service users but that makes no difference either!\r\n\r\nAny idea what we're doing wrong? Or how to debug the problem?\r\n\r\n```\r\ncommit 869717e0c2726f9bf249f2a32c8393237b271383\r\nAuthor: KEY Build <build@lab.example.com>\r\nDate:   Fri Nov 13 15:49:35 2015 +0000\r\n\r\n    KEY-45445 release 0.1prepare for next development iteration\r\n\r\ncommit 1d74dad20945c38f851c9f4c79a037b52448a81a\r\nAuthor: KEY Build <build@lab.example.com>\r\nDate:   Fri Nov 13 15:49:34 2015 +0000\r\n\r\n    KEY-45445 release 0.1prepare release 0.1\r\n\r\ncommit 0c874be3d7c7d371373e88abe2b145a60549617f\r\nMerge: 8e1fbc6 b7091a2\r\nAuthor: Ruth <ruth@example.com>\r\nDate:   Fri Nov 13 14:25:25 2015 +0000\r\n\r\n    Merge pull request #4 in KEY/report-config from bugfix/KEY-44478-Raise-Microservice-RunTime-Version to master\r\n\r\n    * commit 'b7091a23460c347019e5c9ec44e43782bb3e5320':\r\n      KEY-44478 Using the latest microservice runtime version\r\n\r\ncommit b7091a23460c347019e5c9ec44e43782bb3e5320\r\nAuthor: Ashwini <ashwini@example.com>\r\nDate:   Fri Nov 13 14:21:45 2015 +0000\r\n\r\n    KEY-44478 Using the latest microservice runtime version\r\n```"},"comment":{"url":"https://api.github.com/repos/sford/yet-another-commit-checker/issues/comments/156508539","html_url":"https://github.com/sford/yet-another-commit-checker/issues/91#issuecomment-156508539","issue_url":"https://api.github.com/repos/sford/yet-another-commit-checker/issues/91","id":156508539,"user":{"login":"roxspring","id":783694,"avatar_url":"https://avatars.githubusercontent.com/u/783694?v=3","gravatar_id":"","url":"https://api.github.com/users/roxspring","html_url":"https://github.com/roxspring","followers_url":"https://api.github.com/users/roxspring/followers","following_url":"https://api.github.com/users/roxspring/following{/other_user}","gists_url":"https://api.github.com/users/roxspring/gists{/gist_id}","starred_url":"https://api.github.com/users/roxspring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roxspring/subscriptions","organizations_url":"https://api.github.com/users/roxspring/orgs","repos_url":"https://api.github.com/users/roxspring/repos","events_url":"https://api.github.com/users/roxspring/events{/privacy}","received_events_url":"https://api.github.com/users/roxspring/received_events","type":"User","site_admin":false},"created_at":"2015-11-13T18:23:06Z","updated_at":"2015-11-13T18:23:06Z","body":"Obviously the above suggests that unchecking \"Ignore Unknown JIRA Project Keys\" is a simple workaround.\r\n\r\nBut I think I've got a handle on what's going on here, assuming that Stash is attempting to connect to Jira as the commit author (and your comment has just arrived above seeming to confirm that):\r\n* Jenkins is committing changes to stash as _build_ user\r\n* Yacc is parsing good looking issue id ABC-1234 from the commit message\r\n* Yacc is connecting to jira as _build_ and attempting to check that ABC is a valid project\r\n* Jira is returning some error response because _build_ user isn't permitted to use Jira (why would it be!?)\r\n* Yacc understands that ABC is not a valid project and ignores the issue id\r\n* Yacc concludes that there are no valid issue ids present and rejects the commit.\r\n\r\nPresumably this would also explain why we weren't able to use JQL validation previously: the _build_ user doesn't have Jira access and isn't able to run the query and so the commit is rejected.\r\n\r\nSo I can probably workaround the issue by disabling Ignore Unknown JIRA Project Keys, which seems like a useful feature. Alternatively I can probably use the combination of features I like so long as the user in question has access to read the relevant project in Jira.\r\n\r\nI'm guessing the error messages could have been clearer along the way but thanks for your help understanding.  Pretty sure I've got a path forward at this stage. "}}