Skip to content
This repository has been archived by the owner on Sep 5, 2019. It is now read-only.

git-init update and fixes #596

Closed
wants to merge 1 commit into from

Conversation

vdemeester
Copy link
Member

@vdemeester vdemeester commented Apr 11, 2019

Proposed Changes

  • check for errors or at least log them trim spaces from url : if the
  • given url contains some spaces (like non-breaking spaces),
    git-init may fail with protocol ' https' is not supported. This
    fixes that.

Related to tektoncd/pipeline#677 and tektoncd/pipeline#750

Signed-off-by: Vincent Demeester vdemeest@redhat.com

@knative-prow-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vdemeester
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: shashwathi

If they are not already assigned, you can assign the PR to them by writing /assign @shashwathi in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -87,16 +91,18 @@ func main() {
run(logger, "git", "init")
Copy link

@chmouel chmouel Apr 11, 2019

Choose a reason for hiding this comment

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

It seems that the second git init is not needed?

And perhaps check if path+"./git" exist already before doing the git init ?

Copy link
Member Author

Choose a reason for hiding this comment

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

@chmouel it's not on the same "branch", so still needed

@chmouel
Copy link

chmouel commented Apr 11, 2019

Perhaps add this review too tektoncd/pipeline#747

@zouyee
Copy link

zouyee commented Apr 11, 2019

I think path also need to be validated.

if err != nil {
trimedURL := strings.TrimSpace(*url)
runOrFail(logger, "git", "remote", "add", "origin", trimedURL)
if err = run(logger, "git", "fetch", "--depth=1", "--recurse-submodules=yes", "origin", *revision); err != nil {
Copy link

Choose a reason for hiding this comment

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

Could we consider using context to handler command hangs? Today we encountered a situation which the command was stuck, and there was a problem with the underlying storage.

Copy link
Member Author

Choose a reason for hiding this comment

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

@zouyee we may, with a default timeout, question is then, what would be a "sane" timeout ?

- check for errors or at least log them trim spaces from url : if the
- given url contains some spaces (like non-breaking spaces),
  `git-init` may fail with `protocol ' https' is not supported`. This
  fixes that.

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
@knative-prow-robot
Copy link

@vdemeester: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-knative-build-integration-tests 747e1cb link /test pull-knative-build-integration-tests

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@imjasonh
Copy link
Member

Closing this as stale, please reopen if you think this is still something we should do.

@imjasonh imjasonh closed this Jun 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants