Bug 1447495

Summary: [dY8fPwNo] 'new-app' should respect PR ref when create a docker app
Product: OKD Reporter: XiuJuan Wang <xiuwang>
Component: BuildAssignee: Gabe Montero <gmontero>
Status: CLOSED NEXTRELEASE QA Contact: Wenjing Zheng <wzheng>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.xCC: aos-bugs, gmontero, mmccomas
Target Milestone: ---   
Target Release: 3.x   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Several git related, client side, paths in the `oc` command were executing `git clone` and then assuming `git checkout` would work without a preceding `git fetch` when a PR reference was used. Consequence: the `git checkout` would fail Fix: before exiting the `oc` command, on a `git checkout` failure, go back and try a `git fetch` then `git checkout` sequence and see if that works. Result: various `oc` operations should succeed when PR refs are used during git operations.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-12 14:20:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description XiuJuan Wang 2017-05-03 02:12:11 UTC
Description of problem:
Failed to create an app with dockerstrategy with PR ref

Version-Release number of selected component (if applicable):

oc v3.6.0-alpha.1+85b8686-354
kubernetes v1.6.1+5115d708d7
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://172.18.15.51:8443
openshift v3.6.0-alpha.1+85b8686-354
kubernetes v1.6.1+5115d708

How reproducible:
always

Steps to Reproduce:
1.Create an app with dockerstrategy with PR ref
#oc new-app https://github.com/openshift/ruby-hello-world#refs/pull/58/head

2.
3.

Actual results:
#oc new-app https://github.com/openshift/ruby-hello-world#refs/pull/58/head
error: unable to checkout ref "refs/pull/58/head" in "https://github.com/openshift/ruby-hello-world" repository: error: pathspec 'refs/pull/58/head' did not match any file(s) known to git.

Expected results:
Should create app and do build successfully

Additional info:

Comment 1 Gabe Montero 2017-05-03 14:41:36 UTC
PR https://github.com/openshift/origin/pull/14025 contains the proposed fix for this defect

Comment 2 openshift-github-bot 2017-05-08 02:15:19 UTC
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/b944e487b484632e04bcefce7a89227faa4855bf
openshift-build: enable pr fetch from oc new-app, start-build, source lookup

Bug 1447495
Bugzilla link https://bugzilla.redhat.com/show_bug.cgi?id=1447495
Detailed explanation
Several git related, client side paths, in the `oc` command were
executing `git clone` and then assuming `git checkout` would work
without a preceding `git fetch` when a PR reference is used.

Comment 3 XiuJuan Wang 2017-05-10 05:48:40 UTC
Can't reproduce this bug, thanks.

Verified with server as below
oc v3.6.74
kubernetes v1.6.1+5115d708d7
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://***:8443
openshift v3.6.74
kubernetes v1.6.1+5115d708d7