-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
enable builds with PR references #13893
Conversation
[testextended][extended:core(should start a build from a PR ref)] |
[test] |
pkg/build/builder/source.go
Outdated
@@ -252,7 +252,16 @@ func extractGitSource(gitClient GitClient, gitSource *api.GitBuildSource, revisi | |||
} | |||
|
|||
if err := gitClient.Checkout(dir, commit); err != nil { | |||
return true, err | |||
//TODO - do we want to parse the error string for the text that accompanies a clone / checkout of a PR ref, such as: pathspec 'refs/pull/1/head' did not match any file(s) known to 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.
i think this case is infrequent enough that it's not worth introducing the fragility that would come w/ that optimization.
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.
sounds good ... I'll remove the TODO comment
On the 1 test failure, we hit flake #12072 |
pkg/build/builder/source.go
Outdated
@@ -252,7 +252,16 @@ func extractGitSource(gitClient GitClient, gitSource *api.GitBuildSource, revisi | |||
} | |||
|
|||
if err := gitClient.Checkout(dir, commit); err != nil { | |||
return true, err | |||
//TODO - do we want to parse the error string for the text that accompanies a clone / checkout of a PR ref, such as: pathspec 'refs/pull/1/head' did not match any file(s) known to git | |||
err = gitClient.Fetch(dir, gitSource.URI, commit) |
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.
it's probably worth adding some level 4 logging to this code path so we know when we've gone down it successfully (or if we ever go down it incorrectly).
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.
part of next push
test/extended/builds/start.go
Outdated
@@ -51,6 +52,38 @@ var _ = g.Describe("[builds][Slow] starting a build using CLI", func() { | |||
}) | |||
}) | |||
|
|||
g.Describe("oc start-build with pr ref", func() { | |||
g.It("should start a build from a PR ref, wait for the build to complete, and confirm the right level was used", func() { | |||
g.By("make sure wildly is has latest tag") |
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.
s/is/imagestream/ (i read "is" as the verb..it was very confusing :) )
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.
part of next push
test/extended/builds/start.go
Outdated
break | ||
} | ||
time.Sleep(100 * time.Millisecond) | ||
} |
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.
wait.Poll()
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.
Turns out there already is a helper function for this ... will switch to that.
b8d97b8
to
dabe17c
Compare
updates pushed @bparees - thanks |
pkg/build/builder/source.go
Outdated
@@ -252,7 +252,17 @@ func extractGitSource(gitClient GitClient, gitSource *api.GitBuildSource, revisi | |||
} | |||
|
|||
if err := gitClient.Checkout(dir, commit); err != nil { | |||
return true, err | |||
glog.V(4).Infof("Checkout after clone failed for ref %s with error: %#v, attempting fetch", commit, err) |
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.
s/%#v/%v/
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.
just making sure @bparees - you decided you were OK with this and you posted the merge comment ?
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.
no, apparently I forgot :) merge comment deleted.
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.
update pushed
one last nit and lgtm. |
second test run hit flake #13650 |
dabe17c
to
1be7025
Compare
nit addressed |
Evaluated for origin testextended up to 1be7025 |
Evaluated for origin test up to 1be7025 |
continuous-integration/openshift-jenkins/testextended SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin_extended/232/) (Base Commit: 60180d1) (Extended Tests: core(should start a build from a PR ref)) |
continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/943/) (Base Commit: 60180d1) |
Sweet, want this for our own CI |
we did it just for you. 🎁 |
nice! |
On the third test run, we hit flake #13650 again, as well as a network/env hiccup during the network minimal test:
@bparees - I think we are good for merge .... I saw some conversation in other PRs about whether it was valid to post the merge comment while things were on hold for the rebase, but I don't know if I saw a conclusion as to what was valid. So please post/not post as needed. Thanks. |
[merge] (queue is disabled but will merge once it's back up) |
Evaluated for origin merge up to 1be7025 |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin/498/) (Base Commit: 325c02f) (Image: devenv-rhel7_6184) |
For https://trello.com/c/dY8fPwNo/1194-3-support-fetching-out-pr-ref-branches-techdebt
@openshift/devex PTAL