amateescu / revision_tree

Sandbox for Drupal's revision tree and related work
GNU General Public License v2.0
0 stars 0 forks source link

Add workspace compare views plugins, add tests #5

Closed monya007 closed 5 years ago

pmelab commented 5 years ago

Good work so far!

I've spotted 2 issues:

  1. You are using hardcoded fields like vid and nid. But this should work for any entity type.
  2. I just realized that we can't count just "all" revisions, but we have to limit them to the leaves of the tree.
live
  |    \
  l   stage
  |   /
live
  |  \
  |   stage
live

In this case live has more revisions in total, but its a conflict because just both workspaces have a leaf associated.

@amateescu Do you happen to have input on how to properly query for changed/conflicted entities with views?

amateescu commented 5 years ago

I don't think there's an easy way to compare conflicting revisions because this needs to be done at "runtime", when we actually have two entity revision objects to compare.

As for changed revisions, you're right above, we need to check the leaves of the tree.

amateescu commented 5 years ago

Btw, is this feature supposed to handle comparisons only with the direct parent of a workspace?

For example, in a three workspace scenario (dev -> stage -> live), the views field and filter provided in this PR can only compare between dev and stage or between stage and live, right? Because if we want to be able to compare dev directly to live, we need to make the condition on the workspace-reference field an OR condition that checks all the ancestors of a given workspace.

pmelab commented 5 years ago

This shouldn't compare the revisions contents. Its just about the tree. if there are two leaves, its a "conflict".

amateescu commented 5 years ago

Oh, okay, then I would change the 'conflict' wording with 'change' or something like that :)

pmelab commented 5 years ago

Moved to the delivery module.