Added a `rbext create` command for creating new extensions.

Review Request #9722 — Created March 4, 2018 and submitted

Information

Review Board
release-3.0.x
d3ff1ca...

Reviewers

This introduces a new rbext subcommand, rbext create, which
generates a working extension source tree, complete with packaging,
based on the provided arguments. It's used to quickly get up and
running with extension development, and replaces the old, outdated
contrib/tools/generate_extension.py.

At its simplest, this just needs a human-displayable name for an
extension, and will generate a suitable package and class name from
those, and a working package and extension as well. This can be
customized with specific extension class and package names, author
information, and options for setting up static media and configuration
support. This can be expanded later for additional options, if we
choose.

There are a few major differences from the old generate_extension.py.
First, anyone with the ReviewBoard package installed can generate an
extension without needing to check out a source tree, making this much
more accessible to developers. It doesn't require an undocumented
dependency on jinja2, and instead generates all content inline within
the code (which does result in more lengthy code but helps keep all the
generation templates viewable at once). It also outputs more
future-proof extension code, unlike the old code which made use of
several deprecated Django conventions.

Documentation was added on rbext, including the existing rbext test,
and the main Extending Review Board page has a tip link that points to
rbext create.

Used this to build a few test extensions, with/without static media
and configuration. Review Board saw the extensions and let me enable
them. It also let me edit the configuration for an extension with
configuration available.

Manually inspected all the generated code.

Description From Last Updated

E402 module level import not at top of file

reviewbotreviewbot

E402 module level import not at top of file

reviewbotreviewbot

E402 module level import not at top of file

reviewbotreviewbot

F841 local variable 'setup_py' is assigned to but never used

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

brennie
  1. 
      
  2. reviewboard/cmdline/rbext.py (Diff revision 1)
     
     

    TIL graft dir. I've been using recurisive-include DIR * this whole time.

  3. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (6fdfc5c)
Loading...