
If the user is viewing only their subscribed projects, it makes sense to let them toggle between seeing all projects and only those with unreviewed reviews. When they've chosen to list unsubscribed projects as well, this seems to make less sense. The unsubscribed projects will all have no unreviewed reviews, so no unsubscribed projects would ever be listed. In effect, this means that to list all projects the user now has to press two keys (l,a) rather than one (l). This commit ignores the active_only flag when listing unsubscribed projects, restoring the ability to see a list of all projects just by hitting one key (l) Two nits I'm aware of: * If the user is listing all projects and presses a, the active_only flag will be silently toggled, which may be surprising when they switch back to only subscribed projects and the view is different to when they left that view * If there are circumstances I haven't thought of that could lead to having unreviewed reviews in an unsubscribed project, it might make sense to pay attention to this flag, in which case this patch won't quite do what we want. Change-Id: Id5c27cde7b9536aa9fb0f8ba74276b07019f5d17
Gertty
Gertty is a console-based interface to the Gerrit Code Review system.
As compared to the web interface, the main advantages are:
- Workflow -- the interface is designed to support a workflow similar to reading network news or mail. In particular, it is designed to deal with a large number of review requests across a large number of projects.
- Offline Use -- Gertty syncs information about changes in subscribed projects to a local database and local git repos. All review operations are performed against that database and then synced back to Gerrit.
- Speed -- user actions modify locally cached content and need not wait for server interaction.
- Convenience -- because Gertty downloads all changes to local git repos, a single command instructs it to checkout a change into that repo for detailed examination or testing of larger changes.
Usage
Create a file at ~/.gertty.yaml
with the following
contents:
servers:
- name: gerrit
url: https://review.example.org/
username: <gerrit username>
password: <gerrit password>
git_root: ~/git/
A sample file with several options configured for use with
OpenStack's Gerrit is available in gertty.yaml-sample
.
You can generate or retrieve your Gerrit password by navigating to
Settings, then HTTP Password. Set git_root
to a directory
where Gertty should find or clone git repositories for your
projects.
If your Gerrit uses a self-signed certificate, you can add:
verify_ssl: False
To the section.
The config file is designed to support multiple Gerrit instances, but currently, only the first one is used.
After installing the requirements (listed in requirements.txt), you should be able to simply run Gertty. You will need to start by subscribing to some projects. Use 'l' to list all of the projects and then 's' to subscribe to them.
In general, pressing the F1 key will show help text on any screen, and ESC will take you to the previous screen.
To select text (e.g., to copy to the clipboard), hold Shift while selecting the text.
Philosophy
Gertty is based on the following precepts which should inform changes to the program:
- Support large numbers of review requests across large numbers of projects. Help the user prioritize those reviews.
- Adopt a news/mailreader-like workflow in support of the above. Being able to subscribe to projects, mark reviews as "read" without reviewing, etc, are all useful concepts to support a heavy review load (they have worked extremely well in supporting people who read/write a lot of mail/news).
- Support off-line use. Gertty should be completely usable off-line with reliable syncing between local data and Gerrit when a connection is available (just like git or mail or news).
- Ample use of color. Unlike a web interface, a good text interface relies mostly on color and precise placement rather than whitespace and decoration to indicate to the user the purpose of a given piece of information. Gertty should degrade well to 16 colors, but more (88 or 256) may be used.
- Keyboard navigation (with easy-to-remember commands) should be considered the primary mode of interaction. Mouse interaction should also be supported.
- The navigation philosophy is a stack of screens, where each selection pushes a new screen onto the stack, and ESC pops the screen off. This makes sense when drilling down to a change from lists, but also supports linking from change to change (via commit messages or comments) and navigating back intuitive (it matches expectations set by the web browsers).
- Support a wide variety of Gerrit installations. The initial development of Gertty is against the OpenStack project's Gerrit, and many of the features are intended to help its developers with their workflow, however, those features should be implemented in a generic way so that the system does not require a specific Gerrit configuration.
Contributing
For information on how to contribute to gertty, please see the contents of the CONTRIBUTING.rst file.