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

Use pygit2 instead of GitPython and OS git binary #129

Merged
merged 2 commits into from
Feb 5, 2024

Conversation

ghukill
Copy link
Collaborator

@ghukill ghukill commented Feb 2, 2024

Purpose and background context

OGM harvests require a fair amount of git functionality to interact with the OGM repositories. Previously was using GitPython for some operations, and then using the OS level git binary + subprocess for some detailed file diff information as GitPython did not provide this.

It was discovered that pygit2 (link) would support all operations needed, and is ultimately more low level and flexible if needed.

How can a reviewer manually see the effects of these changes?

Functionality is the same, but the test suite has been updated to create the simulated OGM repositories with pygit2, and the OGM harvester now performs git cloning, reading commits, and reading of file diffs using pygit2 as well.

Includes new or updated dependencies?

YES

Changes expectations for external applications?

NO

What are the relevant tickets?

  • None

Developer

  • All new ENV is documented in README
  • All new ENV has been added to staging and production environments
  • All related Jira tickets are linked in commit message(s)
  • Stakeholder approval has been confirmed (or is not needed)

Code Reviewer(s)

  • The commit message is clear and follows our guidelines (not just this PR message)
  • There are appropriate tests covering any new functionality
  • The provided documentation is sufficient for understanding any new functionality introduced
  • Any manual tests have been performed and verified
  • New dependencies are appropriate or there were no changes

Why these changes are being introduced:

OGM harvests require a fair amount of git functionality to interact with the OGM repositories.  Previously was
using GitPython for some operations, and then using the OS level git binary + subprocess for some detailed
file diff information as GitPython did not provide this.

It was discovered that pygit2 would support all operations needed, and is ultimately more low level
and flexible if needed.

How this addresses that need:
* Use pygit2 for all git operations

Side effects of this change:
* Calling context must have libgit2 available

Relevant ticket(s):
* None
@ghukill ghukill force-pushed the GDT-85-ogm-incremental-harvest-improvements branch from 771b091 to 8a3ca19 Compare February 2, 2024 21:04
Copy link
Contributor

@ehanson8 ehanson8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good update!

@ghukill ghukill force-pushed the GDT-85-ogm-incremental-harvest-improvements branch from d099a00 to 98aa5a5 Compare February 5, 2024 14:41
@ghukill ghukill merged commit c99ab36 into main Feb 5, 2024
6 of 8 checks passed
@ghukill ghukill removed the request for review from jonavellecuerdo February 5, 2024 15:20
@ghukill ghukill deleted the GDT-85-ogm-incremental-harvest-improvements branch February 7, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants