Re: Help with Mercurial and Post-Commit reviews

2022-05-16 Thread Mark Falconer
Hi Chris,

to quote Christian Hammond from a previous email

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.

As a workaround the multi commit feature can be turned off using rbt post:

-S, --squash-history

Force the review request to be created without history, even if the server 
supports it. Uploaded diffs will be squashed together.

The default can be set in 
SQUASH_HISTORY<https://www.reviewboard.org/docs/rbtools/2.0/rbt/configuration/repositories/#std:rbtconfig-SQUASH_HISTORY>
 in 
.reviewboardrc<https://www.reviewboard.org/docs/rbtools/2.0/rbt/configuration/repositories/#rbtools-reviewboardrc>.


____


Mark Falconer
Software Development Team Lead


Office : +44 (0) 1224347070
Mobile: +44 (0) 7734 578 948
Email: mark.falco...@hrhgeology.com
Web: www.hrhgeology.com
HRH Limited is a company registered in Scotland. Registration number: SC117311. 
Registered office: 100 Union Street, Aberdeen, AB10 1QR, UK
​
​Business Address: HRH Limited, 19 Silverburn Place, Bridge of Don, Aberdeen, 
AB23 8EG, UK

HRH Ltd accepts no liability for the content of this email, or for the 
consequences of any actions taken on the basis of the information provided, 
unless that information is subsequently confirmed in writing. 
​Any views or opinions presented in this email are solely those of the author 
and do not necessarily represent those of the company.
From: reviewboard@googlegroups.com  on behalf of 
Chris Hightower 
Sent: 16 May 2022 21:38
To: Review Board Community 
Subject: Help with Mercurial and Post-Commit reviews

Hello all!

We're trying to swtich to ReviewBoard from JetBrains Upsource, and we're 
attempting to do some post-commit reviews.

The error we're seeing from rbt post happens during the 'validating commits' 
stage, and it fails with Error Validating Diff

You can replicate this with a mercurial repository via the following steps:

Setup:

  *   Create a new branch
  *   Change any file in the repository, and commit
  *   Add 2 new files (i.e.  myfile1 and myfile2), hg add and hg commit
  *   Change the first new file and hg commit
  *   Change the 2nd new file and hg commit
  *   hg push --new-branch

Attempt to create a new review request with rbt post (the revision IDs are: 
parent of first commit on this branch, and most recent commit on this branch):
rbt post --branch `hg branch` -p --target-groups my-review-group --summary 
"testing" --description "testing" --tracking-branch default f638ab41e9fc 
438b21c0ba39

We see the following output:
Validating commits... ███  [3/4]
ERROR: Error validating diff

rb_test/myfile2.txt: The file was not found in the repository. (HTTP 400, API 
Error 207)


What are we doing wrong?

Our standard workflow is to create a new branch (for bugfix or new feature), 
make code changes/additions/etc with commits along the way, push the branch and 
then request a Review.  Should we change our process? If so, what is the 
best-practice for ReviewBoard?


Any help or insight you can provide would be greatly appreciated.

--
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+unsubscr...@googlegroups.com<mailto:reviewboard+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/reviewboard/4ddd2df2-6227-44b2-abd4-0278e7c661d4n%40googlegroups.com<https://groups.google.com/d/msgid/reviewboard/4ddd2df2-6227-44b2-abd4-0278e7c661d4n%40googlegroups.com?utm_medium=email_source=footer>.

-- 

RBTools Ticket #4954: rbtools 2.0 does not read .reviewboardrc with encoding UTF8-BOM

2022-01-06 Thread Mark Falconer
--
To reply, visit https://hellosplat.com/s/beanbag/tickets/4954/
--

New ticket #4954 by mark.falconer
For Beanbag, Inc. > RBTools

Status: New
Tags: Priority:Medium, Type:Defect


--
rbtools 2.0 does not read .reviewboardrc with encoding UTF8-BOM
==

# What version are you running?
RBTools 2.0.1 (Python 3.8.10)

# What steps will reproduce the problem?
1. On Windows, add a .reviewboardrc to a repository using notepad.
2. run rbt post to post a diff


