Problem with multi-commit feature

81 views
Skip to first unread message

Renan Moreira

unread,
Mar 9, 2022, 1:06:31 PM3/9/22
to Review Board Community
Hi,

I have been trying to use the multi-commit feature from ReviewBoard 4.x and RBTools 2.x for quite a while now, but I eventually stumble on some errors while trying to post the review at some conditions. My setup is as follows: ReviewBoard 4.0.2, RBTools 2.0.1, Mercurial 4.5.3. 

It doesn't happen all the time, though. From what I could gather, it occurs in two scenarios:
  • Say you have two commits: A and B. If you change a certain file "X" from your repo at commit A, and then you proceed to changing a different file "Y" at commit B, the error pops up while trying to post commit B, telling that file Y wasn't found in the repository. If you post the commits separately, though, it works fine, so the file does exist after all. The error can be seen below:

Validating commits... [0/2] Validating commits... ████████████████████████████████████████████████████ [2/2] Uploading commits... [0/2] Uploading commits... ██████████████████████████ [1/2] ERROR: Error uploading diff The file was not found in the repository. (HTTP 400, API Error 207) Your review request still exists, but the diff is not attached.
    • There are some caveats, though: if, at commit A, you change both X and Y, and at commit B you change Y, it works.
    • If you have 3 or more commits, it will fail at the first one that changes a file which wasn't changed at the first commit.
    • On the other hand, if you just create files at different commits, it works fines (but this relates to the second scenario, I will discuss it below).
  • Say you have, for example, 3 commits - A, B, and C -, and you create a file X at commit A. At commit B, you don't change the file. At commit C, you change that file X you created in A. This pops up the error, but now at the validation stage. See below:
Validating commits...                                                      [0/3]
Validating commits... ██████████████████████████████████▋                  [2/3]
Validating commits... ██████████████████████████████████▋                  [2/3]
ERROR: Error validating diff

file1.txt: The file was not found in the repository. (HTTP 400, API Error 207)
  • file1.txt is X in this context.
    • Also, there are caveats: if you keep changing the file at every single commit, the error doesn't appear.
    • From what I observed, it happens when there's at least one commit in-between that hasn't changed the said file. If you have 4 commits and create the file at the 1st and change it at the 4th, the error will appear at the 4th commit only.
I have tried reinstalling RBTools and the error persists. Is there anything else that could be causing this? Or is it indeed a bug?

Thanks!
Renan

Renan Moreira

unread,
Apr 11, 2022, 3:48:03 PM4/11/22
to Review Board Community
Any thoughts on this?

Christian Hammond

unread,
Apr 13, 2022, 11:09:36 PM4/13/22
to revie...@googlegroups.com
Hi Renan,

Sorry for not replying to this before.

We've hit a few issues like that with Mercurial, and it partly has to do with how Mercurial represents file and revisions in their diffs. The standard Mercurial diff format has a lot of issues that make it difficult for us to extract meaningful revision history when generating a diff, particularly when dealing with ranges, and while the Git-like format is a bit better at this, it's not quite right either.

We've done some work in the past couple releases of Review Board and RBTools to try to address this, at least for some cases. Can you verify whether these scenarios are still happening for you on Review Board 4.0.6 and RBTools 3?

If you're still able to reproduce these, we'll need RBTools debug logs, the generated parent and main diffs, and some representation of the Mercurial tree showing the revisions and relations at the point when those logs were generated.

Our long-term goal is to bypass the Mercurial diff formats and go with our DiffX format instead, which will give us greater control over how we're able to represent revision information for each file.

Christian

--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "Review Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/reviewboard/805d1029-dd1f-4d6d-8c30-a67ba8c811a8n%40googlegroups.com.


--
Christian Hammond
President/CEO of Beanbag
Makers of Review Board

Valentin Bartenev

unread,
Sep 23, 2022, 11:41:19 AM9/23/22
to Review Board Community
Hi,

It seems I experienced absolutely the same issues. I was able to fix the first case, see discussion here: https://groups.google.com/g/reviewboard/c/FG5TNTNC_fU , but the second case with the validation error when a file was created in some patch before is still actual.

--
Valentin

Valentin Bartenev

unread,
Sep 23, 2022, 1:02:40 PM9/23/22
to Review Board Community
Hi Christian,

I've attached to this message all the API requests captured from RBTools 3.1.1, that it sends to Review Board 4.0.10 when posting 3 commits similar to 2-nd scenario described by Renan.
It fails with this error:

Validating commits... ██████████████████████████████████▋                  [2/3]
ERROR: Error validating diff

newfile (revision 774d1325c725017792ceba0aaab9d714b7ed1d90): The file was not found in the repository. (API Error 207: Repository File Not Found)

Hope it will help. I'm happy to provide any other debug information to investigate this issue.
requests.txt
Reply all
Reply to author
Forward
0 new messages