Fix bugs and regressions with bug tracker configuration.
Review Request #9900 — Created May 1, 2018 and submitted — Latest diff uploaded
A recent change prevented hosting service forms from loading posted form
data if the form wasn't used to submit that data. This prevented crashes
in some situations, and unwanted (but harmless) "This field is required"
errors in others.Unfortunately, that fix broke bug tracker configuration, as it was
making determinations for both the repository and bug tracker forms
based solely on the submitted repository data. This meant that if you
were using a bug tracker from a different service, things would break.We now make that determination per-form, based on the proper fields in
the posted form data, preventing this problem.While working on this, a couple other problems related to the bug
tracker configuration was found and fixed.First, the "Type" field for bug trackers was visible when loading a
repository that had the "Use hosting service's bug tracker" checkbox
checked. Toggling that checkbox off and back on would properly hide the
Type field. This was happening because the "fake" hosting service
support (used to help guide people to Power Pack for configuration) was
overriding a previous calculation for the visiblity of this field. Now,
instead of overriding that calculation, the code that's supposed to
calculate it is invoked for fake services.Second, if a SCMTool is in the database but no longer installed, the
form would crash trying to import it. We now catch this, and just skip
the tool, allowing the equivalent fake tool entry (if any) to show up
instead.
Unit tests pass.
Manually tested:
- Setting no bug tracker for a repository
- Setting a custom bug tracker
- Setting a hosting service bug tracker for the same service as the
repository. - Setting a hosting service bug tracker for a different service from
the repository. - Loading the form when an SCMTool is unavailable.
- Testing visibility for the Bug Tracker Type field on initial loads
(with and without the "Use hosting" checkbox checked) and after
toggling it.