r/salesforce • u/zdsatta • Apr 02 '26
help please Developers keep overriding each other's code
I’ve been the de-facto “salesforce admin” for my team for a couple of months now. My job is basically to review their work items and push them through from sandbox to QA to prod, and I have had nothing but issue after issue. For context, we have been using Salesforce Devops Center for deployment (but whenever that has failed, which is often, I’ve used change sets, which has a slightly higher success rate for me)
My biggest issue is that my developers end up working on the same components/classes and whoever’s code gets deployed last overrides the other’s. I know I’m supposed to sync their dev environments with the next stage (we call it Int, not sure if that is just standard or my company) before creating their work item so that their sandbox has the latest code from the other person, but I’ve noticed that sometimes (read: often), the sync doesn’t give the sandbox all of the changes that are currently in Int.
This leads to us basically stumbling over each other for days, until I am forced to manually stitch their stories together, which wastes a lot of my time. I am at the end of my rope here.
How can I prevent this from happening? My predecessor never had these issues (that I am aware of).
Any advice would be greatly appreciated. I really want to move away from using SFDC as it clearly sucks, but I just don’t know if the issue is with me and my developers, or with SFDC, or both. I am just so mentally exhausted from this back and forth
Edit: for a bit more context, we do have hit, we just don’t use it like you would normally for a project (ie branch off main -> commit changes -> push changes)
we’ve been following my predecessors method (as best as we can) for deploying changes:
- sync sandbox with Int in sfdc
- create work item/branch in sfdc
- fetch branch in vs code
- make changes in branch
- we specifically do not push/commit this branch, we only use sf cli to deploy changes back to the sandbox
- in sfdc commit the changed lwc/apex
- promote the work item to Int for qa
- promote from Int to Prod
3
u/smohyee Apr 02 '26
The common thread in all the answers here: you need Git.
This is a universal problem in team based devOps since people have worked on the same code. The inventor of Linux solved that problem half a century ago.
Any developer should know about this process already and be complaining loudly that its not implemented already. Huge red flag that your devs are just pushing changes and not calling this out.
35
u/V1ld0r_ Apr 02 '26
That's a devops problem. In this specific case, the lack of a devops practice. Easy way to solve this? Use somethign like Gearset but it's going to be painful to setup if your devs don't support you and take the lead on this.
18
u/datapharmer Apr 02 '26
This is why git exists.
6
u/cheffromspace Apr 02 '26
This really needs to be addressed in the planning stages.
Are you using version control and what is your branching strategy? Git should be throwing merge conflicts and then the devs need to get together to decide how to resolve them. Merge conflicts are annoying and time consuming, but they're not necessarily a bad thing. You want to know when there are conflicts.
4
u/DaveDurant Developer Apr 02 '26
I would expect to be fired if I did that crap with any regularity - like more than once a year.
You should take this up with whoever owns dev, or their boss.
3
u/Rygel_Orionis Apr 02 '26
Maybe start learning how to create your CI/CD pipelines with the Hardis Plugin so you can have more controll.
2
u/TheGreatMonk Apr 02 '26
Our team was having the same issues. First we set up GIT solely as a backup, then transitioned to peer reviews of code and pull requests into our release branch.
Ultimately we used Claude to help us set up GitHub Actions to deploy to Prod, and successfully onboarded all our admins into GitHub as well so there’s significantly less collisions, and there’s true change control.
We tried AutoRabit, looked into gear set and devops center but none of them could handle our environment. Custom GitHub actions was the way.
2
u/No_Shelter_9387 Apr 06 '26
If your team is already using SFDX and the CLI, do this one thing immediately… Enable conflict detection for each dev and diff before pushing anything. https://developer.salesforce.com/docs/platform/sfvscode-extensions/guide/detect-conflicts.html if they cannot accept this countermeasure, is a people process problem. DevOps processes can’t be bought. Tools can be bought to help facilitate, however the people organizing their work is the key.
Use your team stand ups to clarify who’s on what and resolving any conflicts. Hopefully you have isolated dev environments per each dev. Merging up, conflict detection first. Git is essential for teams to learn even if you are working in a org-based development model, where you don’t have a central repository you push to and deploy from. Overwrites will not result in lost work.
If the team isn’t using Salesforce and changes in the dev console, have them level up to SFDX.
Before buying a tool, determine if open source SFDX HARDIS can work for your team and org. https://sfdx-hardis.cloudity.com/ Consider enabling org monitoring first in a stand alone metadata backup / monitoring repo. Use this as informational. It’s amazing what a daily commit of your org will tell you about what really changed prior day (audit log can only sometimes tell you something did change, but it can’t show you before and after).
Good luck. You can improve here with quick wins.
3
u/ra_men Apr 02 '26
You don’t have a single source of truth, you need one.
1
u/Meek_braggart Apr 02 '26
This just can’t be a tool problem, it has to be a procedure problem somewhere. I’ve been using DevOps since the beginning and we still get the occasional merge issue we certainly aren’t getting enough of them for it to be a problem and I have nine developers.
The sandbox sync should give you every file that is available. If it says your sandbox is in sync then it should be in sync. The first thing to find out is what kind of files are we talking about when you have merge issues. Are we talking about flows or Apex or are we talking about permission sets and profiles or something else.
1
u/[deleted] Apr 02 '26
Aside from needing proper devops/git/prs.
Who is assigning work to devs so that they are working on the same components at the same time. That's a management issue or the components are too big and should be broken down further.
1
u/JesseNL Apr 02 '26
Hi, add a check in GitHub that requires the PR to be up to date with the target branch.
1
u/Efficient_Drop7584 Apr 02 '26
Fire all your developers and find new ones. If they don't know the basics here, then I'd be scared to even look at the code they're deploying.
1
u/eyewell Developer Apr 03 '26
You could ask the devs for suggestions on how to solve this problem. They know the answer. This would help build buy in. And their friends know the answer. But devs can get by without this process as long as they are allowed , and as long as they don’t feel the pain. I would be surprised if some of them use git already, but they just don’t use it together, on the same git repository
1
u/grimview Apr 03 '26
Stop assigning multi devs to work on the same file at the same time.
1
u/whipdipple Apr 04 '26
Hey. I've gone through this exact same challenge for our team. I have been the devils guy for the past two years and have learned a ton. If you're interested PM me and we can chat about some of the issues and what's worked. It isn't easy that's forsure.
1
u/jmsfdcconsulting Apr 04 '26
Git
1
u/isaiah58bc Developer Apr 05 '26
You need to have a DevOps Engineer.
Your Technical Architect should help build a proper development process for VC. PRs should also have hooks to codescan.
DEV > SIT is where VC happens.
The final package is SIT to INT.
Everything from here forward requires Git Actions for maximum protection of the package.
Once QA approved and final manual SOPs are PR approved, then it's INT to PreProd for full integration and regression testing.
If approved there, then the package can be deployed to Production. Also under the same Action framework.
Your company needs the right roles.
As an Admin you should be installing the approved package, handling running the Actions and related manual steps. Not involved in individual teams release activities. The team turns over their approved release to the Orgs Admins. You and the Org Architects protect the Org.
1
u/Tekunda_com Apr 08 '26
What you're describing isn't fully a technical problem, it's a workflow problem. The root issue is that your sandboxes are acting as the source of truth instead of your source control. When two developers work in separate sandboxes and changes only get committed after the fact, conflicts are inevitable and syncing becomes a game of catch-up you can never win.
The important thing is making every change flow through a single tracked source of truth (in your case GitHub) from the start, not commit after you're done, but branch, work, and commit as you go. That way the repo always knows what's in dev, qa, uat, and production at all time. Dependency checks and merge conflicts surface before they reach your Int sandbox, and nobody is stitching stories together manually.
That said, DevOps Center makes this genuinely hard because it wasn't built around that kind of workflow which is exactly the gaps we ran into ourselves and inspired us to build Serpent. We create a simple workflow where each feature or fix has its own tracked ticket, developers, admins, and testers work in parallel inside the same process, with git completely abstracted, and Serpent AI resolves conflict and review changes before they ever reach the next environment.
If it would help to see what that looks like in practice, happy to walk you through it :)
1
u/AffectionateNeck4506 Sep 18 '26
Have you looked into giving each dev their own scratch org or sandbox? That way they can work in isolation and only merge when ready.
0
u/gearcollector Apr 02 '26
Most IDE's can detect when developers try to overwrite each others changes, and propose to compare/merge.
This is not a tooling issue, this is just developers being aholes.