Fixes T12623. Adds new modular transactions to Slowvote. Also converts
the shuffle column to bool for consistency with other boolean-ish columns.
Details
- Reviewers
epriestley - Group Reviewers
Blessed Reviewers - Maniphest Tasks
- T12623: Update Slowvote for Modular Transactions
- Commits
- rP0dc90b891a7c: Reimplement Slowvote transactions using modular transactions
Create a new vote, modified everything that could be modified from the web UI,
observed expected timeline.
Example timeline:
Example transaction values in DB:
Diff Detail
- Repository
- rP Phabricator
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Some minor things inline, yell if I made any of it up or it doesn't make sense or whatever?
src/applications/slowvote/xactions/PhabricatorSlowvoteCloseTransaction.php | ||
---|---|---|
9–19 | Per discussion elsewhere, you could use the "two int casts" here instead of "bool + bool + int", but they're basically equivalent. And "bool + bool + int" is actually better if/when we write a Conduit transaction.search sort of method (read all transactions for an object) since it's cleaner to expose true and false than 1 and 0. But we might need an indirection layer anyway ("get the API version of this transaction") and that could do all the casts, so who knows. I think this is basically fine until the day when we eventually have some clarity around MySQL types vs Lisk types vs stored types vs API types. None of this stuff is too terribly difficult to fix retroactively later even if we end up making unexpected decisions. | |
62–64 | You can just omit this method since it doesn't do anything, I think. | |
src/applications/slowvote/xactions/PhabricatorSlowvoteDescriptionTransaction.php | ||
61–64 | (Can omit.) | |
src/applications/slowvote/xactions/PhabricatorSlowvoteResponsesTransaction.php | ||
10–12 | I think you should be able to omit this case and just return the (int) cast if you also set the response visibility to a valid value by default, which is generally desirable anyway. You can do this in initializeNewPoll() if the best default is complex, or just in protected $responseVisibility = ...; for simple values. | |
17 | (Stray debugging code.) | |
37–39 | Omit. | |
src/applications/slowvote/xactions/PhabricatorSlowvoteShuffleTransaction.php | ||
10–12 | Same as above -- with a sensible default on SlowvotePoll, you should be able to get rid fo this. |