Code commits marked as new files when they aren't new

While doing code reviews with Upsource, we have realized that some of the files included in the code commits are marked as new files (colored in green) (Image: http://i.imgur.com/qLN1OmP.png) even when they are pretty old versioned files. Hence instead of seeing only the new code changes we see the whole file as new. We are using upsource version (2.0.3462) and git as our version control system. We tried to figure out a pattern which could be causing this but weren't able to. Any hints for troubleshooting?

15 comments
Comment actions Permalink

It would be great if you could derive the pattern why they are marked so, or give us a hint how could we reproduce this problem

Thank you in advance

0
Comment actions Permalink

It seems the issue is seen whenever the source file is first indexed by upsource.

0
Comment actions Permalink

Could you please type following:
path: problem_file_name
in "Search revisions" and hit enter.
Upsource will find all the revisions with the file changed. Only one green plus for a single file should be displayed (in earliest commit). Please make a screenshot if it is not.

0
Comment actions Permalink

I took a couple of screenshots. The UI got distorted for the first one (Image: http://i.imgur.com/dVcOEiT.png). In the second screenshot you could see that when the file got first indexed it got marked as green (new) (Image : http://i.imgur.com/bDiyNpZ.png)

0
Comment actions Permalink

Concerning distorted UI we have corresponding issue https://youtrack.jetbrains.com/issue/UP-4529 feel free to vote up.
Please do as follows:
1. repeat query "path: {ReturnedRequestViewServiceInternal.java}"
2. expand "changes for OF-23107"  revision (cfac8a0)
3. expand ReturnedRequestViewServiceInternal.java
4. click "View file" button
5. click History button
6. expand top 3 revisions
7. Make screenshot

0
Comment actions Permalink

I have mailed the screenshots at 'upsource-support@jetbrains.com'

0
Comment actions Permalink

Thank you for the screenshots. Now it is clear:
As you can see on history_commit1.png the file had been removed (-56 lines in diff summary) by commit fb15b70 on may 13.
So it is marked as new in "changes for OF-23107"  revision (cfac8a0) +56 lines in diff summary.

0
Comment actions Permalink

So you found the root cause? Is it something that needs to be fixed in upsource or some config is causing this?

0
Comment actions Permalink

This is exact behavior we expect of Upsource.
What would you expect in this case?

0
Comment actions Permalink

Shouldn't it give only the diff instead of marking the file as new (since it is not a newly added file)?
Is upsource not able to determine that because it rely's on the indexing feature? Can it determine it by some other way (reading git config files)?

0
Comment actions Permalink

>Shouldn't it give only the diff instead of marking the file as new
It does give diff.
>(since it is not a newly added file)?
File is newly added since it'd been removed in the branch on May 13

Lets sort it out:
Upsource marks the file as added in revision cfac8a0 because NO such file in parent revision.
You can check it by doing following:

1. in "Serach revisions" type "around:cfac8a0" and hit enter.
2. In the revision list displayed click on commit message of revision just under the cfac8a0. It will be parent revision.
3. Click "Browse code" and navigate to "optymyze-java/modules/workflowviews/src/main/java/comspmsoftware/returnedrequestsviews/service"
4. make sure the file is absent

the reason it is absent is commit fb15b70 which is predecessor for both cfac8a0 and its parent
Type id:fb15b70 in "Serach revisions" and hit enter. Click on the revision. You will see file is removed in this revision

0
Comment actions Permalink

I didn't follow your explaination

File is newly added since it'd been removed in the branch on May 13

This source file has been committed in git since Jan 2014. It has gone through multiple revisions after that.

1. in "Serach revisions" type "around:cfac8a0" and hit enter.
2. In the revision list displayed click on commit message of revision just under the cfac8a0. It will be parent revision.
3. Click "Browse code" and navigate to "optymyze-java/modules/workflowviews/src/main/java/comspmsoftware/returnedrequestsviews/service"
4. make sure the file is absent

I followed these steps and found the file to be absent but isn't it because the file wasn't indexed by upsource. My understanding of the issue is this - The reason it is marked as a new file in upsource is because first commit on any file gets indexed. Because it is the first time upsource indexes this file it assumes its a new file. Is that true?

0
Comment actions Permalink

>The reason it is marked as a new file in upsource is because first commit on any file gets indexed. Because it is the first time upsource indexes this file it assumes its a new file. Is that true?

It is not true.
Upsource marks file as newly added in the only case: NO such file in parent revision.

0
Comment actions Permalink

Ok. If that's the way it is programmed to work, no issues. The reason I raised this issue is it isn't help out in doing code-reviews. It is giving false information.

0
Comment actions Permalink

>It is giving false information.
What do you think is false in this behavior? My explanation:
>This source file has been committed in git since Jan 2014. It has gone through multiple revisions after that

Thats exatly what upsource displays when you check file history in repo. Just type "path:file_name" in Search revision you will see first commit (at the bottom) on Jan 2014 file is added. Above commits in which file is changed. Commit fb15b70 on May 13 file is removed. and finally it is added once again by commit cfac8a0.
The same you can see in History tab of "View file"

0

Please sign in to leave a comment.