GSoC 16 - Developing the Conflict Module - Week 7

Submitted by rakesh on Wed, 07/20/2016 - 01:59

Project Details: With the introduction of Multiversion module in Drupal 8, we have a very powerful content revision API that can handle branching and conflict DETECTION. But there is not yet a way to SOLVE revision conflicts.

Proposed Solution: We store a graph of all the updated revisions from an entity and find a base revision from this graph with which two entities can be compared. This process is based on 3-way merge algorithm. According to this algorithm, we shall compare two revisions of an entity with another revision or actual node to detect what has been modified in those revisions. If the new revisions has modified content over different lines, the updated content shall be merged in the new revision along with the unchanged data from previous revisions. This is why we compare two entities with a base entity, to find out which part has been modified in the new revisions. If both the new revisions has modified the same data, a merge conflict would occur and user would be allowed to solve the conflict in a 3-pane window. You can find more about the project and the approach in the 3rd week blog post at my blog.

Work we did last week: We finished writing code for simple LCA resolver along with tests and after that we started our work to implement a simple merge resolver for linear entities in drupal. We started by writing basic services, creating containers and I spent lot more time in reading about Symfony framework and Drupal8 module development.

Work we did this week: We are done with the simple merge resolver as well now. The task was to resolve merge conflicts in linear entities which drupal implements by default. The approach we took for this was to return the entity last created in the revision. This way, the entity which was created last would be returned as it is the latest entity. We have also written tests for it. The code for the library can be found on the github repository.

Next week’s task: After we’re done with the extensive testing of this simple merge resolver, we will start our major task with the complicated lca resolver where we’d integrate the library we created in coding phase 1 to find LCA with Drupal8 Conflict module. Our approach will be the same - write tests first and then code.

My mentors Dick Olsson, Andrei Jechiu and Tim Millwood have been really very supportive. Not only they have taught me how to code in a better way but they also help me understanding why it is important to test a software extensively. It’s only because of them I have came this far. All the credits to them only. I know my project is very interesting but the have made the whole journey interesting.