Skip to content
This repository has been archived by the owner on Oct 16, 2023. It is now read-only.

Feature: Migrate Forms #208

Merged
merged 37 commits into from
Jul 19, 2023
Merged

Feature: Migrate Forms #208

merged 37 commits into from
Jul 19, 2023

Conversation

kjohnson
Copy link
Member

@kjohnson kjohnson commented Jun 30, 2023

Description

This PR introduces a pipeline of migration steps for creating a v3 form from a v2 form and is intended to integrate with the Forms Table UI (updates for which are in a separate PR).

For development, testing, and troubleshooting the migration steps can be run from the command line and inspected one at a time.

wp givewp form:migrate {$id} --step

Architecture

The form migration logic is organized into "steps" which are run sequentially via a "pipeline" and a step "processor". The pipeline organizes the steps in sequence and supports before/after hooks for debugging. Each step is conditionally handled by the step processor, which checks an optional canHandle() method of the step class.

@kjohnson kjohnson requested a review from alaca June 30, 2023 15:33
Copy link
Member

@alaca alaca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like how you organized everything and that you are using the pipeline pattern. Looks very clean and solid. Also, adding support for CLI is a great addition. Migrate endpoint supports only one ID per request, which is fine for now, but maybe it will be a good idea to add support for bulk actions now so that we don't have to change frontend requests later, but I'll leave that decision to you.
The only thing that is missing in this PR are class comments with a short description of the class and of course, unreleased tags 😄
Other than that, this looks great. Excellent work @kjohnson

@kjohnson kjohnson marked this pull request as ready for review July 17, 2023 16:07
@kjohnson kjohnson requested a review from alaca July 18, 2023 15:42
Copy link
Member

@alaca alaca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍
The only missing things are class comments and unreleased tags. Also, reformat the code using GiveWP coding standards and we are good to 🚀
Great work @kjohnson

src/FormMigration/Controllers/MigrationController.php Outdated Show resolved Hide resolved
@kjohnson kjohnson merged commit 47f4e2c into develop Jul 19, 2023
@kjohnson kjohnson deleted the feature/form-migration-server branch July 25, 2023 20:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants