tektoncd/experimental

commit-status-tracker: git-clone task compatibility

chlunde opened this issue · 2 comments

Feature request

commit-status-tracker currently supports PipelineResource

https://github.com/tektoncd/experimental/blob/master/commit-status-tracker/README.md#detecting-the-git-repository

// findGitResource locates a Git PipelineResource in a PipelineRun.
//
// If no Git resources are found, an error is returned.
// If more than one Git resource is found, an error is returned.
func findGitResource(p *pipelinev1.PipelineRun) (*pipelinev1alpha1.PipelineResourceSpec, error) {
var spec *pipelinev1alpha1.PipelineResourceSpec
for _, r := range p.Spec.Resources {

Using git-clone as a Task is another way to set up a git resource, but this does not work with commit-status-tracker at the moment.

https://github.com/tektoncd/catalog/blob/master/task/git-clone/0.2/README.md

Use case

Get build status in github when using git-clone as a Task

One option would be to add two annotations, one for repo and another for commit id. There is a increased risk that this would not be the same repo the is used for the actual build.

I think this is a risk with the current implementation (you can create a git resource for any repo that you don't have access to, and create a failed build for that repo, if commit-status-tracker has access to that repo).

Looks like @wlynch already is working on implementing this in a new tool in this PR: #662

	commit := tr.Annotations[key("commit")]

I assume this will deprecate commit-status-tracker so I'm closing this issue.