Add SCMTool.lookup_name, and use it instead of name for registration.
Review Request #13475 — Created Jan. 2, 2024 and submitted
We'll soon be in a position where one of our bundled SCMTools will need
its name changed. Doing so would result inTool
DB entry conflicts and
registry lookup issues, impacting the API and repositories.To prepare for this, a new attribute is being introduced to provide a
stable name for lookup purposes:SCMTool.lookup_name
.This defaults to
SCMTool.name
(by way of an overridable
classproperty
). Subclasses can override this to specify an explicit
name when they're going to change theirname
property.
lookup_name
is used for registration, lookup, conflict resolution, and
Tool
object creation. This ensures that, behind the scenes, nothing
changes for any tools. We simply need to make sure we setlookup_name
on anySCMTool
when we're ready to changename
.
Unit tests pass.
Tested this with the upcoming Plastic work, ensuring that the tool and
all registry-related operations worked when changingname
and setting
lookup_name
.
Summary | ID |
---|---|
a15f7a0c7b3094462f93187f2936c0d239fb827c |