Pass custom form data to SCMTool.check_repository().

Review Request #12577 — Created Sept. 2, 2022 and submitted — Latest diff uploaded

Information

Review Board
release-4.0.x

Reviewers

Review Board 3.0.16 introduced support for custom forms for SCMTools,
storing any saved fields in Repository.extra_data. However, this data
was never passed to check_repository(), meaning that validation could
not happen based on this data for plain SCMTools (though it was passed
to hosting services).

This change adds support for passing custom data to
check_repository(). This requires that the implementation supports
**kwargs (a deprecation warning will be emitted if not) and accepts
all arguments as keyword arguments in any order. This will be required
in Review Board 5. All custom form data will then be passed.

In the process, some of the RepositoryForm code has been cleaned up.
There was a _build_repository_extra_data() method that only worked for
hosting services, and was mostly made redundant when per-SCM subforms
were added. It's now been removed, utilizing the subform data instead.

Unit tests pass on Python 2 and 3.

Tested creating new GitHub repositories, verifying that hosting service
forms still worked correctly.

Tested creating new standard Git repositories, with and without the
updates to check_repository().

Tested creating a new repository for SOS making use of form data in
check_repository().

Commits

Files

    Loading...