Add helpful information for conflicting SCMTool/Tool entries.

Review Request #12391 — Created June 20, 2022 and submitted — Latest diff uploaded


Review Board


If a Tool entry has been changed on a server to point to a different
SCMTool class, we'll crash with an IntegrityError when trying to
inject tools, due to a conflict in names.

We now check for both name and class_name conflicts. If we try to
record a SCMTool as a Tool, and either the name or class (but not
both) matches an existing Tool, we'll log a warning and record the
conflicting tool.

The upgrade handler looks to see if we detected any conflicting tools,
and if so, provides warnings and guidance on the conflict.

This will hopefully help for companies that have forked some SCMTool
for their own needs.

Hit this issue when temporarily modifying a class name for a tool to
trigger an entirely different error, and saw the crash during upgrade.

Verified that this no longer crashes, but rather displays a block of
information with the details on the conflict.

Unit tests pass.