Error when analysing dependencies in a 'real' repository (MacOS)
- Dominant language
- Python
- Stars
- 319
- Forks
- 55
- PR merge metrics
- No merged PRs in 30d
Description
[MacOS 10.14.5, Installed libgit2 using homebrew, and git-deps using pip3]
Nice idea, and the visualisation reduces the cognitive load associated with understanding the dependency graph.
However, whilst this tool works fine with an example similar to that in the video, I'm getting an error when running it against our real repository at Uni. The error messages below occur when accessing the same repository via the browser and using the CLI.) Any suggestions on how to fix this?
**git deps --serve** (GUI)
Typed *master* into the textbox
[2020-01-03 01:31:43,233] ERROR in app: Exception on /deps.json/master [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python3.7/site-packages/git_deps/server.py", line 103, in deps
detector.find_dependencies(rev)
File "/usr/local/lib/python3.7/site-packages/git_deps/detector.py", line 122, in find_dependencies
self.find_dependencies_with_parent(dependent, parent)
File "/usr/local/lib/python3.7/site-packages/git_deps/detector.py", line 147, in find_dependencies_with_parent
self.blame_hunk(dependent, parent, path, hunk)
File "/usr/local/lib/python3.7/site-packages/git_deps/detector.py", line 161, in blame_hunk
if not self.tree_lookup(path, parent):
File "/usr/local/lib/python3.7/site-packages/git_deps/detector.py", line 311, in tree_lookup
tree_or_blob = self.repo[tree_or_blob[dirent].oid]
KeyError: 'object not found - no match for id (5668198989e66aa87478ba3c9f5102639485e3c2)'
**git deps master** (CLI)
git deps master
4aae9cc00dc260007f8f6d3af633639f99ced3b1 fec35b7eb51f6c644486e39feb02108d8bcd590a
4aae9cc00dc260007f8f6d3af633639f99ced3b1 0244cbb301caa2f6df953f95a9b17f7da2c86140
4aae9cc00dc260007f8f6d3af633639f99ced3b1 bcd7a130ca4cc736edd5e259629d8b13fd54110c
4aae9cc00dc260007f8f6d3af633639f99ced3b1 9d03f8e726eb3e7537d14f65b6ce53b9a78a7ecc
4aae9cc00dc260007f8f6d3af633639f99ced3b1 012e405173c2a12cb774662542dd9f0254197865
4aae9cc00dc260007f8f6d3af633639f99ced3b1 d526b3d262036e6400070985932a537d71a2dfda
4aae9cc00dc260007f8f6d3af633639f99ced3b1 ef5daeae0578a3af957e87a399aa3828200ef21a
4aae9cc00dc260007f8f6d3af633639f99ced3b1 2506addacca283ef6db268f67772a93810452948
Traceback (most recent call last):
File "/usr/local/bin/git-deps", line 8, in
sys.exit(run())
File "/usr/local/lib/python3.7/site-packages/git_deps/cli.py", line 141, in run
main(sys.argv[1:])
File "/usr/local/lib/python3.7/site-packages/git_deps/cli.py", line 135, in main
cli(options, args)
File "/usr/local/lib/python3.7/site-packages/git_deps/cli.py", line 119, in cli
detector.find_dependencies(rev)
File "/usr/local/lib/python3.7/site-packages/git_deps/detector.py", line 122, in find_dependencies
self.find_dependencies_with_parent(dependent, parent)
File "/usr/local/lib/python3.7/site-packages/git_deps/detector.py", line 147, in find_dependencies_with_parent
self.blame_hunk(dependent, parent, path, hunk)
File "/usr/local/lib/python3.7/site-packages/git_deps/detector.py", line 161, in blame_hunk
if not self.tree_lookup(path, parent):
File "/usr/local/lib/python3.7/site-packages/git_deps/detector.py", line 311, in tree_lookup
tree_or_blob = self.repo[tree_or_blob[dirent].oid]
KeyError: 'object not found - no match for id (5668198989e66aa87478ba3c9f5102639485e3c2)'
Contributor guide
Research direction
Reproduce the failure with the reported macOS setup and a repository that triggers it, using the CLI and the /deps.json/master server route. Read git_deps/detector.py around find_dependencies, blame_hunk, and tree_lookup, along with the callers in git_deps/cli.py and git_deps/server.py. Done means dependency analysis completes without the reported missing-object KeyError in both interfaces.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- flask, git, python
- Domain
- backend, cli, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100