-
Notifications
You must be signed in to change notification settings - Fork 69
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
[Pre-Commit] Continue Even if Fetch Failed #3878
Conversation
@MichaelYochpaz does it fail because of connection errors? if yes lets use the |
try
and except
blocksb085333
to
042c44c
Compare
@MichaelYochpaz see my comment here @ilaner is there a reason not to continue if |
@GuyAfik Adding a retry mechanism for a different case (where it's an issue that might be fixed on a retry), is a good idea, but handles a different case. Current code handles a case where there is no connection at all (like firewall issues, where retrying won't help). However, it's going to be problematic as the class GitUtil:
@retry(times=3, exceptions=(ConnectionError, Timeout))
@lru_cache
def fetch(self):
self.repo.remote().fetch()
... We can create a new module (that doesn't have any internal imports, like |
0169feb
to
741a85c
Compare
Co-authored-by: Guy Afik <53861351+GuyAfik@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job
Related Issues
fixes: https://jira-dc.paloaltonetworks.com/browse/CIAC-9231
Description
Fix an issue (visible mainly on pre-commit) where if fetching from git fails due to connection problems, the whole command fails, even though it should be able to continue (just won't run fully up-to-date)