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

Simplify sync by cloning in a temporary directory #75

Closed
wants to merge 1 commit into from

Conversation

mscherer
Copy link
Contributor

See #72 and #73

@mscherer
Copy link
Contributor Author

So I have not tested yet the code, just pushed to run CI, but there isn't one.

elekto/models/meta.py Outdated Show resolved Hide resolved
@mscherer mscherer marked this pull request as draft September 28, 2022 16:08
@jberkus
Copy link
Member

jberkus commented Sep 28, 2022

Hey, this is not the desired approach.

The reason we use pull() against a semi-persistent META directory is that clone() can be very expensive if the target repo is large. For example, the Kubernetes community repo (which includes elections) is 125MB. We do not want to be cloning the whole thing every time a webhook fires.

So yes we want to check for all errors, but we do not want to always clone instead of pulling.

@mscherer
Copy link
Contributor Author

Wouldn't a shallow clone alleviate that issue ?

@jberkus
Copy link
Member

jberkus commented Sep 28, 2022

125MB is the shallow clone.

@mscherer
Copy link
Contributor Author

Ok, so given the amount of commits not related to elections on the community kubernetes repo, a filter on the hook would also help, but that would just complexify the code on the hook to simplify elsewhere. Guess we just need the change for check_call then ?

@jberkus
Copy link
Member

jberkus commented Sep 28, 2022

Yeah, both pull and clone should check for all error conditions

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.

2 participants