Problem
Currently, Deploy will push conflicts between Workspaces without notifying the user. This could mean data loss, at least as far as the user is concerned.
Longer explanation about data loss: the data isn't lost, it's still in the database, it's just there's no way to resolve conflicts at present. So, for example, say Workspace B has its upstream set to Workspace A and let's say they both have a node entity titled "Rabbit". Let's say A has revision 1 of this entity and B has revision 2, when A is deployed to B, there will be a conflict. Both revisions will be stored, however, a revision 3 will be created that is the arbitrary winner of these revisions. Let's say the winner was revision 2, but the user wanted revision 1, they currently have no way to get back to revision 1.
Longer explanation about replication: When a deployment is created, it calls the "replicate" method on the replicator. The replicator will do two things: (A) update the current Workspace with data from its upstream, and then (B) push changes to that upstream. Implicit in this is that conflicts are not discovered until step A, which means the caller of replicate has no way to know if conflicts are being pushed upstream.
Proposed Solution
The Workspace module as of #2791789: Workspace should report conflicts before replication has solved this problem for this module.
That ticket adds a flag that tells the replicator to abort if conflicts are discovered during replication. This is done through setting a static variable "workspace_is_aborted_on_conflicts". Deploy should be updated to set this value to TRUE by default to prevent the user from unknowingly pushing conflicts upstream. Additionally, a user input should be created on any form that triggers a deployment to allow the user to set this variable and push those conflicts upstream if they wish.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | interdiff.txt | 10.21 KB | jeqq |
| #8 | deploy_should_report-2815883-8.patch | 16.57 KB | jeqq |
| #4 | deploy_should_report-2815883-4.patch | 7.43 KB | jeqq |
| #3 | Screenshot from 2016-10-10 10-03-15.png | 32.39 KB | josephdpurcell |
| #3 | Screenshot from 2016-10-10 10-01-41.png | 62.91 KB | josephdpurcell |
Comments
Comment #2
josephdpurcell commentedI created this patch in ~10 mins, so it's not tested and needs some love, but it should show an example of (a) what needs exposed to the user, and (b) what variable Deploy needs to set to properly handle replication.
This patch needs some cleanup, e.g. ordering the fields so that the notification and radio button shows at the top. It also needs tests.
Comment #3
josephdpurcell commentedHere are screenshots of what this currently looks like.
Comment #4
jeqq commentedA patch reroll. Testing it manually.
Comment #5
jeqq commentedComment #6
jeqq commentedComment #7
jeqq commentedComment #8
jeqq commentedMore fixes. Implemented a test.
Comment #10
jeqq commentedThe test is failing because it's using Workspace alpha version for testing, but conflict reporting functionality is still in dev version.
Comment #13
jeqq commented