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

make github connector idempotent #417

Merged
merged 6 commits into from
Feb 23, 2024

Conversation

OwenPriceSkelly
Copy link
Member

@OwenPriceSkelly OwenPriceSkelly commented Feb 22, 2024

fixes #413

Discussion

This tweaks the trackcalls decorator so that stage can use its own has_been_called attribute and guarantee that it only executes once.

This makes the GH connector behave a little more like the huggingface one by pulling instead of cloning when the directory is already a git repo.

Testing

Wrote a cute little unit test, since it was easy
updated the unit test so it checks that pull is called instead of clone when appropriate

Documentation

no docs


📚 Documentation preview 📚: https://garden-ai--417.org.readthedocs.build/en/417/

@codecov-commenter
Copy link

codecov-commenter commented Feb 22, 2024

Codecov Report

Attention: Patch coverage is 96.55172% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 76.64%. Comparing base (9eb5ba2) to head (fe0a947).

Files Patch % Lines
garden_ai/model_connectors/github_conn.py 85.71% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #417      +/-   ##
==========================================
+ Coverage   76.22%   76.64%   +0.41%     
==========================================
  Files          46       46              
  Lines        2810     2834      +24     
==========================================
+ Hits         2142     2172      +30     
+ Misses        668      662       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@WillEngler WillEngler left a comment

Choose a reason for hiding this comment

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

This looks great!

@OwenPriceSkelly OwenPriceSkelly merged commit cf5a849 into main Feb 23, 2024
7 checks passed
@OwenPriceSkelly OwenPriceSkelly deleted the 413-make-gh-connector-idempotent branch February 23, 2024 22:19
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.

GitHubConnector.stage() is not idempotent
3 participants