Convert RepositoryTypeCondition to store SCMTool ID instead of Tool PK.
Review Request #12336 — Created June 3, 2022 and submitted — Latest diff uploaded
One of the last places where we were using the old
Toolmodel was the
"Repository Type" condition for integration configurations. This used
theBaseConditionModelMultipleChoiceto show a multiple choice field
with the various registered repository types. This meant that the form
field was populated using the contents of the Tool table, and selected
values were stored as the primary keys of the selectedToolinstances.This change makes it so the
RepositoryTypeChoiceinstead loads its
values from the new SCMTools registry, using the SCMTool ID as the key.
In order to handle any existing integration configurations, a new stage
has been added to the upgrade to look through existing integration
configurations and update them.
- Created and edited integration configurations using various usage of
the "Repository Type" choice. Saw that everything was loaded from and
saved to the database correctly. - Created several integration configurations using the "Repository Type"
choice and then ran the upgrade. Saw that old lists of integers
(ToolPKs) were updated to be lists of strings corresponding to the
correct SCMTool IDs. - Ran unit tests.