Hi all,
I am relatively new to git and Katalon so apologies for using simple terminology.
Myself and my colleagues use a singular repository only using master branch (we are only testing small things so it’s not necessary for us to have separate branches)
If I were to pull the repo, add a new test case and then commit and push my changes - it goes through fine but then I have a .prj appear in my unstaged changes every single commit. Does anyone know why this is and if I should be concerned by it? We often have issues where someone will attempt to open the project and they will get the <<>> issue so unsure if this is related (or the cause of that)
The <project name>.prj is a mandatory file in a Katalon project. Without the .prj, Katalon Studio and KRE would not recognize the folder/files as a Katalon Project.
The .prj file should be contained in the git repository.
Therefore the .gitignore file MUST NOT have a line
<project name>.prj
So, @bellis should check if his git repository contains the .prj file, or not.
If not, @bellis must add, commit and push the .prj file. After that, the team must pull the repository into their own machine.
I don’t see what’s going on in your system.
There must be something unusual but I can not find it remotely.
You should look at your system more closely and find the cause yourself.
You wrote that a .prj file suddenly appears in the unstaged status.
This implies that the .prj file was changed somehow.
You can take a diff information of the file between the working directory and the commited HEAD. Use “get diff” command.
$ cd <project directory>
$ git diff <projectname>.prj
This command will show you how the .prj file has been changed since it has commited last.
The diff information may suggest something to you.
You may get some idea what’s going on with it.
Here I would copy&paste an .prj file of my project:
I noticed this behavior since 2 months. I usually just refresh the project before commit and it shows all the changes that wasn’t showing before (not just .prj files).
I don’t bother with reporting bugs to katalon anymore (I have several bugs that i reported and none were fixed yet) as they seem to be too busy developing things nobody uses to offer in sales and marketing instead of fixing things for current users
Like previously sad, the .prj file contains a “path” to your project. like "C:\Users\USERNAME\katalon\projectname.prj"
and other project specific settings, like the type of the project, pageLoadTimeout etc.
The path will probably be different for every member in your team, because the username can be different and also the project folder can be placed in a different place on different computers, and that can cause git to detect a change. This is beneficial for you that git tells you about the changes, because if the project settings change that can affect other people using the same project.
But the time the changes happen is a bit unusual, at least that is what I experienced.
You clone the project or pull the project and open it through katalon, the .prj file contains your colleague’s path to the project.
You can open the project and it will work, the path will not change just by opening the project.
It won’t change if you edit the test cases.
It won’t change when you save your progress.
And then one day it will seemingly “randomly” update to your path to the project.
But this is for example after the project settings are changed and you click “Apply”. It has multiple more triggers, like refreshing the project etc. You can check it out for yourself what are the triggers if you like.
So this is why it seems to randomly appear.
This is just how it works, maybe it was not the intended way for it to only update when this happens. I know it can be a bit weird to have changes appear that you did not do on purpose and don’t understand where they came from, but by understanding the working mechanism and what the file does, you can better manage your project.
You can ignore the file changes if it only occurs in the path, it is specific to every computer either way. So you can have a version on the remote repo that you aggree with your colleagues to not change when you commit, you always git restore the file before you commit or before you pull from the repo, and then it will not have a conflict only because the different path.
But if the project settings change (and it is intended to change for everybody using the project), than you have to push the changed .prj file to the repo, and git will inform people of the changes when they pull.
I aggree so much with what you said. I think you kindof have to learn to live with things, because they will not fix it for a looong time. But have 4 new versions with new stuff. And any new release will just mess up already working parts…
I didn’t know that: the way how .prj files are updated. I do not have a team who shares a single Katalon project, so that I have never seen a .prj file is updated by somebody else. I could confirm this behavior using 2 machines: my mac and windows.
Why? — When we let KS open a project, always, we are supposed to tell KS in which directory to look for the the .prj file. Once KS successfully opened a project, then KS must be already aware of the correct location of the .prj file. Any reason to look for the <projectFileLocation> in a .prj file? — No.
Also, what happens? if my KS opens a project with a .prj file with
<projectFileLocation>a path that actually doesn’t exist</projectFileLocation>
Nothing serious happens. Once I found a Windows path on my mac. It’s ridiculous, but does not really matter.
Having <projectFileLocation> element in a .prj file makes no harm as long as the project is personal; as long as the project isn’t shared using Git by a team of developers. I believe, the format of .prj file was initially designed without Git in mind.
Now, here is @bellis. He was annoyed by <projectFileLocation>. It will annoy more teams in future.
Thank you, @bellis , for letting us know of this bug.
I suppose that Katalon can not remove the projectFileLocation out of the .prj file for the backward compatibility.
However, a newer version of Katalon can stop updating the projectFileLocation. In the “Project Settings” dialog, just Katalon can display the path dynamically calculated; it does not need to read the xml element. This change won’t break the backward compatibility; and .prj file will no longer be updated needlessly.
If Katalon will leave the product unchanged as is, then you should describe this stuff in the official document. You shouldn’t leave your users puzzled by the .prj file.