Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to pygit2 #122

Closed
wants to merge 31 commits into from
Closed

Switch to pygit2 #122

wants to merge 31 commits into from

Conversation

jgowdy
Copy link
Contributor

@jgowdy jgowdy commented Oct 26, 2020

Considerable performance improvements over both v1.1.2 and v2.0.1 by switching from GitPython to pygit2

@jgowdy
Copy link
Contributor Author

jgowdy commented Oct 27, 2020

Remotes (ssh, https, and local+fetch) are working, but the ssh credentials logic needs to allow for an option to specify the location of the files.

Unit tests haven't been fixed up for pygit2

@jgowdy jgowdy force-pushed the pygit2 branch 6 times, most recently from 14e2765 to 6c4ee3b Compare October 27, 2020 20:58
@mxhenry-godaddy mxhenry-godaddy linked an issue Oct 28, 2020 that may be closed by this pull request
@mxhenry-godaddy mxhenry-godaddy added this to the Version 2.1 milestone Oct 28, 2020
@mxhenry-godaddy mxhenry-godaddy added the enhancement New feature or request label Oct 28, 2020
@jgowdy jgowdy force-pushed the pygit2 branch 5 times, most recently from 6945e4e to 42bfa4b Compare November 4, 2020 01:13
@codecov
Copy link

codecov bot commented Nov 23, 2020

Codecov Report

Merging #122 (93e4485) into master (a7e189b) will decrease coverage by 9.83%.
The diff coverage is 58.67%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #122      +/-   ##
==========================================
- Coverage   93.53%   83.69%   -9.84%     
==========================================
  Files           9        9              
  Lines         603      736     +133     
  Branches      108      128      +20     
==========================================
+ Hits          564      616      +52     
- Misses         33      103      +70     
- Partials        6       17      +11     
Impacted Files Coverage Δ
tartufo/cli.py 96.72% <ø> (-3.28%) ⬇️
tartufo/util.py 50.92% <33.01%> (-35.85%) ⬇️
tartufo/scanner.py 90.24% <87.34%> (-1.56%) ⬇️
tartufo/commands/scan_local_repo.py 100.00% <100.00%> (ø)
tartufo/commands/scan_remote_repo.py 100.00% <100.00%> (ø)
tartufo/config.py 91.74% <100.00%> (ø)
tartufo/types.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a7e189b...93d9441. Read the comment docs.

@mxhenry-godaddy mxhenry-godaddy removed this from the Version 3.0 milestone Dec 8, 2020
@rdrey
Copy link
Contributor

rdrey commented Dec 11, 2020

Just wanted to note that this (#122) and #66 are currently blocked by the wheels for libgit2/pygit2#1024 . pygit2 for pypy3 also doesn't build in the github actions at the moment. (We'd need to install the build-time dependencies of pygit2.) I got the windows tests to pass in my fork.

Base automatically changed from master to main February 2, 2021 21:36
@tarkatronic
Copy link
Contributor

@jgowdy I had a realization this morning. Really more of an "omg DUH" moment. This is a case to listen to the Zen of Python:

Practicality beats purity.

Why go to all this trouble of handling all of these different protocols for cloning, and trying to fight with another package to get supported added for them cross-platform, when we already have a perfectly working cloning mechanism?

Let's either look at copying over the cloning code from GitPython (with attribution, of course), or go with the less-than-ideal option of simply leaving the GitPython dependency in there, solely for this one usage.

@rdreyer-godaddy
Copy link

I like that idea a lot. Clone with GitPython, scan with pygit2. By cloning with GitPython we respect the user's git settings / use the OS' auth setup. By scanning with pygit2 we can ignore all of the user's settings which could otherwise mess with the scan (like the default behaviour in #179).

@jgowdy
Copy link
Contributor Author

jgowdy commented Jun 29, 2021

Let's either look at copying over the cloning code from GitPython (with attribution, of course), or go with the less-than-ideal option of simply leaving the GitPython dependency in there, solely for this one usage.

This makes a great deal of sense!

@tarkatronic tarkatronic added this to the Version 3.0 milestone Aug 10, 2021
@sushantmimani sushantmimani mentioned this pull request Oct 19, 2021
15 tasks
@tarkatronic
Copy link
Contributor

This has been re-implemented in #233.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider switching away from GitPython
5 participants