# What is the expected output? What do you see instead?
Expected: The diff is posted
Actual: The diff fails

# What operating system are you using?
Win10

# Attach the debug out from the command.

```
$ rbt post --debug

Traceback (most recent call last):
  File "C:\Program 
Files\RBTools\Python\lib\site-packages\rbtools-2.0.1-py3.8.egg\rbtools\utils\filesystem.py",
 line 220, in parse_config_file
config = _load_python_file(filename, config)
  File "C:\Program 
Files\RBTools\Python\lib\site-packages\rbtools-2.0.1-py3.8.egg\rbtools\utils\filesystem.py",
 line 52, in _load_python_file
exec(compile(f.read(), filename, 'exec'), config)
  File "D:\Workspace\DataNG Documents.reviewboardrc", line 1
REVIEWBOARD_URL = 'http://dev-revbrd01.hrh.local/'
 ^
SyntaxError: invalid character in identifier

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\RBTools\bin..\Python\Scripts\rbt-script.py", line 33, 
in 
sys.exit(load_entry_point('RBTools==2.0.1', 'console_scripts', 'rbt')())
  File "C:\Program 
Files\RBTools\Python\lib\site-packages\rbtools-2.0.1-py3.8.egg\rbtools\commands\main.py",
 line 124, in main
command.run_from_argv([RB_MAIN, command_name] + args)
  File "C:\Program 
Files\RBTools\Python\lib\site-packages\rbtools-2.0.1-py3.8.egg\rbtools\commands__init__.py",
 line 744, in run_from_argv
parser = self.create_arg_parser(argv)
  File "C:\Program 
Files\RBTools\Python\lib\site-packages\rbtools-2.0.1-py3.8.egg\rbtools\commands__init__.py",
 line 731, in create_arg_parser
self.config = load_config()
  File "C:\Program 
Files\RBTools\Python\lib\site-packages\rbtools-2.0.1-py3.8.egg\rbtools\utils\filesystem.py",
 line 250, in load_config
parsed_config = parse_config_file(filename)
  File "C:\Program 
Files\RBTools\Python\lib\site-packages\rbtools-2.0.1-py3.8.egg\rbtools\utils\filesystem.py",
 line 222, in parse_config_file
raise Exception('Syntax error in config file: %s\n'
Exception: Syntax error in config file: D:\Workspace\DataNG 
Documents.reviewboardrc
Line 1 offset 18
```


# Please provide any additional information below.
Notepad creates files with encoding UTF8-BOM. Changing the encoding to remove 
the BOM works. Creating the file using rbt works. 

I am raising this for 2 reasons:

1. The documentation states that .reviewboardrc should be a valid python file. 
Running ` "C:\Program Files\RBTools\Python\python" .reviewboardrc` completes 
successfully (i.e. does nothing, but no errors), indicating that it is.
   
2. RBTools versions before 2.0 worked successfully.

I think the config file should be read with encoding `utf-8-sig`
https://www.howtosolutions.net/2019/04/python-fixing-unexpected-utf-8-bom-error-when-loading-json-data/

--

-- 
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/reviewboard-issues/20220106084624.4918.43381%40ip-10-1-54-209.ec2.internal.


Feature Request: Review markdown docs in repositories

2019-03-16 Thread mark . falconer
Hi, we have used Reviewboard for several years and I recommend it to every 
developer group I speak to.

Recently there is lots of activity storing Markdown documents in 
repositories. GitHub and GitLab create a Readme.md file, and the GitLab 
wiki (based on https://github.com/gollum/gollum/wiki) stored the wiki pages 
in a git repository. A lot of Microsofts documentation has also moved to 
markdown stored on github (e.g. 
https://github.com/MicrosoftDocs/azure-docs/)

As far as I can tell Reviewboard lets you review markdown documents that 
you attach to a review request, but does not allow you to review (with 
markdown preview) documents that are in the diff itself. I think this would 
be really useful as we could move all of our user documentation into a 
repository for versioning and use rbtools to generate a review request for 
the documentation.

If I am missing existing capability please let me know!

Thanks and regards,

Mark

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.