-
Notifications
You must be signed in to change notification settings - Fork 427
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
AZP: Retry git clone #10158
AZP: Retry git clone #10158
Conversation
c7f4e0d
to
06bcc58
Compare
06bcc58
to
819362f
Compare
@@ -247,3 +247,23 @@ get_arch() { | |||
echo "$arch" | |||
fi | |||
} | |||
|
|||
git_clone_with_retry() { |
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.
fix indentation (see other functions in this file)
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.
Changed indentation to match the existing code style.
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.
existing indentation uses 4 spaces you use tabs, its not the same
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 catch! Fixed.
buildlib/az-helpers.sh
Outdated
local branch="$1" | ||
local target_dir="$2" | ||
local max_attempts=5 | ||
local repo_url="https://github.com/openucx/ucx.git" |
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.
can we take it from some azure env var?
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.
Done, thank you for the great idea!
buildlib/az-helpers.sh
Outdated
|
||
for attempt in $(seq 1 $max_attempts); do | ||
echo "Attempt $attempt of $max_attempts: Cloning UCX (branch: $branch)" | ||
if git clone --depth 1 -b "$branch" "$repo_url" "$target_dir"; then |
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.
maybe pass depth as a parameter?
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.
Done, 10x!
@Alexey-Rivkin pls squash |
f665c89
to
248a2a0
Compare
What
Retry 'git clone' command in case of a failure.
Why ?
Sometimes we get a git clone error:
Switching to the built-in Azure function will prevent such failures using the retry logic.