openshift / ci-operator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

build_root.project_image.dockerfile_path is broken

tnozicka opened this issue · comments

build_root.project_image.dockerfile_path is taken from master instead of the branch that's being tested meaning you can never succeed adding that file. (Also means CI let's you delete that file and get permanently broken.)

2019/01/20 17:21:48 Resolved source https://github.com/tnozicka/openshift-acme to master@7086e885, merging: #79 a84ec983 @tnozicka
2019/01/20 17:21:48 Resolved openshift/origin-v3.11:base to sha256:82ade8718e72f34b5eac3b279aaf659e2d45eb9f24758d2e022d69ba1c5c2c71
2019/01/20 17:21:48 Using namespace ci-op-lrq17gfq
2019/01/20 17:21:48 Running root, src, bin, verify
2019/01/20 17:21:48 Creating namespace ci-op-lrq17gfq
2019/01/20 17:21:48 Creating rolebinding for user tnozicka in namespace ci-op-lrq17gfq
2019/01/20 17:21:48 Setting a soft TTL of 1h0m0s for the namespace
2019/01/20 17:21:48 Setting a hard TTL of 12h0m0s for the namespace
2019/01/20 17:21:48 Setting up pipeline imagestream for the test
2019/01/20 17:21:48 Building root
2019/01/20 17:21:58 Build root failed, printing logs:
Cloning "https://github.com/tnozicka/openshift-acme.git" ...
	Commit:	7086e885628c6d03825af18e4e62bd02810a6e3d (Add OWNERS)
	Author:	Tomas Nozicka <tnozicka@gmail.com>
	Date:	Thu Aug 30 17:20:04 2018 +0200
error: open /tmp/build/inputs/images/build/Dockerfile: no such file or directory

/kind bug

https://openshift-gce-devel.appspot.com/build/origin-ci-test/pr-logs/pull/tnozicka_openshift-acme/79/pull-ci-tnozicka-openshift-acme-master-verify/46

I suspect this should reference the pull, not the master branch:

func (s *gitSourceStep) Run(ctx context.Context, dry bool) error {
return handleBuild(s.buildClient, buildFromSource(s.jobSpec, "", api.PipelineImageStreamTagReferenceRoot, buildapi.BuildSource{
Type: buildapi.BuildSourceGit,
ContextDir: s.config.ContextDir,
Git: &buildapi.GitBuildSource{
URI: fmt.Sprintf("https://github.com/%s/%s.git", s.jobSpec.Refs.Org, s.jobSpec.Refs.Repo),
Ref: s.jobSpec.Refs.BaseRef,
},
}, s.config.DockerfilePath, s.resources), dry)
}

Though this will be an easy fix, but given the design where the job can be run for multiple pulls, you don't have a remote reference to use.

Actually I think you can start openshift builds from a local dir and the content gets synced which would solve this.

As I see in the docs
If the ref field denotes a pull request, the system will use a git fetch operation and then checkout FETCH_HEAD.
So we can always use the pull request as ref and if that Dockerfile is not included in the PR, it will get it from the master either way.

@droslean: Closing this issue.

In response to this:

/close

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.