ReviewBot: Multiple Tools Enabled Issue and ReviewBot 0.3alpha?

2016-07-07 Thread Jerry Kotas
I am running ReviewBoard 2.5.6.1 from the BitNami Package 2.0.15. I 
installed ReviewBot 0.2alpha. The bot runs perfectly fine when I only have 
one tool enabled. When I run 2 tools, however, the second tools just keeps 
posting on the request. I found the issue to be with the celery queue. Here 
is a snippet of the log file from celery.

[2016-07-06 10:54:30,076: INFO/Worker-1] 
reviewbot.tasks.ProcessReviewRequest[ef22f626-a315-4b8f-8502-547b06b71c72]: 
Tool execution completed successfully
[2016-07-06 10:54:30,076: INFO/Worker-1] 
reviewbot.tasks.ProcessReviewRequest[ef22f626-a315-4b8f-8502-547b06b71c72]: 
Publishing review
[2016-07-06 10:54:33,525: INFO/Worker-1] 
reviewbot.tasks.ProcessReviewRequest[ef22f626-a315-4b8f-8502-547b06b71c72]: 
Review completed successfully
[2016-07-06 10:54:33,539: INFO/MainProcess] Received task: 
reviewbot.tasks.ProcessReviewRequest[22c1e163-ef75-445c-9623-a33be90da746]
[2016-07-06 10:54:33,539: INFO/Worker-1] 
reviewbot.tasks.ProcessReviewRequest[ef22f626-a315-4b8f-8502-547b06b71c72]: 
Request to execute review tool 'cppcheck' for 
http://loggerhead4:8080/reviewboard/
[2016-07-06 10:54:33,539: INFO/Worker-1] 
reviewbot.tasks.ProcessReviewRequest[ef22f626-a315-4b8f-8502-547b06b71c72]: 
Initializing RB API
[2016-07-06 10:54:33,539: INFO/MainProcess] Task 
reviewbot.tasks.ProcessReviewRequest[ef22f626-a315-4b8f-8502-547b06b71c72] 
succeeded in 205.29952s: True
[2016-07-06 10:54:33,572: CRITICAL/MainProcess] Couldn't ack 1, 
reason:error(10054, 'An existing connection was forcibly closed by the 
remote host')
Traceback (most recent call last):
  File 
"C:\BitNami\reviewboard-2.0.15-0\python\lib\site-packages\kombu-3.0.35-py2.7.egg\kombu\message.py",
 
line 93, in ack_log_error
self.ack()
  File 
"C:\BitNami\reviewboard-2.0.15-0\python\lib\site-packages\kombu-3.0.35-py2.7.egg\kombu\message.py",
 
line 88, in ack
self.channel.basic_ack(self.delivery_tag)
  File 
"C:\BitNami\reviewboard-2.0.15-0\python\lib\site-packages\amqp-1.4.9-py2.7.egg\amqp\channel.py",
 
line 1584, in basic_ack
self._send_method((60, 80), args)
  File 
"C:\BitNami\reviewboard-2.0.15-0\python\lib\site-packages\amqp-1.4.9-py2.7.egg\amqp\abstract_channel.py",
 
line 56, in _send_method
self.channel_id, method_sig, args, content,
  File 
"C:\BitNami\reviewboard-2.0.15-0\python\lib\site-packages\amqp-1.4.9-py2.7.egg\amqp\method_framing.py",
 
line 221, in write_method
write_frame(1, channel, payload)
  File 
"C:\BitNami\reviewboard-2.0.15-0\python\lib\site-packages\amqp-1.4.9-py2.7.egg\amqp\transport.py",
 
line 182, in write_frame
frame_type, channel, size, payload, 0xce,
  File "C:\BitNami\reviewboard-2.0.15-0\python\lib\socket.py", line 224, in 
meth
return getattr(self._sock,name)(*args)
error: [Errno 10054] An existing connection was forcibly closed by the 
remote host
[2016-07-06 10:54:34,601: INFO/Worker-1] 
reviewbot.tasks.ProcessReviewRequest[ef22f626-a315-4b8f-8502-547b06b71c72]: 
Loading requested tool 'cppcheck'
[2016-07-06 10:54:34,601: INFO/Worker-1] 
reviewbot.tasks.ProcessReviewRequest[ef22f626-a315-4b8f-8502-547b06b71c72]: 
Initializing review

The tool execution that finished in the first line was cpp check. This is 
the second tool. The first tool completed with out a problem. Celery then 
load cpp check again and this loop continues for what looks like a random 
amount of iterations.

I fixed by modifying the reviewbot source code. In the 
file ReviewBot\bot\reviewbot\celery.py, I added the two lines shown below.

from __future__ import absolute_import

import logging
import pkg_resources

from celery import Celery
from kombu import Exchange, Queue


celery = Celery('reviewbot.celery', include=['reviewbot.tasks'])

celery.conf.CELERY_ACKS_LATE = True# Added this
celery.conf.CELERYD_PREFETCH_MULTIPLIER = 1# and this

default_exchange = Exchange('celery', type='direct')
celery.conf.CELERY_QUEUES = [
Queue('celery', default_exchange, routing_key='celery'),
]
...

The reason I'm writing this is to ask how ReviewBoard has they're ReviewBot 
setup. When I have two tools enabled, I get two posts by ReviewBot but 
ReviewBoard has one post with both of their tools. Example 
https://reviews.reviewboard.org/r/8262/. I tried making a custom ReviewBot 
Tool that executes both tools that I want. Is that how it's done here or 
are they using 0.3alpha. I also tried to get this working but the tool 
specific settings aren't showing up. Can I get some help with this or 
should I stick with 0.2 because it looks like 0.3 is no longer being 
developed?

Thanks,
Jerry

-- 
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 
"reviewboard" group.
To unsubscribe from this group and stop receiving emails from 

Re: Error Validating Diff with rbt post

2016-06-13 Thread Jerry Kotas
I attached a screen shot of the Repository from ReviewBoard. Is that what 
you meant? Also, rbt diff doesn't produce an output unless I specify the 
latest revision number. However, bzr diff does give me an output.

C:\TheRBRepo\TheBranch>bzr diff
=== modified file 'abc.c'
--- abc.c   revid:20160613123114-sde0r2h5fafsbzh9
+++ abc.c   2016-06-13 12:32:04 +
@@ -1,6 +1,6 @@
 int main()
 {
-int a[10];
-a[10] = 0;
+int b[10];
+b[10] = 0;
 return 0;
 }



On Saturday, June 11, 2016 at 5:39:14 PM UTC-4, Christian Hammond wrote:
>
> Hi Jerry,
>
> The error message buried in here (which a newer version should better 
> show) is:
>
> "Not a branch: "C:/TheRBRepo/.bzr/branch/": location is a repository."
>
> Can you show me your repository configuration on Review Board, and the 
> diff in question? (You can generate that using `rbt diff`.)
>
> Christian
>
> -- 
> Christian Hammond
> President/CEO of Beanbag <https://www.beanbaginc.com/>
> Makers of Review Board <https://www.reviewboard.org/>
>
> On Fri, Jun 10, 2016 at 10:11 AM, Jerry Kotas <gko...@attotech.com 
> > wrote:
>
>> I am running ReviewBoard on localhost via BitNami. I am using a local 
>> bazaar repository on the C: Drive. When I try to post using the command 
>> below, I get an error. I discovered this only occurs when the current 
>> revision contains an edit of an exist file. If the revision is just newly 
>> added files, the command works. I am using RBTools 0.7.4. I have tried this 
>> with 0.7.6 and get the same results.
>>
>> rbt post command:
>> rbt post --server=http://localhost/reviewboard -p --guess-fields=yes 
>> --repository-type=bazaar --repository-url=file://C:\TheRBRepo\TheBranch -d 
>> 13
>>
>> Output:
>> >>> RBTools 0.7.4
>> >>> Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (
>> Intel)]
>> >>> Running on Windows-7-6.1.7601-SP1
>> >>> Home = C:\Users\gkotas\AppData\Roaming
>> >>> Current directory = C:\TheRBRepo\TheBranch
>> >>> Running: git version
>> >>> Checking for a Bazaar repository...
>> >>> Running: bzr info
>> >>> repository info: Path: C:\TheRBRepo\TheBranch, Base path: /, 
>> Supports change
>> sets: False
>> >>> Making HTTP GET request to http://localhost/reviewboard/api/
>> >>> Running: bzr revno -r before:13
>> >>> Running: bzr revno -r 13
>> >>> Running: bzr info
>> >>> repository info: Path: C:\TheRBRepo\TheBranch, Base path: /, 
>> Supports change
>> sets: False
>> >>> Running: bzr diff -q -r revno:12..revno:13
>> >>> Command exited with rc 1: [u'bzr', u'diff', u'-q', u'-r', 
>> u'revno:12..revno:
>> 13']
>> >>> Making HTTP GET request to http://localhost/reviewboard/api/
>> validation/diffs
>> /
>> >>> Cached response for HTTP GET http:
>> //localhost/reviewboard/api/validation/dif
>> fs/ expired and was modified
>> >>> Making HTTP POST request to 
>> http://localhost/reviewboard/api/validation/diff
>> s/
>> >>> Got API Error 224 (HTTP code 400): The specified diff file could not 
>> be pars
>> ed.
>> >>> Error data: {u'stat': u'fail', u'reason': u'Not a branch: 
>> "C:/TheRBRepo/.bzr
>> /branch/": location is a repository.', u'err': {u'msg': u'The specified 
>> diff fil
>> e could not be parsed.', u'code': 224}}
>> Traceback (most recent call last):
>>  File "C:\Bitnami\reviewboard-2.5-0\python\Scripts\rbt-script.py", line 
>> 9, in <
>> module>
>>load_entry_point('rbtools==0.7.4', 'console_scripts', 'rbt')()
>>  File 
>> "C:\Bitnami\reviewboard-2.5-0\python\lib\site-packages\rbtools-0.7.4-py2.
>> 7.egg\rbtools\commands\main.py", line 133, in main
>>command.run_from_argv([RB_MAIN, command_name] + args)
>>  File 
>> "C:\Bitnami\reviewboard-2.5-0\python\lib\site-packages\rbtools-0.7.4-py2.
>> 7.egg\rbtools\commands\__init__.py", line 612, in run_from_argv
>>exit_code = self.main(*args) or 0
>>  File 
>> "C:\Bitnami\reviewboard-2.5-0\python\lib\site-packages\rbtools-0.7.4-py2.
>> 7.egg\rbtools\commands\post.py", line 754, in main
>>(msg_prefix, e))
>> rbtools.commands.CommandError: Error validating diff
>>
>> The specified diff file could not be parsed. (HTTP 400, API Error 224)
>>
>>
>> -- 
>> Supercharge your Review Board with Power Pack: 
>> https

Error Validating Diff with rbt post

2016-06-10 Thread Jerry Kotas
I am running ReviewBoard on localhost via BitNami. I am using a local 
bazaar repository on the C: Drive. When I try to post using the command 
below, I get an error. I discovered this only occurs when the current 
revision contains an edit of an exist file. If the revision is just newly 
added files, the command works. I am using RBTools 0.7.4. I have tried this 
with 0.7.6 and get the same results.

rbt post command:
rbt post --server=http://localhost/reviewboard -p --guess-fields=yes 
--repository-type=bazaar --repository-url=file://C:\TheRBRepo\TheBranch -d 
13

Output:
>>> RBTools 0.7.4
>>> Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel
)]
>>> Running on Windows-7-6.1.7601-SP1
>>> Home = C:\Users\gkotas\AppData\Roaming
>>> Current directory = C:\TheRBRepo\TheBranch
>>> Running: git version
>>> Checking for a Bazaar repository...
>>> Running: bzr info
>>> repository info: Path: C:\TheRBRepo\TheBranch, Base path: /, Supports 
change
sets: False
>>> Making HTTP GET request to http://localhost/reviewboard/api/
>>> Running: bzr revno -r before:13
>>> Running: bzr revno -r 13
>>> Running: bzr info
>>> repository info: Path: C:\TheRBRepo\TheBranch, Base path: /, Supports 
change
sets: False
>>> Running: bzr diff -q -r revno:12..revno:13
>>> Command exited with rc 1: [u'bzr', u'diff', u'-q', u'-r', 
u'revno:12..revno:
13']
>>> Making HTTP GET request to http://localhost/reviewboard/api/validation/
diffs
/
>>> Cached response for HTTP GET http:
//localhost/reviewboard/api/validation/dif
fs/ expired and was modified
>>> Making HTTP POST request to 
http://localhost/reviewboard/api/validation/diff
s/
>>> Got API Error 224 (HTTP code 400): The specified diff file could not be 
pars
ed.
>>> Error data: {u'stat': u'fail', u'reason': u'Not a branch: 
"C:/TheRBRepo/.bzr
/branch/": location is a repository.', u'err': {u'msg': u'The specified 
diff fil
e could not be parsed.', u'code': 224}}
Traceback (most recent call last):
 File "C:\Bitnami\reviewboard-2.5-0\python\Scripts\rbt-script.py", line 9, 
in <
module>
   load_entry_point('rbtools==0.7.4', 'console_scripts', 'rbt')()
 File 
"C:\Bitnami\reviewboard-2.5-0\python\lib\site-packages\rbtools-0.7.4-py2.
7.egg\rbtools\commands\main.py", line 133, in main
   command.run_from_argv([RB_MAIN, command_name] + args)
 File 
"C:\Bitnami\reviewboard-2.5-0\python\lib\site-packages\rbtools-0.7.4-py2.
7.egg\rbtools\commands\__init__.py", line 612, in run_from_argv
   exit_code = self.main(*args) or 0
 File 
"C:\Bitnami\reviewboard-2.5-0\python\lib\site-packages\rbtools-0.7.4-py2.
7.egg\rbtools\commands\post.py", line 754, in main
   (msg_prefix, e))
rbtools.commands.CommandError: Error validating diff

The specified diff file could not be parsed. (HTTP 400, API Error 224)


-- 
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 
"reviewboard" 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.