Add helpful information for conflicting SCMTool/Tool entries.

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

Information

Review Board
release-5.0.x

Reviewers

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.

Summary ID
Add helpful information for conflicting SCMTool/Tool entries.
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.
8ff9f8c92085a3927834d1aa37c02d3ca22ffc15

david
  1. Ship It!
  2. 
      
maubin
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-5.0.x (c1c2cde)
Loading...