Closed Bug 945577 Opened 9 years ago Closed 9 years ago

Add a mach rbt command to run ReviewBoard Tools


(Firefox Build System :: Mach Core, enhancement)

Not set


(firefox28 fixed)

Tracking Status
firefox28 --- fixed


(Reporter: mconley, Assigned: gps)


(Blocks 2 open bugs)


(Whiteboard: [qa-])


(1 file)

With our fancy new Review Board instance up at, it'd be really excellent if we could grease the wheels and get people to try it.

One idea that's been brewing is to make it easy for developers to upload patches to Review Board via RBTools, and then to simultaneously post a link to the View Diff portion of the RB review request into the bug that the patch belongs to.

The end-result is that a reviewer need only click on an attachment in Bugzilla, and then be quickly redirected to the review request where they can immediately start reviewing.

I think a mach command making use of the RBTools WebAPI client might be a nice solution.
I was thinking about this as well.

I think it should be sufficient to expose rbt directly to the end-user: no need to write a one-off mach command that simply does what `rbt post` does already.

I could go into a deep discussion about virtualenvs and shell development environments and how we should do this properly. But I won't. I think a simple `mach rbt` that installs RBTools from pip and then invokes its main() should be sufficient for now.
So does `rbt post` upload the link + review request to bmo?
Yeah, I missed the 2nd half of the summary. Perhaps this should be marked as a dupe of bug 774150. That's still softly blocked on having a sane Python API to Bugzilla IIRC. A quick hack would be to extract bzexport's bugzilla code into a shared library (or just copy the code). We can install pip packages via mach commands - so shared library is preferred.
There's a fairly straightforward REST API for adding attachments; is this not sufficient?
bzexport uses BzAPI, which is also fairly straightforward, but it turns out there's a lot of things to get right in order to make it useful.
While this patch doesn't accomplish what the bug summary requests, it
does solve a problem: making RBTools available inside the development
environment without requiring the user to do much.

History has shown that asking users to install Python packages is prone
to error and has issues interacting with m-c's virtualenv. This command
does things in the least risky way possible. It should be a sufficient
holdover until a dedicated patch uploading command is implemented in
mach. That can be bug 774150.
Attachment #8343544 - Flags: review?(ahalberstadt)
Assignee: nobody → gps
Comment on attachment 8343544 [details] [diff] [review]
mach rbt command to run ReviewBoard Tools

Review of attachment 8343544 [details] [diff] [review]:

Looks good for an interim first step. Are there any other patch related commands with rbt that might make sense as mach commands (I'm not familiar with the tool). Might be worth creating a new "Patch" category in mach for.
Attachment #8343544 - Flags: review?(ahalberstadt) → review+

There's problem room for a "developer productivity" category. Maybe the next command breaks the camel's back.
Blocks: 774150
Flags: in-testsuite-
I think adding rbt to the development environment is a good first step.

I've got a patch up against RBTools[1] to make it easy for third-parties to register new rbt commands, so perhaps what we can do is (eventually) augment gps's work here to include another package that adds a bunch of Mozilla-specific commands to rbt (for example, mozpost, which would wrap the built-in post command, but could also attach the link to the review request to a Bugzilla bug).

Or we could add such commands to mach. I don't really feel strongly either way.

Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Pushed a followup fix to argument parsing. I should have tested this patch more. Change was trivial, so no review needed IMO.
(Since this was morphed to something else entirely.)
Summary: Write a mach command to post patches to Review Board and post links to Bugzilla → Add a mach rbt command to run ReviewBoard Tools
Whiteboard: [qa-]
Blocks: 1103052
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.