Fix crashes when failing to load hosting services during repo config.

Review Request #12983 — Created April 24, 2023 and updated

chipx86
Review Board
release-5.0.x
reviewboard

Repositories backed by hosting services could crash both the repository
list in the administration UI and the repository configuration form.
Assumptions were being made about whether a HostingService could be
loaded, and this meant we weren't catching exceptions.

The repository list now catches this case when trying to render the
hosting service name, and falls back on showing the stored ID instead,
along with a "(missing support)" suffix.

The repository configuration form catches this in a couple of spots as
well, allowing the form to load even if a hosting service can't.

There are still problems that can occur with rendering information for
SCMTools, due to the fact that they can be loaded from entrypoints, but
those are beyond the scope of this change.

Tested loading my repository list and config form while Power Pack was
uninstalled. Saw that both pages successfully loaded, and that the
affected repositories had the new suffix.

Summary
Fix crashes when failing to load hosting services during repo config.
Description From Last Updated

'typing.TYPE_CHECKING' imported but unused Column: 1 Error code: F401

reviewbotreviewbot

undefined name 'Type' Column: 43 Error code: F821

reviewbotreviewbot

undefined name 'HostingService' Column: 48 Error code: F821

reviewbotreviewbot

undefined name 'HostingService' Column: 39 Error code: F821

reviewbotreviewbot

Since you're here, mind adding a module docstring?

daviddavid
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
david
  1. 
      
  2. reviewboard/hostingsvcs/models.py (Diff revision 2)
     
     

    Since you're here, mind adding a module docstring?

  3. 
      
chipx86
Review request changed

Change Summary:

Added a module docstring.

Commits:

Summary
-
Fix crashes when failing to load hosting services during repo config.
+
Fix crashes when failing to load hosting services during repo config.

Diff:

Revision 3 (+180 -36)

Show changes

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
david
  1. Ship It!
  2. 
      
Loading...