Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
Left sync only is available to ui admin (datastore to active story).
It is necessary create to use in drush command.
Comment | File | Size | Author |
---|---|---|---|
#10 | interdiff-7-10.txt | 1.52 KB | edmargomes |
#10 | drush-left-sync-2460397-10.patch | 2.33 KB | edmargomes |
Comments
Comment #1
edmargomes CreditAttribution: edmargomes commentedThis solution create:
drush config-left-sync
or
drush clsyn
We have many problems when working with versioning settings using git, because when merging two branches that have configuration changes conflicts are generated in tracked.inc.
Another problem is when the csyn drush is unable to copy the datastore settings for ActiveStore, eg when fields are changed or removed from a node. This generates an error because the synchronization (csyn) when finishing the import stage, which was not successful, perform the export sending the fields that should no longer exist.
this solution read files in the config folder ignoring tracked.inc, this way is possible to use cm files in differents branchs using git since it doesn't make the export step.
Comment #2
edmargomes CreditAttribution: edmargomes commentedComment #3
sebas5384 CreditAttribution: sebas5384 commentedNice patch @edmargomes ! thanks!
Comment #4
heddnRemoved some commented out code and unused variables.
Comment #5
edmargomes CreditAttribution: edmargomes commentedThanks heddn!!!
I needed to create a new update.
The problem:
When you do not use preserve-tracked option, the command sync use stopTracking to remove untracke files, but the stopTraking is exporting all configurations (activestore to datastore) and is replacing the news configurations files.
This new patch only stop tracking in untrack files after import the configurations files.
Comment #6
heddnHere's an interdiff.
Comment #7
handrus CreditAttribution: handrus commentedWhen we need to stop tracking something left sync shouldn't try to detect dependecies.
Ex.: If I delete a field stop tracking will detect any content type that depends on it and try to stop tracking the entire CT.
The patch is very simple, just change the parameters sent to stopTracking.
Comment #8
heddnI don't think this is really needed. After posting the patch above, I ended up going a different route.
drush csyn --preserve-tracked seems to do it. It's just terribly documented
Comment #9
handrus CreditAttribution: handrus commented@heddn there is a HUGE difference to me:
This patch does it in a way that it blindly trust what is in the files
while --preserve-tracked does detect dependencies:
If I want to be 100% sure that all changes are moved, specially changes on dependencies, the first approach (in this patch) is still accomplishing it better.
Reason why I'm reopening this.
Comment #10
edmargomes CreditAttribution: edmargomes at Taller commentedHi Heddn,
Thanks about your comment.
But the feature is diferente. The --preserve-tracked doesn't call stop tracking. Look:
When you call the clsyn command, it will update the settings (active store) the same as the file folder (data store). Exemple, if you delete permissions configuration files and call left sync, the command will do stop the tracking in this configuration. It doesn't work with preserve tracked and if you call the csyn command the permissions will be created again.
I created preserve tracked in the left sync. But, after you comment, I review the code, and drush csyn --preserve-tracked and drush clsyn --preserve-tracked has the same result. Then I removed preserve tracked in clsyn.
thanks
Comment #12
cjwang18 CreditAttribution: cjwang18 commentedUnfortunately none of the patches are working for me. There was something wrong while patching with #10 so I had to do it manually. Even then I'm getting a PDO exception (integrity constraint violation, 1062 duplicate entry)
I'm not 100% sure but I have a feeling it's because the left sync is writing datastore into activestore so it's creating rows in the database but not checking whether that row already exists. Hopefully someone can confirm and/or offer a solution.
I'm running the latest 2.x dev version of Configuration and I also have the --only-modified patch applied. That doesn't seem to matter though as same issue occurs when I revert to alpha3. Here's the stacktrace for reference.
Thanks!
----
EDIT:
Nevermind, I read through the comments again and can confirm that
drush csync --preserve-tracked
does indeed work for this use case. It's also working with --only-modified too. Thanks!Comment #13
handrus CreditAttribution: handrus commentedCan someone review and apply #10?
I've being using it for a year in production without any problems.