albertyw / git-reviewers Goto Github PK
View Code? Open in Web Editor NEWIntelligently find code reviewers
License: MIT License
Intelligently find code reviewers
License: MIT License
Currently the base branch which changes are compared against is hardcoded to master
:
git-reviewers/git_reviewers/reviewers.py
Lines 126 to 128 in 014e645
This is an issue because in many scenarios, git reviewers can be run on a branch which would be based on another branch such as origin/master
. If that diverges from master
then the whole algorithm is not based on the right changes, and in the worst case it results in terrible performance as seen in #40.
So ideally this should be configurable via a CLI option, since the base branch will vary per repo. However a good first start would be to default to comparing against the branch configured as $mybranch
's upstream branch by the branch.$mybranch.remote
and branch.$mybranch.merge
configuration options.
It'd be nice to have .gitattributes
as another source of reviewer/maintainer information.
Read git commit messages and find out who reviews diffs.
Deleted files cannot be looked up in git.
Decrease weight of reviewers who last worked on code a long time ago.
Might depend on albertyw/git-browse#23
$ pip3 install --user git+https://github.com/albertyw/git-reviewers.git
Collecting git+https://github.com/albertyw/git-reviewers.git
Cloning https://github.com/albertyw/git-reviewers.git to /tmp/pip-065tb0r7-build
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-065tb0r7-build/setup.py", line 8, in <module>
from git_reviewers import reviewers
File "/tmp/pip-065tb0r7-build/git_reviewers/reviewers.py", line 136, in <module>
class FindHistoricalReviewers(FindFileLogReviewers):
File "/tmp/pip-065tb0r7-build/git_reviewers/reviewers.py", line 137, in FindHistoricalReviewers
def get_reviewers(self) -> typing.Counter[str]:
AttributeError: module 'typing' has no attribute 'Counter'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-065tb0r7-build/
This happens with Python 3.5.3, but not 3.6.1.
Just look at the username before the email. Lots of companies (including where I work) follow this convention. Cool project btw!
See API
https://secure.phabricator.com/conduit/method/user.search/
and sample client
https://github.com/disqus/python-phabricator
Would be [email protected]
.
I did a fresh pip install
and ran it, but strace
showed it running git shortlog -sne
in many files in the repo, and each one takes about 0.25s to complete, so on a large repo this seems to take forever. Since there was no visible feedback, I initially assumed it had hung.
Find who commits to the files that you are modifying and weight accordingly.
git-reviewers should be able to parse https://help.github.com/articles/about-code-owners/ and make recommendations from it
$ git reviewers
Exception
[cURL/7] (https://code.uberinternal.com/api/user.whoami) <CURLE_COULDNT_CONNECT> The cURL library raised an error while making a request. You may be able to find more information about this error (error code: 7) on the cURL site: http://curl.haxx.se/libcurl/c/libcurl-errors.html#CURLECOULDNTCONNECT
(Run with `--trace` for a full exception trace.)
Traceback (most recent call last):
File "/Users/albertyw/.dotfiles/scripts/git/git-reviewers/git_reviewers/reviewers.py", line 315, in <module>
main()
File "/Users/albertyw/.dotfiles/scripts/git/git-reviewers/git_reviewers/reviewers.py", line 310, in main
reviewers_list = get_reviewers(config)
File "/Users/albertyw/.dotfiles/scripts/git/git-reviewers/git_reviewers/reviewers.py", line 205, in get_reviewers
most_common = FindArcCommitReviewers(config) \
File "/Users/albertyw/.dotfiles/scripts/git/git-reviewers/git_reviewers/reviewers.py", line 77, in filter_phabricator_activated
usernames = [self.parse_phabricator(*x) for x in username_processes]
File "/Users/albertyw/.dotfiles/scripts/git/git-reviewers/git_reviewers/reviewers.py", line 77, in <listcomp>
usernames = [self.parse_phabricator(*x) for x in username_processes]
File "/Users/albertyw/.dotfiles/scripts/git/git-reviewers/git_reviewers/reviewers.py", line 63, in parse_phabricator
phab_output = json.loads(output_str)
File "/usr/local/Cellar/[email protected]/3.9.1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/Cellar/[email protected]/3.9.1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/Cellar/[email protected]/3.9.1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Running git reviewers on code that has already been committed (onto a branch) does not get any results. git reviewers should do a diff between the current branch and the master.
Right after installation, I get this error message:
$ git reviewers
usage: reviewers.py [-h] [-v] [-i IGNORE] [-c]
reviewers.py: error: unrecognized arguments: --path=./
Indeed, the --path
argument is not listed in the --help
output, neither can be found in the code. If I remove the --path=${GIT_PREFIX:-./}
, it works just fine.
https://github.com/johnnadratowski/git-reviewers might have some good ideas.
The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.
List strategies for getting reviewers, remove path argument.
There are disabled users that git-reviewers is supposed to recognize and remove but it doesn't seem to work right now.
Read reviewers from entire repository history
When running git reviewers -c
Traceback (most recent call last):
File "/Users/albertyw/.dotfiles/scripts/git/git-reviewers/git_reviewers/reviewers.py", line 192, in <module>
main()
File "/Users/albertyw/.dotfiles/scripts/git/git-reviewers/git_reviewers/reviewers.py", line 188, in main
show_reviewers(reviewers_list, args.copy)
File "/Users/albertyw/.dotfiles/scripts/git/git-reviewers/git_reviewers/reviewers.py", line 141, in show_reviewers
p.communicate(input=reviewer_string)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 828, in communicate
self._stdin_write(input)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 781, in _stdin_write
self.stdin.write(input)
TypeError: a bytes-like object is required, not 'str'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.