pinterest / git-stacktrace Goto Github PK
View Code? Open in Web Editor NEWEasily figure out which git commit caused a given stacktrace
Home Page: https://pypi.python.org/pypi/git-stacktrace
License: Apache License 2.0
Easily figure out which git commit caused a given stacktrace
Home Page: https://pypi.python.org/pypi/git-stacktrace
License: Apache License 2.0
Right now git-stacktrace only supports python stacktraces, but it would be a useful tool for other languages. Have we considered adding this?
Input traceback
ValueError: invalid literal for int() with base 10: 'None'
File "flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "flask_cors/extension.py", line 161, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "flask/_compat.py", line 33, in reraise
raise value
File "flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "<decorator-gen-39>", line 2, in ci
File "geetest_client.py", line 209, in captcha_counter_decorator
return func(*args, **kwargs)
File "company.py", line 305, in ci
company = get_company_info(company_id)
File "company.py", line 129, in get_company_info
return get_company_info_from_es(company_id) or get_company_info_from_element(company_id)
File "company.py", line 144, in get_company_info_from_es
annuals = choose_and_prettify_annual(company_id, result.get('extra', {}).get('类型', ''))
File "company.py", line 174, in choose_and_prettify_annual
result = prettify(annuals, is_llc=is_llc, show_all=show_all)
File "prettify/annual.py", line 45, in prettify
year = int(annual.get('year') or 0)
Error:
Traceback (most recent call last):
File "/Users/messense/.local/bin/git-stacktrace", line 11, in <module>
sys.exit(main())
File "/Users/messense/.local/venvs/git-stacktrace/lib/python3.6/site-packages/git_stacktrace/cmd.py", line 45, in main
traceback = api.parse_trace(blob)
File "/Users/messense/.local/venvs/git-stacktrace/lib/python3.6/site-packages/git_stacktrace/parse_trace.py", line 195, in parse_trace
raise ParseException("Unable to parse traceback")
git_stacktrace.parse_trace.ParseException: Unable to parse traceback
I'm trying to use this with a java stack trace, which I think is supported. However, I'm getting an error.
Traceback (most recent call last):
File "/usr/local/bin/git-stacktrace", line 10, in
sys.exit(main())
File "/Library/Python/3.8/site-packages/git_stacktrace/cmd.py", line 78, in main
traceback = api.parse_trace(blob)
File "/Library/Python/3.8/site-packages/git_stacktrace/parse_trace.py", line 254, in parse_trace
raise ParseException("Unable to parse traceback")
git_stacktrace.parse_trace.ParseException: Unable to parse traceback
This is my example stack trace copied from intelliJ
substituteVariables:1779, StringUtil (com.company.util)
substituteVariables:1857, StringUtil (com.company.util)
substituteVariables:1834, StringUtil (com.company.util)
substituteVariableWithNullMethodReturnsEmptyString:439, StringUtilTest (com.company.util)
I tried running the tool on a Ubuntu vagrant box and an Alpine docker container, however both resulted in the following error.
Trace
Traceback (most recent call last):
File "/home/vagrant/.local/bin/git-stacktrace", line 7, in <module>
from git_stacktrace.cmd import main
File "/home/vagrant/.local/lib/python2.7/site-packages/git_stacktrace/cmd.py", line 10, in <module>
from git_stacktrace import api
File "/home/vagrant/.local/lib/python2.7/site-packages/git_stacktrace/api.py", line 22, in <module>
from git_stacktrace import parse_trace
File "/home/vagrant/.local/lib/python2.7/site-packages/git_stacktrace/parse_trace.py", line 38
class Traceback(object, metaclass=abc.ABCMeta):
^
SyntaxError: invalid syntax
Environment 1 (Vagrant)
Environment 2 (Docker)
The README is currently a little light on details around testing. It recommends running tox
in the base dir of the repo to initiate testing but this is currently unreliable/not working for me on several different systems due to various inconsistent errors.
As I'm new to tox, and there is no additional documentation, it's unclear to me if this is a tox issue or an issue with my development environment. It would be great if this could be documented a little more thoughtfully or if the configuration can be updated and tested on a few different platforms to improve reliability.
Here's one example error after installing tox with pip and running tox
:
jenders@dev-jenders:~/src/git-stacktrace$ tox
GLOB sdist-make: /home/jenders/src/git-stacktrace/setup.py
py27 create: /home/jenders/src/git-stacktrace/.tox/py27
py27 installdeps: -r/home/jenders/src/git-stacktrace/test-requirements.txt
ERROR: invocation failed (exit code 1), logfile: /home/jenders/src/git-stacktrace/.tox/py27/log/py27-1.log
===================================================================================================================== log start =====================================================================================================================
Collecting testtools (from -r /home/jenders/src/git-stacktrace/test-requirements.txt (line 1))
Using cached https://pypi-pim.pinadmin.com/packages/87/74/a4d55da28d7bba6d6f49430f22a62afd8472cb24a63fa61daef80d3e821b/testtools-2.3.0-py2.py3-none-any.whl
Collecting flake8 (from -r /home/jenders/src/git-stacktrace/test-requirements.txt (line 2))
Using cached https://pypi-pim.pinadmin.com/packages/26/de/3f815a99d86eb10464ea7bd6059c0172c7ca97d4bdcfca41051b388a653b/flake8-3.7.8-py2.py3-none-any.whl
Collecting pytest (from -r /home/jenders/src/git-stacktrace/test-requirements.txt (line 3))
Using cached https://pypi-pim.pinadmin.com/packages/e3/89/bdc4ee34896c03e1b42f80a5e1539443df4715f96d45cd7f4118b7c30229/pytest-5.2.0.tar.gz
Running setup.py (path:/tmp/pip-build-cKHgML/pytest/setup.py) egg_info for package pytest produced metadata for project name unknown. Fix your #egg=pytest fragments.
Collecting python-subunit (from -r /home/jenders/src/git-stacktrace/test-requirements.txt (line 4))
Using cached https://pypi-pim.pinadmin.com/packages/ee/3a/b8a93e1f5b9a9f7e0a7630146f1c62878b6949ac5e4bac6ae2ae13fa9f83/python_subunit-1.3.0-py2.py3-none-any.whl
Collecting fixtures (from -r /home/jenders/src/git-stacktrace/test-requirements.txt (line 5))
Using cached https://pypi-pim.pinadmin.com/packages/a8/28/7eed6bf76792f418029a18d5b2ace87ce7562927cdd00f1cefe481cd148f/fixtures-3.0.0-py2.py3-none-any.whl
Collecting mock (from -r /home/jenders/src/git-stacktrace/test-requirements.txt (line 6))
Using cached https://pypi-pim.pinadmin.com/packages/05/d2/f94e68be6b17f46d2c353564da56e6fb89ef09faeeff3313a046cb810ca9/mock-3.0.5-py2.py3-none-any.whl
Collecting sphinx (from -r /home/jenders/src/git-stacktrace/test-requirements.txt (line 7))
Using cached https://pypi-pim.pinadmin.com/packages/76/42/a4465a0080e545cd152f7d3f16229d5e1300183fcb1067e4ec7e639b8605/Sphinx-2.2.0.tar.gz
Complete output from command python setup.py egg_info:
ERROR: Sphinx requires at least Python 3.5 to run.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-cKHgML/sphinx/
You are using pip version 8.1.2, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
====================================================================================================================== log end ======================================================================================================================
ERROR: could not install deps [-r/home/jenders/src/git-stacktrace/test-requirements.txt]; v = InvocationError(u'/home/jenders/src/git-stacktrace/.tox/py27/bin/pip install -U -r/home/jenders/src/git-stacktrace/test-requirements.txt', 1)
py36 create: /home/jenders/src/git-stacktrace/.tox/py36
ERROR: InterpreterNotFound: python3.6
flake8 create: /home/jenders/src/git-stacktrace/.tox/flake8
flake8 installdeps: -r/home/jenders/src/git-stacktrace/test-requirements.txt
ERROR: invocation failed (exit code 1), logfile: /home/jenders/src/git-stacktrace/.tox/flake8/log/flake8-1.log
===================================================================================================================== log start =====================================================================================================================
Collecting testtools (from -r /home/jenders/src/git-stacktrace/test-requirements.txt (line 1))
Using cached https://pypi-pim.pinadmin.com/packages/87/74/a4d55da28d7bba6d6f49430f22a62afd8472cb24a63fa61daef80d3e821b/testtools-2.3.0-py2.py3-none-any.whl
Collecting flake8 (from -r /home/jenders/src/git-stacktrace/test-requirements.txt (line 2))
Using cached https://pypi-pim.pinadmin.com/packages/26/de/3f815a99d86eb10464ea7bd6059c0172c7ca97d4bdcfca41051b388a653b/flake8-3.7.8-py2.py3-none-any.whl
Collecting pytest (from -r /home/jenders/src/git-stacktrace/test-requirements.txt (line 3))
Using cached https://pypi-pim.pinadmin.com/packages/e3/89/bdc4ee34896c03e1b42f80a5e1539443df4715f96d45cd7f4118b7c30229/pytest-5.2.0.tar.gz
Running setup.py (path:/tmp/pip-build-CKpwth/pytest/setup.py) egg_info for package pytest produced metadata for project name unknown. Fix your #egg=pytest fragments.
Collecting python-subunit (from -r /home/jenders/src/git-stacktrace/test-requirements.txt (line 4))
Using cached https://pypi-pim.pinadmin.com/packages/ee/3a/b8a93e1f5b9a9f7e0a7630146f1c62878b6949ac5e4bac6ae2ae13fa9f83/python_subunit-1.3.0-py2.py3-none-any.whl
Collecting fixtures (from -r /home/jenders/src/git-stacktrace/test-requirements.txt (line 5))
Using cached https://pypi-pim.pinadmin.com/packages/a8/28/7eed6bf76792f418029a18d5b2ace87ce7562927cdd00f1cefe481cd148f/fixtures-3.0.0-py2.py3-none-any.whl
Collecting mock (from -r /home/jenders/src/git-stacktrace/test-requirements.txt (line 6))
Using cached https://pypi-pim.pinadmin.com/packages/05/d2/f94e68be6b17f46d2c353564da56e6fb89ef09faeeff3313a046cb810ca9/mock-3.0.5-py2.py3-none-any.whl
Collecting sphinx (from -r /home/jenders/src/git-stacktrace/test-requirements.txt (line 7))
Using cached https://pypi-pim.pinadmin.com/packages/76/42/a4465a0080e545cd152f7d3f16229d5e1300183fcb1067e4ec7e639b8605/Sphinx-2.2.0.tar.gz
Complete output from command python setup.py egg_info:
ERROR: Sphinx requires at least Python 3.5 to run.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-CKpwth/sphinx/
You are using pip version 8.1.2, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
====================================================================================================================== log end ======================================================================================================================
ERROR: could not install deps [-r/home/jenders/src/git-stacktrace/test-requirements.txt]; v = InvocationError(u'/home/jenders/src/git-stacktrace/.tox/flake8/bin/pip install -U -r/home/jenders/src/git-stacktrace/test-requirements.txt', 1)
docs create: /home/jenders/src/git-stacktrace/.tox/docs
docs installdeps: -r/home/jenders/src/git-stacktrace/test-requirements.txt
ERROR: invocation failed (exit code 1), logfile: /home/jenders/src/git-stacktrace/.tox/docs/log/docs-1.log
===================================================================================================================== log start =====================================================================================================================
Collecting testtools (from -r /home/jenders/src/git-stacktrace/test-requirements.txt (line 1))
Using cached https://pypi-pim.pinadmin.com/packages/87/74/a4d55da28d7bba6d6f49430f22a62afd8472cb24a63fa61daef80d3e821b/testtools-2.3.0-py2.py3-none-any.whl
Collecting flake8 (from -r /home/jenders/src/git-stacktrace/test-requirements.txt (line 2))
Using cached https://pypi-pim.pinadmin.com/packages/26/de/3f815a99d86eb10464ea7bd6059c0172c7ca97d4bdcfca41051b388a653b/flake8-3.7.8-py2.py3-none-any.whl
Collecting pytest (from -r /home/jenders/src/git-stacktrace/test-requirements.txt (line 3))
Using cached https://pypi-pim.pinadmin.com/packages/e3/89/bdc4ee34896c03e1b42f80a5e1539443df4715f96d45cd7f4118b7c30229/pytest-5.2.0.tar.gz
Running setup.py (path:/tmp/pip-build-8J4LSc/pytest/setup.py) egg_info for package pytest produced metadata for project name unknown. Fix your #egg=pytest fragments.
Collecting python-subunit (from -r /home/jenders/src/git-stacktrace/test-requirements.txt (line 4))
Using cached https://pypi-pim.pinadmin.com/packages/ee/3a/b8a93e1f5b9a9f7e0a7630146f1c62878b6949ac5e4bac6ae2ae13fa9f83/python_subunit-1.3.0-py2.py3-none-any.whl
Collecting fixtures (from -r /home/jenders/src/git-stacktrace/test-requirements.txt (line 5))
Using cached https://pypi-pim.pinadmin.com/packages/a8/28/7eed6bf76792f418029a18d5b2ace87ce7562927cdd00f1cefe481cd148f/fixtures-3.0.0-py2.py3-none-any.whl
Collecting mock (from -r /home/jenders/src/git-stacktrace/test-requirements.txt (line 6))
Using cached https://pypi-pim.pinadmin.com/packages/05/d2/f94e68be6b17f46d2c353564da56e6fb89ef09faeeff3313a046cb810ca9/mock-3.0.5-py2.py3-none-any.whl
Collecting sphinx (from -r /home/jenders/src/git-stacktrace/test-requirements.txt (line 7))
Using cached https://pypi-pim.pinadmin.com/packages/76/42/a4465a0080e545cd152f7d3f16229d5e1300183fcb1067e4ec7e639b8605/Sphinx-2.2.0.tar.gz
Complete output from command python setup.py egg_info:
ERROR: Sphinx requires at least Python 3.5 to run.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-8J4LSc/sphinx/
You are using pip version 8.1.2, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
====================================================================================================================== log end ======================================================================================================================
ERROR: could not install deps [-r/home/jenders/src/git-stacktrace/test-requirements.txt]; v = InvocationError(u'/home/jenders/src/git-stacktrace/.tox/docs/bin/pip install -U -r/home/jenders/src/git-stacktrace/test-requirements.txt', 1)
______________________________________________________________________________________________________________________ summary ______________________________________________________________________________________________________________________
ERROR: py27: could not install deps [-r/home/jenders/src/git-stacktrace/test-requirements.txt]; v = InvocationError(u'/home/jenders/src/git-stacktrace/.tox/py27/bin/pip install -U -r/home/jenders/src/git-stacktrace/test-requirements.txt', 1)
ERROR: py36: InterpreterNotFound: python3.6
ERROR: flake8: could not install deps [-r/home/jenders/src/git-stacktrace/test-requirements.txt]; v = InvocationError(u'/home/jenders/src/git-stacktrace/.tox/flake8/bin/pip install -U -r/home/jenders/src/git-stacktrace/test-requirements.txt', 1)
ERROR: docs: could not install deps [-r/home/jenders/src/git-stacktrace/test-requirements.txt]; v = InvocationError(u'/home/jenders/src/git-stacktrace/.tox/docs/bin/pip install -U -r/home/jenders/src/git-stacktrace/test-requirements.txt', 1)
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.