For example:
If a pull request goes from Draft->In Review the FSM might perform an "assign reviewer" action.
If a PR goes from Changes Requested->In Review, there is already a reviewer assigned, so it just performs "notify reviewer".
For example:
If a pull request goes from Draft->In Review the FSM might perform an "assign reviewer" action.
If a PR goes from Changes Requested->In Review, there is already a reviewer assigned, so it just performs "notify reviewer".
Depending on the system and implementation constraints one type works better than the other (e.g. Mealy machines can implement Moore machine behavior with one less state, which may save hardware).
Draft->Closed/Abandoned
Draft->In Review
Changes Requested->In Review
I'm not sure "assign reviewer" would fit either in Draft.exit() or InReview.entry(). I guess you'd implement something like "ensure reviewer assigned" in InReview.entry() instead. Which would work, but would itself contain the sort of state-dependent logic that a state machine is meant to surface.
Or, perhaps an additional transitional state.