-
Notifications
You must be signed in to change notification settings - Fork 168
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
fix(resolver::git): refine repos cloning and fix git checkout
#1511
Conversation
simplify the way we clone repos, and don't pass `-f` to `git checkout` so that git won't fail silently.
fi | ||
fi | ||
return 0 | ||
retryGitOpWithoutDepthFlagIfFromBitbucket() { |
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.
Should we add some comments for why bitbucket needs to retry without depth flag?
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.
added.
Nice work. Did you test bitbucket case? @knight42 |
build/resolver/git/entrypoint.sh
Outdated
echo "Existed data not a valid git repo for ${SCM_URL##*//}" | ||
exit 1 | ||
} | ||
|
||
echo "Fetch $SCM_REVISION from origin" | ||
git fetch -v ${GIT_DEPTH_OPTION:-} origin $SCM_REVISION | ||
retryGitOpWithoutDepthFlagIfFromBitbucket fetch -v origin "$SCM_REVISION" |
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.
I think the function name should be renamed normally like cloneRetry blablabla, or something like that. And comment bitbucket.
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.
IMHO it is not quite convenient to view the comment of a function in bash, and I think it might be more obvious to user to use an informative(but maybe verbose) function name.
@hyy0322 hmm not yet, I would test with bitbucket later. |
LGTM |
@hyy0322 PTAL |
LGTM |
/lgtm |
/cherrypick cps-2.10-dood |
@zhujian7: once the present PR merges, I will cherry-pick it on top of cps-2.10-dood in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cherrypick cps-2.10 |
@zhujian7: once the present PR merges, I will cherry-pick it on top of cps-2.10 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cherrypick cps-2.8 |
@zhujian7: once the present PR merges, I will cherry-pick it on top of cps-2.8 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cherrypick cps-2.11 |
@zhujian7: once the present PR merges, I will cherry-pick it on top of cps-2.11 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: zhujian7 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@zhujian7: new pull request created: #1513 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@zhujian7: new pull request created: #1514 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@zhujian7: new pull request created: #1515 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@zhujian7: #1511 failed to apply on top of branch "cps-2.11":
|
What this PR does / why we need it:
Simplify the way we clone repos, and don't pass
-f
togit checkout
so that git won't fail silently.
Manual validation:
branch:
tag
pull request
Which issue(s) this PR is related to (optional, link to 3rd issue(s)):
Fixes #
Reference to #
Special notes for your reviewer:
/cc @zhujian7
Release note: