Added a `rbext create` command for creating new extensions.
Review Request #9722 — Created March 3, 2018 and submitted
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 theReviewBoard
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 onjinja2
, 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 existingrbext 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.