Started playing more with GitHub App support on Jenkins today. Branches appeared to be working fine after re-configuring the Jenkinsfile to point to the GitHub App token rather than the PAT I was using. Statuses still failed, which was a bit unexpected. Digging into further I discovered that:
- Jenkins GIT_COMMIT variable was pointed to something that didn't match GitHub
- GitHub API was (correctly) returning a 422
422 was a HUGE clue as to what was going on. It's not a "permission denied" error: it is a "what was passed was formatted correctly and are allowed to do that, but what was sent was non-sensical." Looking at what test-patch sent and what was in the repo, it became clear that test-patch was trying to give status on a sha that didn't exist in github's view of that repo.
Started playing more with GitHub App support on Jenkins today. Branches appeared to be working fine after re-configuring the Jenkinsfile to point to the GitHub App token rather than the PAT I was using. Statuses still failed, which was a bit unexpected. Digging into further I discovered that:
422 was a HUGE clue as to what was going on. It's not a "permission denied" error: it is a "what was passed was formatted correctly and are allowed to do that, but what was sent was non-sensical." Looking at what test-patch sent and what was in the repo, it became clear that test-patch was trying to give status on a sha that didn't exist in github's view of that repo.