Uploading of multi-commit review requests seems broken with Mercurial

99 views
Skip to first unread message

Valentin Bartenev

unread,
Sep 20, 2022, 11:03:54 AM9/20/22
to Review Board Community
Hi,

I've tried with Mercurial 6.1.1, RBTools 3.1.1 and Review Board versions 4.0.10 and 5 beta2 with no luck.

Steps to reproduce:
1. Setup a new Mercurial repo on a server with an initial commit (or use an existing one)
2. Clone that repo on a local machine and configure rbt
3. Create two local commits that modify different files: e.g. one changes FILE1, but has no changes to FILE2, while second has changes in FILE2.
4. Then try to send both commits for review via "rbt post" without squashing history and you will get the following error:

Validating commits... ████████████████████████████████████████████████████ [2/2]
Uploading commits...  ██████████████████████████                           [1/2]
ERROR: Error uploading diff

The file was not found in the repository. (API Error 207: Repository File Not Found)
Your review request still exists, but the diff is not attached.
https://rb/r/2/

See the attachment for output with debug flag enabled.

It's a common workflow for us, we are doing reviews before committing changes.

Could you help please with this issue? Are we doing something wrong, or there is a problem with our RB setup?

Thanks.

rb_debug.txt

Christian Hammond

unread,
Sep 21, 2022, 3:39:26 PM9/21/22
to revie...@googlegroups.com
Hi Valentin,

Thanks for the repro steps and the detailed info. We'll see what's going on. We've hit edge cases with Mercurial before (partly because their diffs have some issues with certain types or orders of changes).

Would you be able to supply the diff that's failing (rbt diff) as well?

If this is a test repository with no sensitive information, would it be possible to get a copy of it?

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/5ead7360-a496-439f-9ec1-921066b34c21n%40googlegroups.com.


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

Valentin Bartenev

unread,
Sep 22, 2022, 9:17:41 AM9/22/22
to Review Board Community
Hi,

It's reproducible with a clean repo as well as with this one: http://hg.nginx.org/unit/ on a new RB installation.
Example patches to the repo above are in the attachments.

I've spent a day debugging and investigating ReviewBoard and RBTools sources. What I've found out:
1. The cause of the error is that ReviewBoard tries to request a raw file from a server repository using the revision ID of the previous patch. Sure there's no such revision on the server as those patches aren't committed yet to the upstream repository.
2. RBTools sends and ReviewBoard actually gets and stores under the "base_commit_id" field a proper revision ID on which the uploaded patches are based.
3. But for some unknown reason it's not passed to the relevant functions while processing uploaded diffs.

I made a patch on RB 4.0.10, that fixes the issue and it works well for us. See: https://reviews.reviewboard.org/r/12623/

wbr, Valentin
p2.txt
p1.txt
Reply all
Reply to author
Forward
0 new messages