Ref T9838.
Add a Properties field to Revision, and update a wasAcceptedBeforeClose when closing a revision.
Differential D15085
Revision substate CLOSED_FROM_ACCEPTED avivey on Jan 22 2016, 3:07 AM. Authored by Tags None Referenced Files
Subscribers
Details
Ref T9838. Add a Properties field to Revision, and update a wasAcceptedBeforeClose when closing a revision. A quick run through the obvious steps (Close with commit/manually, with or w/o accept) and calling differential.query shows the wasAcceptedBeforeClose property was setup correctly. Pushing closed + accepted passes the relevant herald, which was my immediate issue; Pushing un-accepted is blocked.
Diff Detail
Event TimelineComment Actions @epriestley, can you take a look at this? Alternatively, I'll be happy to copy the existing logic from DiffusionCommitRevisionAcceptedHeraldField to DiffusionPreCommitContentRevisionAcceptedHeraldField, and leave the sub-state implementation to some later day. Comment Actions I think making this an entirely different state (i.e., "Closed" and "Closed from Accepted" being two different states) is probably a messier change than we need to make. What do you think about this instead?
On adding the flag, it might be better to just add a properties JSON field for flexibility instead of a wasAcceptedBeforeClose column, since the cost of the SQL migration should be the same either way, and I suspect we'll have more of these in the future once stuff like --try ("don't submit for review until tests pass") gets implemented, and we don't have any cases in mind where we need to query by this flag. I think that would make this a lot simpler and allow us to get away without D15084 or the pain of an arc soft version break (older versions of arc not understanding how to handle this status). I don't really see any downsides -- anything I'm missing? Comment Actions I'll give it a go; I wasn't easy with the extent of this change. Maybe instead of wasAcceptedBeforeClose property, use a substate property? Would that save another change later? Comment Actions If you just add properties as a JSON field, the actual call would be setProperty('wasAcceptedBeforeClose', true) or whatever, and we have limitless power beyond that. Comment Actions (I feel like most newer objects are getting properties fields or similar these days, since we almost always find something useful to do with them.) Comment Actions Start re-writing with property instead of new state. This is very broken, I'll dig in later this week to see why. Comment Actions Some inlines, including one likely (very minor) functional issue, but this looks reasonable to me overall.
|