Bug 1278007 - --commit in start-build cmd do not work
--commit in start-build cmd do not work
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Build (Show other bugs)
3.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Michal Fojtik
Wenjing Zheng
: TestCaseNeeded
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-04 09:35 EST by XiuJuan Wang
Modified: 2016-05-12 13:14 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-12 13:14:48 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description XiuJuan Wang 2015-11-04 09:35:38 EST
Description of problem:
Specify --commit with older commit id, but this option always uses the latest commit id in start-build cmd.

Version-Release number of selected component (if applicable):
oc v1.0.7-131-g2c6234e
kubernetes v1.2.0-alpha.1-1107-g4c8e6f4

How reproducible:
always


Steps to Reproduce:
1.Check git log in source code repo
2.Start a build with --commit with a older commit id
3.

Actual results:
1.[fedora@ip-172-18-0-98 ruby-hello-world]$ git log
commit 65b3d6b82c299ac45ae8d1b698a2b233455b554d
Merge: f80663f b7309d9
Author: Jakub Hadvig <jhadvig@redhat.com>
Date:   Wed Jul 29 14:28:21 2015 +0200

    Merge pull request #47 from voxik/patch-1
    
    Fix Ruby 2.2 compatibility

commit b7309d9a78a3a6b10c30b830025ebffe30c500e4
Author: Vít Ondruch <v.ondruch@tiscali.cz>
Date:   Wed Jul 29 11:54:26 2015 +0200

    Fix Ruby 2.2 compatibility
    
    json-1.8.1 fails to build with Ruby 2.2:
    
    In file included from generator.c:1:0:
    ../fbuffer/fbuffer.h: In function 'fbuffer_to_s':
    ../fbuffer/fbuffer.h:175:47: error: macro "rb_str_new" requires 2 arguments, but only 1 given
         VALUE result = rb_str_new(FBUFFER_PAIR(fb));
-----------------<skip>---------------------------

2.#oc start-build ruby-sample-build  --from-repo=../ruby-hello-world --commit=b7309d9a78a3a6b10c30b830025ebffe30c500e4
Uploading Git repository "../ruby-hello-world" at commit "65b3d6b82c299ac45ae8d1b698a2b233455b554d" as binary input for the build ...
ruby-sample-build-2



Expected results:
Should use the specify commit id

Additional info:
Comment 1 Michal Fojtik 2015-11-05 10:05:00 EST
I'm looking at this.
Comment 2 Michal Fojtik 2015-11-05 10:29:32 EST
Fixed here: https://github.com/openshift/origin/pull/5734
Comment 3 openshift-github-bot 2015-11-13 12:54:00 EST
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/22e71df69573a3a07b5241e565c4734fa68e18a1
Bug 1278007 - Use commit instead of HEAD when streaming in start-build
Comment 4 Michal Fojtik 2015-12-17 09:43:21 EST
Hups, forgot to set ON_QA
Comment 5 XiuJuan Wang 2015-12-18 03:04:11 EST
Verified this bug with devenv-rhel_2965
oc v1.1-477-g0d4de0b
kubernetes v1.1.0-origin-1107-g4c8e6f4



Senario 1 : start build with a specify commit id
oc start-build ruby-hello-world  --from-repo=../ruby-hello-world  --commit=e0e69bb7282403497f9e535e24d6100991c6bca5 -n xiuwang
Uploading "../ruby-hello-world" at commit "e0e69bb7282403497f9e535e24d6100991c6bca5" as binary input for the build ...
ruby-hello-world-3

Senario 2: start build with non-existing  commit id

# oc  start-build ruby-hello-world   --commit=1234 -n xiuwang --follow
ruby-hello-world-5
error: pathspec '1234' did not match any file(s) known to git.
F1218 08:02:55.513960       1 builder.go:59] Build error: exit status 1

Note You need to log in before you can comment on or make changes to this bug.