Salesforcedx-vscode: Compare & Resolve Conflicts on Deploy

Created on 14 Jan 2019  路  4Comments  路  Source: forcedotcom/salesforcedx-vscode

There are several scenarios where developers can run into conflicts. When working against a scratch org, source:push/pull will detect conflicts and warn the developer of local or remote files that have changes that cannot be resolved. When working against non-scratch orgs, we will also be adding some basic conflict detection on source:deploy/retrieve (see: #633). In both of these cases, the only thing we currently do is fail the operation and warn the user of the conflicts. The only way to resolve the conflicts is to manually determine what files changed, manually merge/delete/etc. and then repeat the push/pull/deploy/retrieve operation with the --force flag. While it is good that developers are warned as to not overwrite files, the task of resolving conflicts is difficult.

A more desirable option would be to replicate what VS Code does for git workflows and allow the user to review and merge conflicts using the UI. See: https://code.visualstudio.com/docs/editor/versioncontrol#_merge-conflicts

deploretrieve feature

Most helpful comment

As requested, here is our use case for Conflict detection on Deploy/Retrieve. We are excited about this planned feature. While we use git religiously, we are not ready yet for CI. Our highly integrated and ever-evolving data model makes creating new sandboxes very time-consuming. We therefore work in shared project sandboxes, ostensibly in different parts of the code. However, utility, service, and model classes are occasionally contention points when two of us accidentally start modifying those files simultaneously. When we recognize that, we can negotiate. The danger is that we won鈥檛 recognize it, and will overwrite one another鈥檚 changes. We have a work-around in place that forces a git pull/push to a shared repository before every save to the org. If the pull fails due to a file conflict, the deploy to the org does not occur. It works. But it is slow. If the conflicts could be detected on Deploy/Retrieve, we could return to a more standard model of pushing to git several times a day, not every few minutes, saving considerable time, and making our git history more useful.

While conflict resolution tools would be useful, simple conflict detection would be a huge step foward for us. Thank you for everything you are doing with this tool!

All 4 comments

When you say "Deploy", does it includes saving from vscode to a sandbox ?

@FabienTaillon It will be for any type of org. I just updated the description with the basic info.

As requested, here is our use case for Conflict detection on Deploy/Retrieve. We are excited about this planned feature. While we use git religiously, we are not ready yet for CI. Our highly integrated and ever-evolving data model makes creating new sandboxes very time-consuming. We therefore work in shared project sandboxes, ostensibly in different parts of the code. However, utility, service, and model classes are occasionally contention points when two of us accidentally start modifying those files simultaneously. When we recognize that, we can negotiate. The danger is that we won鈥檛 recognize it, and will overwrite one another鈥檚 changes. We have a work-around in place that forces a git pull/push to a shared repository before every save to the org. If the pull fails due to a file conflict, the deploy to the org does not occur. It works. But it is slow. If the conflicts could be detected on Deploy/Retrieve, we could return to a more standard model of pushing to git several times a day, not every few minutes, saving considerable time, and making our git history more useful.

While conflict resolution tools would be useful, simple conflict detection would be a huge step foward for us. Thank you for everything you are doing with this tool!

Our first iteration of Conflict Detection is now live. Check out the details in our [documentation] (https://developer.salesforce.com/tools/vscode/en/user-guide/detect-conflicts). We鈥檇 like your input on the next iteration - please review the spec & add comments there with any feedback. Closing this issue to consolidate the conversation to one place.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shunkosa picture shunkosa  路  6Comments

simonfoden picture simonfoden  路  6Comments

vtandon-wiley picture vtandon-wiley  路  3Comments

ghost picture ghost  路  5Comments

Bgallahue picture Bgallahue  路  3Comments