AnsweredAssumed Answered

How to avoid workflow conflicts in git repository

Question asked by Derick van Niekerk on Nov 29, 2016

We are managing our codebase in a git repository. From suggestions from several forums and the official SugarCRM developer docs, I have a .gitignore as follows:

 

 

## SugarCRM
# Adapted from Sugar docs at https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_7.7/Introduction/Development_Methodology/


# Ignore custom .htaccess stuff.
.htaccess

 

# Ignore the cache directory completely.
/cache/
!/cache/index.html

 

# Ignore some files and directories from the custom directory.
/custom/history/
/custom/modules/*/Ext/
/custom/application/
/custom/blowfish/

 

# Custom configuration should also be ignored.
/config.php
/config_override.php
/custom/modules/Connectors/connectors/sources/ext/soap/marketo/config.php

 

# The silent upgrade scripts aren't needed.
/silentUpgrade*.php

 

# Log files can safely be ignored.
*.log

 

# Ignore the new upload directories.
/upload/
!/upload/index.html
/upload_backup/

 

# IDE project files
target
target-eclipse
.project
.classpath
.idea
nbproject

 

For the most part, this works great. However I get nasty conflicts in /custom/modules/<module>/workflow/workflow.php every time I try to merge feature branches. It seems that these workflow files change every time a repair is run. Deleting the workflow files breaks the application, however. The conflict is always just a guid changing in the code, nothing else changes:

 


<<<<<<< HEAD
if (!isset($triggeredWorkflows['de4dd2cb_f57d_9c51_43c5_583c8b4841aa'])){
$triggeredWorkflows['de4dd2cb_f57d_9c51_43c5_583c8b4841aa'] = true;
=======
if (!isset($triggeredWorkflows['6a858297_9fa0_aac7_f08c_583b50cc7829'])){
$triggeredWorkflows['6a858297_9fa0_aac7_f08c_583b50cc7829'] = true;
>>>>>>> master

Usually there are a few dozen instances of this.

 

There is usually also a conflict in /custom/workflow/plugins/plugin_list.php :

<<<<<<< HEAD
// created: 2016-11-29 14:56:00
=======

// created: 2016-11-30 09:50:00
>>>>>>> master

 

Ideally these files should be in .gitignore, but it causes sugar to break if they are.

 

How can I manage this within the repository so I don't get these conflicts. It's easy to resolve, but very time consuming.

Outcomes