Provide a useful error when failing to perform post-commit with GitLab.
Review Request #11053 — Created June 23, 2020 and submitted
GitLab doesn't have a suitable API for accessing diff contents, so our
only option is to access a non-API URL for fetching diff contents. While
this used to work with private repositories via a Personal Access Token,
it hasn't worked for about a year now, as they've removed that
functionality from all public URLs to address a security issue.
This does still work on older versions or for public repositories,
though, so we want to keep the capability around. To do this, we're now
explicitly checking for a HTTP 404, and if we find it, we provide a
useful blurb of text explaining the situation and linking to a KB
article for more details.
As part of this, review request creation and updating now handles
Unit tests pass.
Manually tested this error condition and saw a useful error message.
Manually tested against a public repository and saw the commit go
Expanded the list of HTTP error codes triggering the error, in case they change in GitLab.
Revision 2 (+166 -30)
Checks run (2 succeeded)