Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPIKE: Exploring the WP state change machine to create custom transitions #47

Open
PriyaBhatia0210 opened this issue Nov 10, 2020 · 1 comment
Assignees
Labels
could have Could be done, or nice to have, low priority for now spike An investigation needed in order to refine & estimate a story

Comments

@PriyaBhatia0210
Copy link

PriyaBhatia0210 commented Nov 10, 2020

Breaking up the technical research required for our Workflows solution into following constituent pieces:

In this issue, we'd like to explore what does the WP state change machine entail for creation of custom transitions.

Requirements

  1. The ability to create custom transitions between states created in Research: Exploring the WP state change machine to create custom statuses #46
  2. The ability to properly design/specify what each transition does eg: Only the author can take a published post to a 'Back to Draft' state to make changes or a 'Under review' state should not be allowed to publish
  3. The ability to specify user permissions for certain transitions eg: Only the author or their superior or admin has the permissions to 'Archive' a post
  4. The ability to block certain transitions eg: An archived post cannot be taken to a draft state directly. It needs to be unarchived first.

Timebox: 1 day

@PriyaBhatia0210 PriyaBhatia0210 added this to the 6.0 milestone Nov 10, 2020
@PriyaBhatia0210 PriyaBhatia0210 added spike An investigation needed in order to refine & estimate a story and removed enhancement labels Nov 10, 2020
@PriyaBhatia0210
Copy link
Author

Proposed tactic:
(courtesy @rmccue)

Step 1 of this would be to model the state machine using something like XState which can produce a machine-readable version of the state machine in e.g. SCXML.

We can then build atop that and rebuild the state transitions on top of that by unhooking large parts of core and rehooking them in based on the state machine.

Changing the state machine would then be a fairly logical and consistent process, because all transitions would then go via the state machine rather than being hacked around everywhere in core.

This is a decent amount of work, but the largest part by far is breaking down core and rebuilding it. I actually think there's a decent chance we could do this in core itself if it were designed well. If we don't do that, it'll be brittle and require maintenance in every release, plus verification of changes.

@jennybeaumont jennybeaumont changed the title Research: Exploring the WP state change machine to create custom transitions SPIKE: Exploring the WP state change machine to create custom transitions Dec 8, 2020
@jennybeaumont jennybeaumont removed this from the 6.0 milestone Feb 5, 2021
@PriyaBhatia0210 PriyaBhatia0210 added the could have Could be done, or nice to have, low priority for now label Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
could have Could be done, or nice to have, low priority for now spike An investigation needed in order to refine & estimate a story
Projects
None yet
Development

No branches or pull requests

4 participants