Add helpful information for conflicting SCMTool/Tool entries.
Review Request #12391 — Created June 20, 2022 and submitted — Latest diff uploaded
If a
Tool
entry has been changed on a server to point to a different
SCMTool
class, we'll crash with anIntegrityError
when trying to
inject tools, due to a conflict in names.We now check for both
name
andclass_name
conflicts. If we try to
record aSCMTool
as aTool
, and either the name or class (but not
both) matches an existingTool
, 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.