I am a big supporter of source control for Xpage applications. With Cameron Gregor‘s release of Swiper 1.0.2, there’s no good reason not to use source control in your applications. However, I came upon a problem and I would like to ask the experts who use source control in a team to help me with a work-around.
Here is the simple scenario. There are two developers working on the same project using Domino Designer and Source Tree with a git repository and they use git flow for branch control. The master branch of the project contains a spectacular XPage with two panels:
Developer 1 decides to create a new feature branch:
And adds the new feature button to Panel 1 and diligently commits the changes to the feature branch. Now the XPage looks like this:
Meanwhile, Developer 2 checks out the master branch, creates a new feature branch, called, Panel2_button and adds a feature button to, surprise, surprise, Panel 2 and, since he’s a good developer commits his changes with no delay. The project looks like this for Developer 2:
Right now, the project looks like this in Source Tree. We have two features unfinished and a master branch with just the two panels.
Everybody is happy, so Developer 1 is satisfied and finishes his feature and merges the changes back to the developer branch. There are no merging conflicts and the project looks like this. The develop branch moves top the finished Panel1_button feature.
Developer 2 is also happy and he finishes his Panel2_button feature. SourceTree does its job and merges the branches together without any conflicts.
Now the project looks like this in Designer:
However, we have a problem:
The two buttons have identical ids, and DDE cannot build the project. Unfortunately, whenever a developer drags a component to an XPage, the IDE gives it a default id and name (i.e. button1, label1, view1 …). Most of the time, that is perfectly fine, but in a scenario when a team works together on the same project on the same Xpage, this can lead to errors that SourceTree/git cannot figure out and will merge branches without any conflicts.
Obviously, this example is over-simplified to illustrate the problem. A dragged in element can be used at many different places and that can create a re-factoring nightmare.
It’s possible to agree in a team that “only one feature can be open at a time“. That kind of kills the team development spirit, though.
A team can agree to give unique ids to every element, datasource etc. on an XPage, so these conflicts can be avoided; but then everybody needs to abide by this rule.
These are just ideas that I came up with, I hope others can share their team workflow.
Advice from Cameron Gregor