Some links still pointed to out-of-date openstack.org URLs. This updates
references to point to the current opendev.org locations.
Change-Id: I03a006948bf3f8b056cc7787c5fcda51aa9373fb
* Remove unused files babel.cfg and openstack-common.conf.
* Remove obsolete entries from setup.cfg.
* Remove six as requirement
* Switch to newer hacking version and fix all problems.
* Remove Babel requirement, update requirements for python3
Change-Id: I1fc46288e54a5b787afbd9ee31b32a0e7d28c6de
We can now use the standard library mock library instead of the third
party one previously needed for py27 compatibility.
Change-Id: I6b80b62d8e3c8bd9432f567e0725c191cef6f715
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
When using the reviewers command to get stats on stable branch
reviews, I always think I can specify --stable and --project nova
to get nova stable reviews, but that's not how the command
works and the --project option is ignored resulting in a report
which I don't expect, i.e. there are non-nova reviewers in the
report.
This makes --project and --stable mutually exclusive to avoid that
confusion.
Change-Id: Ie9938f5e68f27b9a5a58635be2185365f041136f
optparse is deprecated in python 2.7 and not available
starting in python3. This changes the reviewers command
to use argparse instead.
Change-Id: I76f270b4e998e8cf2a56c12d7bf70c0651c69d16
Various issues hit when switching to using stestr to run tests.
Presumably from other pulled in dependencies. This raises hacking to a
version that fixes a pyflakes issue [0] and addresses other pep8
violations that are then identified.
[0] https://github.com/PyCQA/pyflakes/pull/80
Change-Id: I9d8637d50067d6618aa408f4dbd9c736956099ed
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Instead of manually curating a list of all the subprojects in a
project, we should use the governance repo that already includes
most, if not all, of this information.
For the moment, this change just adds the governance data to the
data already in the json files. This is because I'm not sure whether
there is a 1:1 relationship between what is in governance and what
is in the json files. It's possible we could eliminate the json files
entirely at some point, but for the moment this gets us updated
subproject lists for essentially free, since it's likely that many
projects' json files are missing subprojects added in the past few
years.
Change-Id: Ia3992dd30f83294a96ace155691e50838cd5543b
We handle errors loading the cache, but if we run out of memory while
writing the cache file it can also cause the run to fail unnecessarily.
If the cache is not written it just means data will have to be
retrieved from Gerrit.
Change-Id: I64ec3030000fc9d62fa8e55ba1524aeaf4f4095c
review.openstack.org is now a redirect to review.opendev.org. We
should just point at the new location.
Change-Id: Ibae768aa25464e6133d4d65d9a59b919ee689fe4
The pickle file is just a local cache of Gerrit data. If we fail to
load it, it will just be regenerated from Gerrit. We should never
allow a failure in pickle.load to be fatal.
Change-Id: If433fa5f335db8db63cdd264919c0dbeb3a7a32e
This adds a special "all" stable branch value handling for the
reviewers entrypoint. This allows one to do something like:
$ reviewers --stable all --days 90 --output ~/stable-all-reviewers-90
It would be nice to be able to specify a specific project, like nova,
with --stable but that is another change for another day.
Change-Id: I045e982e587c9fb2c53a9cb587f944f09c2c5793
Changes from:
Reviews for the last 120 days in stable
to:
Reviews for the last 120 days in stable/liberty
Change-Id: I6adf3523b39a6621d657c569653bc605a7a911cc
It seems some groups (eg trove-stable-maint) contain members that lack a
'username' attribute.
This causes reviewstats to stack trace.
Fix that by filtering out these problematic users.
Change-Id: I5b5dd602a7ccf8be56e8227a3037f7d426087a06
This allows you to pass just the project name, like 'nova',
to the --project option so you don't have to actually know
the underlying file structure.
Change-Id: I9f0f7f54ff5f5c1d99f391fc0706c00ccbe8886f
The list of core team members was being retrieved for every review
for each patchset. The utils.get_core_team does some caching to make
sure an API call wasn't made for each of these calls, but since the
project never changes for the review we can save a few cycles by not
making the call if it's not necessary.
This moves the retrieval of the core list before the loop through
reviews to make sure it's only called once per patchset.
Change-Id: Iac9f3b6eb71131eccce58a60656865eeb77b8fda
It turns out len(changes) is only the correct number of changes to
skip the first time through with an empty cache. On subsequent
runs it skips way too far ahead in the gerrit changes and thus
never gets any new ones.
This change keeps track of the number of new changes separately
from the length of changes, which seems to make the behavior with
a cache work correctly again.
Change-Id: I1e3509d2d54b514afba64fedecc6a9f5ca408235
Gerrit 2.11 no longer seems to support the sortKey method of
skipping changes. Instead is provides a --start option that takes
a number of changes to skip.
See: https://review.openstack.org/Documentation/cmd-query.html
In addition, this required a change to the format of the changes
dict. It turns out we were overwriting some changes if two had the
same id. This is common in stable branch cherry picks.
In order to avoid this, I used a tuple of id, project, branch
as the key for the changes dict. This does break compatibility
with existing cache files, so a check was added to clear old
caches.
Both of these changes were required together because otherwise we
end up with a smaller number of items in changes than we should
have, and the --start argument is incorrect so we start double
processing changes, which breaks the loop because it looks like
the change was already cached.
Change-Id: If5ab46ce3367b3790e0db1d8bb1ed18e39202ad9
All of the project json files had lists of the core review team
members. Since this was originally written, gerrit has added a REST
API and this information is available through that API. Get the info
from there instead when we can.
There are a few project files I didn't convert because the equivalent
gerrit team wasn't immediately obvious.
Change-Id: Ie7ae19d9a58a5148002676604fd6962ea1438786
Signed-off-by: Russell Bryant <rbryant@redhat.com>
This just centralizes the code for getting the core team for a
project. The next patch will add an alternate method for determining
the team by querying gerrit's REST API.
Change-Id: I016fd8378c5fb69ed7c9192899d8dcfe9bdb466e
This code was reconnecting via ssh on every iteration of the loop,
which is completely unnecessary. It should use the existing
connection and only reconnect if there was an SSH error when exeuting
a command. The code should also explicitly close the connection when
its done.
Change-Id: I2545a1ca5e0cd39a8b453445ea25927756b1fd19
With no cache, this code has to download the entire review history for
a project, which takes a really long time, not to mention it's
generally wasteful.
There was code to keep a local cache, but it expired after an hour.
It would make quick repeated runs go faster, but for the stats I keep
posted for OpenStack projects this didn't help. I regenerate
everything less often. My stats site is basically broken because of
how terribly inefficient this is.
This updated code keeps the cache around without expiring it.
Instead, it just updates the cache until it hits the first change that
hasn't changed since our cached version and stops. This should make
things work much better and allow my stats site to keep working.
Change-Id: I784b99dfabeeca81c779dcfda15f1f20bb736957
Add the possibility to choose a gerrit server in this script, to
be consistent with the other command-line utilities.
Change-Id: If17f9dc3262ebc04cc8c8cabc3cdee04c0b14d5c
When redirecting the output of openreviews to a file, if there are
utf-8 characters in, for example, a commit message, openreviews
will raise an exception because it tries to encode as ascii by
default.
This change explicitly encodes basestring output to utf-8 so it
doesn't matter what the encoding of the output stream is.
Change-Id: I581c1a98bdbbbfb17ccf33c59295d6fbf8729ab9
Since WIP is just a workflow vote now, the old method of filtering
out those patches is no longer working. This change should take
care of that.
Change-Id: I8a028de992399df324927a4b0c191e7a5b684773
Some of the review types returned in the Gerrit JSON data have
changed, so reviewstats wasn't finding any reviews. This also
adds support for the new Workflow votes so new approvals will
show up correctly.
Note that the output from reviewstats still seems to be rather
bogus because the review timestamps appear to have all been updated
in the upgrade, but I think reviewstats is processing the data as
intended with this change.
Change-Id: I6cccf427a0ff875fdbc59f8c8d83a37db567f786
I'm seeing random ssh connection failures that are messing up my
periodic runs of these scripts. Add a few retires for the connect
attempt.
Change-Id: I171328813e29a2d6141c90866d50486b500ff61a
This seems to be a common reason a connect failure happens.
Explicitly trying again with allow_agent=False may make it work.
Change-Id: If14a9f9eb0d6f707e4f939cb96ab5f6c4844a541
My VM that re-generates the stats is now breaking on a MemoryError when trying
load the local cache. Ignore this for now since it will fall back to querying
gerrit.
Change-Id: I151fae89d9fb9a45d72e72c5aade4cb3342b4267
Adds a "-s" option that lets you specify the name of a stable branch
(for example "-s havana") instead of specifying a project (-p) or all
projects (-a).
reviewers.py will then use a specific stable.json file that defines the
set of projects stable-maint-core has authority on, as well as the
contents of that core team.
Note: -s disables result caching since the search is made on
specific branches, which would pollute the general purpose cache.
Change-Id: Idd03f51c98e006972bc93e3ce11e052cd1cc26aa
Make it more clear that the list of oldest reviews is just that, and not call it
a variant of calculating the longest waiting reviews.
Change-Id: I890f07519ceccfc57a5a73293817105a3b8c9f53
This is a first draft at a timeseries generator to extract an overview
of bug activity in Launchpad. I'm entirely sure that this can be
improved, mainly I wanted it up before the Nova meeting.
Change-Id: I887db503b8a0ce274f3819d90877ef14f13cbeff