Raise an error when a HostingServiceAccount fails to load a hosting service.
Review Request #12667 — Created Oct. 4, 2022 and submitted — Latest diff uploaded
Repositories use their associated
HostingServiceAccountto fetch hosting
services. The hosting service account will return
Noneif a hosting service
fails to load. This isn't the greatest thing to do since this hides the fact
that the service didn't load, and instead makes the repository behave as if
they do not have a hosting service configured.
This change instead raises an error when a
load a service. This way, a more appropriate and helpful eror message is shown
when, for example, trying to post changes or view diffs linked to repositories
that use a hosting service that can't be loaded.
This also adds some help texts to the
HostingServiceAccount's fields. This
was primarily done to clarify that the
service_namefield should be set to
the hosting service ID rather than the hosting service name. This assumption
is made everywhere in the code except for in one test file which sets the
field to a hosting service name, which we correct in this change.
- Ran all unit tests.
- Tested viewing review requests and diffs that are from a repository that uses
a hosting service that can't be loaded, saw the
rbt post REVISIONwith a git revision, saw a
500: Internal Server Errorresponse and saw the
raised in the server logs.