Adds a parser that compiles gerrit search queries into sqlalchemy
filters to support the gerrit search syntax both in arbitrary
searches (ctrl-o) as well as dashboards.
Change-Id: Ibc8e5c180b0ca16727938725cfe6380ba7315205
Let ctrl-r run a sync all projects task in list views, and sync
the current change in the change view.
Change-Id: I65cfb755bd387b68fe2dbd1562f149adb4421ea1
The name of the initial focus method in the hypertext widget
changed from focusItemLeft to focusFirstItem. This would cause
a crash if the mouse was clicked in the change screen when an
item in the hypertext widget was not already focused.
Change-Id: I046115f43bdd41640ebdaf45198ff3ae4770bb97
Reviewkeys are a customizable shortcut for leaving predefined
votes on a change. For example, if you want to leave a +2
review with no comment, you might simply hit the "meta-2"
key. The following configuration block is recommended for
use with OpenStack's Gerrit:
reviewkeys:
- key: 'meta 0'
approvals: []
- key: 'meta 1'
approvals:
- category: 'Code-Review'
value: 1
- key: 'meta 2'
approvals:
- category: 'Code-Review'
value: 2
- key: 'meta 3'
approvals:
- category: 'Code-Review'
value: 2
- category: 'Workflow'
value: 1
Change-Id: I466024d71d5b1d89fcdc32355e2a9fe13abf5c28
The "Open change" dialog now supports the full search syntax (which
is still just a placeholder). It is also slightly more robust
about dealing with non-local changes when offline. The same checks
are now applied to inter-change links.
Change-Id: I3edf6dd66dc95b60eb7507ece813376f08815f80
Note that Gertty is for all Gerrits, not just OpenStack's, and so
should not assume any OpenStack-specific configuration.
Change-Id: I3f49c7c6589c136785f7d1d698a6dab16dbf0d35
Make the change list display not only changes for a project, but
any arbitrary set of changes represented by a query. This will
enable searching, inter-change linking, and custom dashboards.
The search syntax is extremly basic at the moment, but will be
extended to attempt to match the Gerrit webui search syntax as
closely as possible.
Use the new feature to implement a new kind of commentlink that
matches on Iabcdef style change-ids to "search" for matching
changes.
Change-Id: Icbcb166962fd96718ab56eb4118fc5ea43a4ba8b
Digest authentication is stateful - a nonce is given by the server and
used for the next request, and the response includes the next nonce
and so forth. By creating a digest state each time we issue a GET /
POST, we were starting that process over leading to a new 401 -
effectively doubling our request counts.
Change-Id: Ib9fc674760f6aec66daf5244c8f0150596ea3ae3
By default git will prune dangling commits more than 2 weeks old. All
the unmerged versions of reviews pushed up more than 2 weeks ago count
as such commits, so we're downloading all the history again and again
each time git-gc --auto ends up being invoked (which is triggered
amongst other things by loose object counts. This leads to random
stalls in gertty when it has to redownload those objects - and this
is obviously worse when offline.
This commit adds refs to prevent this behaviour, but doesn't remove
them at any point. We probably want to facilitate gc of
merged/abandoned/ignored commits at some point. I'm not sure if that
needs to happen in this commit or if it could be added later.
Change-Id: I01c61fd65207fe0dc99208241eefd5d6432c2ad0
Without this a new Session, which has a new PoolManager and thus a
new HTTPS connection pool is used for every single request.
We may have an issue with leaking connections (based on my debug runs
so far) but the default behaviour in that case degrades to unpooled
(new connection made, used, thrown away) so it will be no worse other
than the small overhead of 10 (the default) sockets & SSL session
metadata.
Change-Id: I4b2a4efa414dfc5f8f57b6640ba6796b8a109f58
This depends on a bug fix in GitPython's 0.3 branch, so crude
backwards compat support has been added until thats in a release.
Change-Id: I03088e372901897b4edcfdb52c6567d2b6626a60
Gerrit represents changes to commits with a file change of /COMMIT_MSG
and magically offset file comments :/. In this patch I reproduce that
logic sufficiently well to match up on all the commits I have looked
at.
Since diffs vs the base should not show the old commit's commit
message, I have hinted to the diff function when to include the commit
message in the output.
Change-Id: I8adb9fa22b384cace88f114f770a3eb5d3a89f5c
For our friends who find things on github, having a file called
CONTRIBUTING.rst is helpful, as it displays as instructions (that
likely no one will read) in the pull request create screen.
Change-Id: Ifcb28600ccc8919a298639c018f6b49eddb7f4ee
Whether we're dealing with depends-on or needed-by, the code is
essentially the same, so let's refactor it.
Change-Id: Ibea8a46059b0da5b23af33236bc53952d90e716e
Where there are multiple revisions of a child change that depend on
the same revision of the parent, we hit this:
File ".../gertty/view/change.py", line 548, in refreshDependencies
unseen_keys.remove(c.key)
KeyError: 177
An example of this a change with this issue is that revision 1 of
I8cd0af9bd4d3669f436f169059e4b602d4d3036c is the parent of revisions 1 and 2
of If608302b6efacceb9ac3630b7ac402cf65ae6d68.
Handle this case by uniqifying the children list simply by using a mapping
of change key to subject.
Change-Id: I934c6df1bdf12bf87cc9e6827d38b92d04057f39
A recent change added support for synchronously fetching missing
refs for a change, however, if something happened to the git repo
(eg, it was garbage collected or completely removed) then gertty
won't be able to work offline (not to mention will be very slow).
Add db columns to store the fetch locations and a sync job that
will verify that all of the commits gertty needs (for open changes
at least) are on disk, and if not, will fetch them.
Change-Id: If608302b6efacceb9ac3630b7ac402cf65ae6d68
This should greatly reduce the number of unecessary sync calls by
storing the last time a gertty queried for changes to a project.
Previously, we used the updated time of the latest change in a
project, however, subsequent queries with that value would typically
return the same change even though it needn't be synced. Adjusting
that value by a small amount is unlikely to work reliably because
the query is for a relative time and it takes some time to process.
Adjusting for a larger amount (eg, a few seconds) might miss data.
Clock skew is also a concern in this system because we are using
subtracting the server time from the client's time.
By storing the last sync time locally, we can continue to update
it past the highest value that gerrit has, so that we eventually
get queries which return no results. Clock skew is not an issue
because the delta arithmetic only involves client generated times.
We can also increase the window slightly to account for query
processing time without continuously sync already-synced changes.
Change-Id: I8cd0af9bd4d3669f436f169059e4b602d4d3036c
If gertty is interrupted when fetching commits, or, well, any number
of weird things happen to the git repo, we could end up not having
the needed commits locally. Do a sanity check before opening a
change and fetch them if needed.
Change-Id: I9bbecd09d1820e405b51a8471c5fd9e4fe8a7841
If git diff detects a file rename with no changes, it might add
some (currently) unparseable text to the diff. Ignore it to avoid
an error.
Change-Id: I3542e0dfd9d7c749510f0539066cfa0147e239a3
Gertty would crash if the screen was narrower than the widest column
in a table. This corrects that.
Change-Id: Ie0a2c6fae16c7c484edb6724fa5dd5f79065e94f
Add a 'link' commentlink substitution type that is a hyperlink
which will open the link in the user's web browser. A built-in
configuration will apply this automaticlly to most http(s)?://
links (using a very simple and not entirely correct regex).
My current commentlink section in my config is as follows:
commentlinks:
- match: "^- (?P<job>.*?) (?P<url>.*?) : (?P<result>.*?) (?P<rest>.*)$"
replacements:
- link:
text: "{job:<42}"
url: "{url}"
- text:
color: "test-{result}"
text: "{result} "
- text: "{rest}"
In order to support the Zuul commentlink syntax.
Change-Id: Ifceee547c116fdcc15b50a2f73a0ddfe2e98af84
Since we are enforcing stricter concurrency requirements for sqlite,
we should make sure that the length of time we hold the db lock is
minimal.
Change-Id: Ie69e97667c4a36b4460bab73dcce5f7d423e0640
Allow the user to modify the palette and create entire custom palettes
in the config file.
Add support for commentlinks, where matching text can be reformatted
and color added. A future possibility is adding clickable buttons to
the text. The following snippet in .gertty.yaml will format and colorize
the Zuul messages:
palettes:
- name: default
test-SUCCESS: ['light green', '', '']
test-FAILURE: ['light red', '', '']
commentlinks:
- match: "^- (?P<job>.*?) (?P<url>.*?) : (?P<result>.*?) (?P<rest>.*)$"
replacements:
- text: "{job:<42}"
- text:
color: "test-{result}"
text: "{result} "
- text: "{rest}"
Change-Id: Ib4644edd42333f2ef252a6318182efeff16ce1e1
To support commentlinks, palettes, custom dashboards and other
potential future enhancements, we'll need a config file that can
express complex data structures. Change from configparser to yaml,
adding dependencies on pyyaml and voluptuous for validation.
Change-Id: I670eed0cee1b15aa35d0fa9aea0996603ae08444
If two dialogs were stacked, when the top one closed we assumed the
top widget would have a title, but it may be another dialog in which
case it does not.
Change-Id: I9353400bf6000bfd106783c157412df150c76d1e
Add a dialog that prompts for a change number and syncs that change
if needed then immediately opens the change.
Change-Id: Ic2d4f41ad9bd944c2540e8d71bdd3e730bb96117
gertty requires it now but does not declare that.
Also, move pbr to the top of the requirements list. Because of how
python requirements and transitive depends, pbr needs to be listed
first or else hijinks can ensue.
Change-Id: I06c14039501c239d6ead1a66ce8fcfaa7453855c
The 'k' key will permanently hide a change from most views. Hidden
changes will continue to show up in the 'all open changes' list, but
not the list of unreviewed changes.
Change-Id: I7fe78c6091c77616339ba73e891434a49bf7df4a
So that the review toggle command can have the same keybinding
in the change list and change view, switch it to 'v'. 'r' and 'd'
are other candidates but both make more sense for the 'review' and
'diff' commands in the change view.
Change-Id: I806fd528cc6fa648450d69181aadbacd67548dda
This makes the unreviewed/open change list a little more consistent
but makes it impossible to view closed changes. We'll add that back
later in another manner, but for now, focus the review task lists
on open changes.
Change-Id: Ide7027e25df40800cde7cba224129f14d2745775