Repository: openshift-pipelines/pipelines-as-code
Pull request #109 (2021-06-02 14:57:59)

Fix friendly matching on branch
We were not doing it properly on matching the branch.

There is multiple place where we need to do that "friendly matching"
when we get the payload matching it to the pipelinerun and to the
Repository information.

We were only doing on repository information and not on pipelinerun.

Refactored all of thise in the same go package so it makes it easier
in future and improved all the tests.

Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>


Patch:
diff --git a/.tekton/pull-request.yaml b/.tekton/pull-request.yaml
index dcf5e85c..57d4772e 100644
--- a/.tekton/pull-request.yaml
+++ b/.tekton/pull-request.yaml
@@ -125,7 +125,7 @@ spec:
           steps:
             - name: save-cache
               # Has everything we need in there and we already fetched it!
-              image: public.ecr.aws/bitnami/golang:latest
+              image: public.ecr.aws/bitnami/python:latest
               workingDir: $(workspaces.source.path)
               script: |
                 #!/usr/bin/env bash
diff --git a/pkg/config/annotation_matcher.go b/pkg/config/annotation_matcher.go
index 044527ad..79311340 100644
--- a/pkg/config/annotation_matcher.go
+++ b/pkg/config/annotation_matcher.go
@@ -49,7 +49,7 @@ func MatchPipelinerunByAnnotation(pruns []*v1beta1.PipelineRun, cs *cli.Clients,
 
 		if targetEvent, ok := prun.GetObjectMeta().GetAnnotations()[pipelinesascode.
 			GroupName+"/"+onEventAnnotation]; ok {
-			matched, err := matchOnAnnotation(targetEvent, runinfo.EventType)
+			matched, err := matchOnAnnotation(targetEvent, runinfo.EventType, false)
 			if err != nil {
 				return nil, err
 			}
@@ -60,7 +60,7 @@ func MatchPipelinerunByAnnotation(pruns []*v1beta1.PipelineRun, cs *cli.Clients,
 
 		if targetBranch, ok := prun.GetObjectMeta().GetAnnotations()[pipelinesascode.
 			GroupName+"/"+onTargetBranchAnnotation]; ok {
-			matched, err := matchOnAnnotation(targetBranch, runinfo.BaseBranch)
+			matched, err := matchOnAnnotation(targetBranch, runinfo.BaseBranch, true)
 			if err != nil {
 				return nil, err
 			}
@@ -75,15 +75,18 @@ func MatchPipelinerunByAnnotation(pruns []*v1beta1.PipelineRun, cs *cli.Clients,
 	return nil, fmt.Errorf("cannot match any pipeline on EventType: %s, TargetBranch: %s", runinfo.EventType, runinfo.BaseBranch)
 }
 
-func matchOnAnnotation(targetBranchAnnotation string, match string) (bool, error) {
-	targets, err := getAnnotationValues(targetBranchAnnotation)
+func matchOnAnnotation(annotations string, runinfoValue string, branchMatching bool) (bool, error) {
+	targets, err := getAnnotationValues(annotations)
 	if err != nil {
 		return false, err
 	}
 
 	var gotit string
 	for _, v := range targets {
-		if v == match {
+		if v == runinfoValue {
+			gotit = v
+		}
+		if branchMatching && branchMatch(v, runinfoValue) {
 			gotit = v
 		}
 	}
diff --git a/pkg/pipelineascode/matcher.go b/pkg/config/repo_runinfo_matcher.go
similarity index 94%
rename from pkg/pipelineascode/matcher.go
rename to pkg/config/repo_runinfo_matcher.go
index 05a3fe24..c57f7061 100644
--- a/pkg/pipelineascode/matcher.go
+++ b/pkg/config/repo_runinfo_matcher.go
@@ -1,4 +1,4 @@
-package pipelineascode
+package config
 
 import (
 	"context"
@@ -24,7 +24,7 @@ func branchMatch(prunBranch, baseBranch string) bool {
 	return g.Match(baseBranch)
 }
 
-func getRepoByCR(ctx context.Context, cs *cli.Clients, runinfo *webvcs.RunInfo) (apipac.Repository, error) {
+func GetRepoByCR(ctx context.Context, cs *cli.Clients, runinfo *webvcs.RunInfo) (apipac.Repository, error) {
 	var repository apipac.Repository
 
 	repositories, err := cs.PipelineAsCode.PipelinesascodeV1alpha1().Repositories("").List(
diff --git a/pkg/pipelineascode/pipelineascode.go b/pkg/pipelineascode/pipelineascode.go
index 7211fe8f..75ed2d8c 100644
--- a/pkg/pipelineascode/pipelineascode.go
+++ b/pkg/pipelineascode/pipelineascode.go
@@ -71,7 +71,7 @@ func Run(ctx context.Context, cs *cli.Clients, k8int cli.KubeInteractionIntf, ru
 
 	// Match the Event to a Repository Resource,
 	// TODO: we need to be able to force a Namespace from the configuration as annotation as an extra layer of security for // hijacking
-	repo, err := getRepoByCR(ctx, cs, runinfo)
+	repo, err := config.GetRepoByCR(ctx, cs, runinfo)
 	if err != nil {
 		return err
 	}


Test patch:
diff --git a/pkg/config/annotation_matcher_test.go b/pkg/config/annotation_matcher_test.go
index 60f568ab..f9f3e381 100644
--- a/pkg/config/annotation_matcher_test.go
+++ b/pkg/config/annotation_matcher_test.go
@@ -156,7 +156,62 @@ func TestMatchPipelinerunByAnnotation(t *testing.T) {
 			},
 			wantErr: true,
 		},
+		{
+			name: "match-branch-matching",
+			args: args{
+				runinfo: &webvcs.RunInfo{EventType: "push", BaseBranch: "refs/heads/main"},
+				pruns: []*tektonv1beta1.PipelineRun{
+					{
+						ObjectMeta: metav1.ObjectMeta{
+							Name: "branch-matching",
+							Annotations: map[string]string{
+								pipelinesascode.GroupName + "/" + onEventAnnotation:        "[push]",
+								pipelinesascode.GroupName + "/" + onTargetBranchAnnotation: "[main]",
+							},
+						},
+					},
+				},
+			},
+			wantErr: false,
+		},
+		{
+			name: "base-does-not-compare",
+			args: args{
+				runinfo: &webvcs.RunInfo{EventType: "push", BaseBranch: "refs/heads/main/foobar"},
+				pruns: []*tektonv1beta1.PipelineRun{
+					{
+						ObjectMeta: metav1.ObjectMeta{
+							Name: "branch-base-matching-not-compare",
+							Annotations: map[string]string{
+								pipelinesascode.GroupName + "/" + onEventAnnotation:        "[push]",
+								pipelinesascode.GroupName + "/" + onTargetBranchAnnotation: "[main]",
+							},
+						},
+					},
+				},
+			},
+			wantErr: true,
+		},
+		{
+			name: "branch-glob-matching",
+			args: args{
+				runinfo: &webvcs.RunInfo{EventType: "push", BaseBranch: "refs/heads/main"},
+				pruns: []*tektonv1beta1.PipelineRun{
+					{
+						ObjectMeta: metav1.ObjectMeta{
+							Name: "branch-base-matching-not-compare",
+							Annotations: map[string]string{
+								pipelinesascode.GroupName + "/" + onEventAnnotation:        "[push]",
+								pipelinesascode.GroupName + "/" + onTargetBranchAnnotation: "[refs/heads/*]",
+							},
+						},
+					},
+				},
+			},
+			wantErr: false,
+		},
 	}
+
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {
 			got, err := MatchPipelinerunByAnnotation(tt.args.pruns, cs, tt.args.runinfo)
diff --git a/pkg/pipelineascode/matcher_test.go b/pkg/config/repo_runinfo_matcher_test.go
similarity index 67%
rename from pkg/pipelineascode/matcher_test.go
rename to pkg/config/repo_runinfo_matcher_test.go
index 20c06f1e..e9b50aec 100644
--- a/pkg/pipelineascode/matcher_test.go
+++ b/pkg/config/repo_runinfo_matcher_test.go
@@ -1,4 +1,4 @@
-package pipelineascode
+package config
 
 import (
 	"testing"
@@ -6,11 +6,18 @@ import (
 	"github.com/openshift-pipelines/pipelines-as-code/pkg/apis/pipelinesascode/v1alpha1"
 	"github.com/openshift-pipelines/pipelines-as-code/pkg/cli"
 	testclient "github.com/openshift-pipelines/pipelines-as-code/pkg/test/clients"
+	testnewrepo "github.com/openshift-pipelines/pipelines-as-code/pkg/test/repository"
 	"github.com/openshift-pipelines/pipelines-as-code/pkg/webvcs"
 	"gotest.tools/v3/assert"
 	rtesting "knative.dev/pkg/reconciler/testing"
 )
 
+const (
+	mainBranch      = "mainBranch"
+	targetNamespace = "targetNamespace"
+	targetURL       = "https//nowhere.togo"
+)
+
 func Test_getRepoByCR(t *testing.T) {
 	type args struct {
 		data    testclient.Data
@@ -27,7 +34,7 @@ func Test_getRepoByCR(t *testing.T) {
 			args: args{
 				data: testclient.Data{
 					Repositories: []*v1alpha1.Repository{
-						newRepo("test-good", targetURL, mainBranch, targetNamespace, targetNamespace, "pull_request"),
+						testnewrepo.NewRepo("test-good", targetURL, mainBranch, targetNamespace, targetNamespace, "pull_request"),
 					},
 				},
 				runinfo: &webvcs.RunInfo{URL: targetURL, BaseBranch: mainBranch, EventType: "pull_request"},
@@ -35,12 +42,25 @@ func Test_getRepoByCR(t *testing.T) {
 			wantTargetNS: targetNamespace,
 			wantErr:      false,
 		},
+		{
+			name: "test-repo-not-installed-where-it-should",
+			args: args{
+				data: testclient.Data{
+					Repositories: []*v1alpha1.Repository{
+						testnewrepo.NewRepo("test-good", targetURL, mainBranch, "paslebonns", targetNamespace, "pull_request"),
+					},
+				},
+				runinfo: &webvcs.RunInfo{URL: targetURL, BaseBranch: mainBranch, EventType: "pull_request"},
+			},
+			wantTargetNS: "",
+			wantErr:      true,
+		},
 		{
 			name: "test-nomatch-event-type",
 			args: args{
 				data: testclient.Data{
 					Repositories: []*v1alpha1.Repository{
-						newRepo("test-good", targetURL, mainBranch, targetNamespace, targetNamespace, "pull_request"),
+						testnewrepo.NewRepo("test-good", targetURL, mainBranch, targetNamespace, targetNamespace, "pull_request"),
 					},
 				},
 				runinfo: &webvcs.RunInfo{URL: targetURL, BaseBranch: mainBranch, EventType: "push"},
@@ -53,7 +73,7 @@ func Test_getRepoByCR(t *testing.T) {
 			args: args{
 				data: testclient.Data{
 					Repositories: []*v1alpha1.Repository{
-						newRepo("test-good", targetURL, mainBranch, targetNamespace, targetNamespace, "pull_request"),
+						testnewrepo.NewRepo("test-good", targetURL, mainBranch, targetNamespace, targetNamespace, "pull_request"),
 					},
 				},
 				runinfo: &webvcs.RunInfo{URL: targetURL, BaseBranch: "anotherBaseBranch", EventType: "pull_request"},
@@ -66,7 +86,7 @@ func Test_getRepoByCR(t *testing.T) {
 			args: args{
 				data: testclient.Data{
 					Repositories: []*v1alpha1.Repository{
-						newRepo("test-good", "http://nottarget.url", mainBranch,
+						testnewrepo.NewRepo("test-good", "http://nottarget.url", mainBranch,
 							targetNamespace, targetNamespace, "pull_request"),
 					},
 				},
@@ -80,7 +100,7 @@ func Test_getRepoByCR(t *testing.T) {
 			args: args{
 				data: testclient.Data{
 					Repositories: []*v1alpha1.Repository{
-						newRepo("test-good", targetURL, mainBranch,
+						testnewrepo.NewRepo("test-good", targetURL, mainBranch,
 							targetNamespace, targetNamespace, "pull_request"),
 					},
 				},
@@ -97,7 +117,7 @@ func Test_getRepoByCR(t *testing.T) {
 			args: args{
 				data: testclient.Data{
 					Repositories: []*v1alpha1.Repository{
-						newRepo("test-good", targetURL, "refs/tags/*",
+						testnewrepo.NewRepo("test-good", targetURL, "refs/tags/*",
 							targetNamespace, targetNamespace, "pull_request"),
 					},
 				},
@@ -116,15 +136,15 @@ func Test_getRepoByCR(t *testing.T) {
 			ctx, _ := rtesting.SetupFakeContext(t)
 			cs, _ := testclient.SeedTestData(t, ctx, tt.args.data)
 			client := &cli.Clients{PipelineAsCode: cs.PipelineAsCode}
-			got, err := getRepoByCR(ctx, client, tt.args.runinfo)
-			if tt.wantErr {
-				assert.NilError(t, err, "getRepoByCR() error = %v, wantErr %v", err, tt.wantErr)
+			got, err := GetRepoByCR(ctx, client, tt.args.runinfo)
+			if err == nil && tt.wantErr {
+				assert.NilError(t, err, "GetRepoByCR() error = %v, wantErr %v", err, tt.wantErr)
 			}
 			if tt.wantTargetNS == "" && got.Spec.Namespace != "" {
-				t.Errorf("getRepoByCR() got = '%v', want '%v'", got.Spec.Namespace, tt.wantTargetNS)
+				t.Errorf("GetRepoByCR() got = '%v', want '%v'", got.Spec.Namespace, tt.wantTargetNS)
 			}
 			if tt.wantTargetNS != "" && tt.wantTargetNS != got.Spec.Namespace {
-				t.Errorf("getRepoByCR() got = '%v', want '%v'", got.Spec.Namespace, tt.wantTargetNS)
+				t.Errorf("GetRepoByCR() got = '%v', want '%v'", got.Spec.Namespace, tt.wantTargetNS)
 			}
 		})
 	}
diff --git a/pkg/pipelineascode/pipelineascode_test.go b/pkg/pipelineascode/pipelineascode_test.go
index df7feea6..3ffe2bdc 100644
--- a/pkg/pipelineascode/pipelineascode_test.go
+++ b/pkg/pipelineascode/pipelineascode_test.go
@@ -10,12 +10,11 @@ import (
 	"path/filepath"
 	"strings"
 	"testing"
-	"time"
 
+	"github.com/openshift-pipelines/pipelines-as-code/pkg/test/repository"
 	testDynamic "github.com/tektoncd/cli/pkg/test/dynamic"
 
 	"github.com/google/go-github/v34/github"
-	"github.com/jonboulle/clockwork"
 	"github.com/openshift-pipelines/pipelines-as-code/pkg/apis/pipelinesascode/v1alpha1"
 	"github.com/openshift-pipelines/pipelines-as-code/pkg/cli"
 	testclient "github.com/openshift-pipelines/pipelines-as-code/pkg/test/clients"
@@ -27,65 +26,9 @@ import (
 	"gotest.tools/v3/assert"
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-	"knative.dev/pkg/apis/duck/v1beta1"
 	rtesting "knative.dev/pkg/reconciler/testing"
 )
 
-const (
-	mainBranch      = "mainBranch"
-	targetNamespace = "targetNamespace"
-	targetURL       = "http://nowhere.togo"
-)
-
-func newRepo(name, url, branch, installNamespace, namespace, eventtype string) *v1alpha1.Repository {
-	cw := clockwork.NewFakeClock()
-	return &v1alpha1.Repository{
-		TypeMeta: metav1.TypeMeta{},
-		ObjectMeta: metav1.ObjectMeta{
-			Name:      name,
-			Namespace: installNamespace,
-		},
-		Spec: v1alpha1.RepositorySpec{
-			Namespace: namespace,
-			URL:       url,
-			Branch:    branch,
-			EventType: eventtype,
-		},
-		Status: []v1alpha1.RepositoryRunStatus{
-			{
-				Status:          v1beta1.Status{},
-				PipelineRunName: "pipelinerun5",
-				StartTime:       &metav1.Time{Time: cw.Now().Add(-56 * time.Minute)},
-				CompletionTime:  &metav1.Time{Time: cw.Now().Add(-55 * time.Minute)},
-			},
-			{
-				Status:          v1beta1.Status{},
-				PipelineRunName: "pipelinerun4",
-				StartTime:       &metav1.Time{Time: cw.Now().Add(-46 * time.Minute)},
-				CompletionTime:  &metav1.Time{Time: cw.Now().Add(-45 * time.Minute)},
-			},
-			{
-				Status:          v1beta1.Status{},
-				PipelineRunName: "pipelinerun3",
-				StartTime:       &metav1.Time{Time: cw.Now().Add(-36 * time.Minute)},
-				CompletionTime:  &metav1.Time{Time: cw.Now().Add(-35 * time.Minute)},
-			},
-			{
-				Status:          v1beta1.Status{},
-				PipelineRunName: "pipelinerun2",
-				StartTime:       &metav1.Time{Time: cw.Now().Add(-26 * time.Minute)},
-				CompletionTime:  &metav1.Time{Time: cw.Now().Add(-25 * time.Minute)},
-			},
-			{
-				Status:          v1beta1.Status{},
-				PipelineRunName: "pipelinerun1",
-				StartTime:       &metav1.Time{Time: cw.Now().Add(-16 * time.Minute)},
-				CompletionTime:  &metav1.Time{Time: cw.Now().Add(-15 * time.Minute)},
-			},
-		},
-	}
-}
-
 func replyString(mux *http.ServeMux, url, body string) {
 	mux.HandleFunc(url, func(w http.ResponseWriter, r *http.Request) {
 		fmt.Fprint(w, body)
@@ -138,7 +81,7 @@ func TestRunDeniedFromForcedNamespace(t *testing.T) {
 	}
 	datas := testclient.Data{
 		Repositories: []*v1alpha1.Repository{
-			newRepo("repo", runinfo.URL, runinfo.BaseBranch, installedNamespace, installedNamespace, "pull_request"),
+			repository.NewRepo("repo", runinfo.URL, runinfo.BaseBranch, installedNamespace, installedNamespace, "pull_request"),
 		},
 	}
 	stdata, _ := testclient.SeedTestData(t, ctx, datas)
@@ -184,7 +127,7 @@ func testSetupTektonDir(mux *http.ServeMux, runinfo *webvcs.RunInfo, directory s
 
 func testSetupCommonGhReplies(t *testing.T, mux *http.ServeMux, runinfo *webvcs.RunInfo, finalStatus, finalStatusText string,
 	noReplyOrgPublicMembers bool) {
-	// Take a directory and geneate replies as Github for it
+	// Take a directory and generate replies as Github for it
 	replyString(mux,
 		fmt.Sprintf("/repos/%s/%s/contents/internal/task", runinfo.Owner, runinfo.Repository),
 		`{"sha": "internaltasksha"}`)
@@ -323,7 +266,7 @@ func TestRun(t *testing.T) {
 			finalStatus:  "skipped",
 			finalLogText: "Skipping creating status check",
 			repositories: []*v1alpha1.Repository{
-				newRepo("test-run", "https://service/documentation",
+				repository.NewRepo("test-run", "https://service/documentation",
 					"a branch", "namespace", "namespace", "pull_request"),
 			},
 		},
@@ -344,7 +287,7 @@ func TestRun(t *testing.T) {
 			finalStatus:  "skipped",
 			finalLogText: "not find a namespace match",
 			repositories: []*v1alpha1.Repository{
-				newRepo("test-run", "https://nowhere.com",
+				repository.NewRepo("test-run", "https://nowhere.com",
 					"a branch", "namespace", "namespace", "pull_request"),
 			},
 		},
@@ -372,7 +315,7 @@ func TestRun(t *testing.T) {
 			ctx, _ := rtesting.SetupFakeContext(t)
 			if tt.repositories == nil {
 				tt.repositories = []*v1alpha1.Repository{
-					newRepo("test-run", tt.runinfo.URL, tt.runinfo.BaseBranch, "namespace", "namespace", tt.runinfo.EventType),
+					repository.NewRepo("test-run", tt.runinfo.URL, tt.runinfo.BaseBranch, "namespace", "namespace", tt.runinfo.EventType),
 				}
 			}
 			tdata := testclient.Data{
diff --git a/pkg/test/repository/repository.go b/pkg/test/repository/repository.go
new file mode 100644
index 00000000..7a7984ba
--- /dev/null
+++ b/pkg/test/repository/repository.go
@@ -0,0 +1,59 @@
+package repository
+
+import (
+	"time"
+
+	"github.com/jonboulle/clockwork"
+	"github.com/openshift-pipelines/pipelines-as-code/pkg/apis/pipelinesascode/v1alpha1"
+	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+	"knative.dev/pkg/apis/duck/v1beta1"
+)
+
+func NewRepo(name, url, branch, installNamespace, namespace, eventtype string) *v1alpha1.Repository {
+	cw := clockwork.NewFakeClock()
+	return &v1alpha1.Repository{
+		TypeMeta: v1.TypeMeta{},
+		ObjectMeta: v1.ObjectMeta{
+			Name:      name,
+			Namespace: installNamespace,
+		},
+		Spec: v1alpha1.RepositorySpec{
+			Namespace: namespace,
+			URL:       url,
+			Branch:    branch,
+			EventType: eventtype,
+		},
+		Status: []v1alpha1.RepositoryRunStatus{
+			{
+				Status:          v1beta1.Status{},
+				PipelineRunName: "pipelinerun5",
+				StartTime:       &v1.Time{Time: cw.Now().Add(-56 * time.Minute)},
+				CompletionTime:  &v1.Time{Time: cw.Now().Add(-55 * time.Minute)},
+			},
+			{
+				Status:          v1beta1.Status{},
+				PipelineRunName: "pipelinerun4",
+				StartTime:       &v1.Time{Time: cw.Now().Add(-46 * time.Minute)},
+				CompletionTime:  &v1.Time{Time: cw.Now().Add(-45 * time.Minute)},
+			},
+			{
+				Status:          v1beta1.Status{},
+				PipelineRunName: "pipelinerun3",
+				StartTime:       &v1.Time{Time: cw.Now().Add(-36 * time.Minute)},
+				CompletionTime:  &v1.Time{Time: cw.Now().Add(-35 * time.Minute)},
+			},
+			{
+				Status:          v1beta1.Status{},
+				PipelineRunName: "pipelinerun2",
+				StartTime:       &v1.Time{Time: cw.Now().Add(-26 * time.Minute)},
+				CompletionTime:  &v1.Time{Time: cw.Now().Add(-25 * time.Minute)},
+			},
+			{
+				Status:          v1beta1.Status{},
+				PipelineRunName: "pipelinerun1",
+				StartTime:       &v1.Time{Time: cw.Now().Add(-16 * time.Minute)},
+				CompletionTime:  &v1.Time{Time: cw.Now().Add(-15 * time.Minute)},
+			},
+		},
+	}
+}
diff --git a/test/fixtures/push.json b/test/fixtures/push.json
index 7b7a65c6..c2ae420b 100644
--- a/test/fixtures/push.json
+++ b/test/fixtures/push.json
@@ -1,7 +1,7 @@
- {
+{
   "ref": "refs/heads/main",
-  "before": "8830a4b3335c807e18fa7595c43b670f78777a59",
-  "after": "1e6b485a4a1348d19c8943cc71c54b6ed5fde503",
+  "before": "711d8e2572c4b097586626a28bf0babc7a86f0ba",
+  "after": "ef75c7db8a921a8c0adaabe2e309f2f9d7ce5bd4",
   "repository": {
     "id": 355197825,
     "node_id": "MDEwOlJlcG9zaXRvcnkzNTUxOTc4MjU=",
@@ -71,16 +71,16 @@
     "releases_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/releases{/id}",
     "deployments_url": "https://api.github.com/repos/openshift-pipelines/pipelines-as-code/deployments",
     "created_at": 1617715561,
-    "updated_at": "2021-05-20T14:48:24Z",
-    "pushed_at": 1621596688,
+    "updated_at": "2021-06-02T13:35:32Z",
+    "pushed_at": 1622641606,
     "git_url": "git://github.com/openshift-pipelines/pipelines-as-code.git",
     "ssh_url": "git@github.com:openshift-pipelines/pipelines-as-code.git",
     "clone_url": "https://github.com/openshift-pipelines/pipelines-as-code.git",
     "svn_url": "https://github.com/openshift-pipelines/pipelines-as-code",
     "homepage": null,
-    "size": 8472,
-    "stargazers_count": 1,
-    "watchers_count": 1,
+    "size": 9036,
+    "stargazers_count": 3,
+    "watchers_count": 3,
     "language": "Go",
     "has_issues": true,
     "has_projects": false,
@@ -101,9 +101,9 @@
     },
     "forks": 4,
     "open_issues": 10,
-    "watchers": 1,
+    "watchers": 3,
     "default_branch": "main",
-    "stargazers": 1,
+    "stargazers": 3,
     "master_branch": "main",
     "organization": "openshift-pipelines"
   },
@@ -153,15 +153,15 @@
   "deleted": false,
   "forced": false,
   "base_ref": null,
-  "compare": "https://github.com/openshift-pipelines/pipelines-as-code/compare/8830a4b3335c...1e6b485a4a13",
+  "compare": "https://github.com/openshift-pipelines/pipelines-as-code/compare/711d8e2572c4...ef75c7db8a92",
   "commits": [
     {
-      "id": "acf31f1e7b1f6982b596273b2492d86e5655c7f8",
-      "tree_id": "a5acb1d8b5e412723375ef7548d47d73502027a8",
+      "id": "ba677db1c9680f674213e76eed1dc3696d7f59a6",
+      "tree_id": "4bf257c4d62a867b78ee04d521d976634be76363",
       "distinct": true,
-      "message": "Define our own triggertemplate for recheck\n\nSince trigger bugs out everytime when passing the whole body and when we\nhave quotes, we defines our own triggertemplates for it and regenerate\na json with the payload we need to be parsed.\n\nThis works but this is stupid :\\",
-      "timestamp": "2021-05-21T11:21:24+02:00",
-      "url": "https://github.com/openshift-pipelines/pipelines-as-code/commit/acf31f1e7b1f6982b596273b2492d86e5655c7f8",
+      "message": "Seem like you don't need the @latest to go install\n\nSigned-off-by: Chmouel Boudjnah <chmouel@redhat.com>",
+      "timestamp": "2021-06-02T15:40:02+02:00",
+      "url": "https://github.com/openshift-pipelines/pipelines-as-code/commit/ba677db1c9680f674213e76eed1dc3696d7f59a6",
       "author": {
         "name": "Chmouel Boudjnah",
         "email": "chmouel@redhat.com",
@@ -173,51 +173,22 @@
         "username": "chmouel"
       },
       "added": [
-        "config/401-trigger-issue-recheck.yaml"
-      ],
-      "removed": [
 
-      ],
-      "modified": [
-        "config/400-triggers.yaml",
-        "test/fixtures/check_suite_rerequest_prcheck.json"
-      ]
-    },
-    {
-      "id": "822b58e0e4171ea14a1f04a2c31c76e3e84e805b",
-      "tree_id": "95bb0e0a6c81e7a49d792370512ea31b6a91a169",
-      "distinct": true,
-      "message": "Define pull request trigger template workaround\n\nTriggers bug on comment, so we rather avoided by reconstructing our own payload\nand using jsonpath.\n\nRather clunky but works at least.\n\nSigned-off-by: Chmouel Boudjnah <chmouel@redhat.com>",
-      "timestamp": "2021-05-21T13:20:07+02:00",
-      "url": "https://github.com/openshift-pipelines/pipelines-as-code/commit/822b58e0e4171ea14a1f04a2c31c76e3e84e805b",
-      "author": {
-        "name": "Chmouel Boudjnah",
-        "email": "chmouel@redhat.com",
-        "username": "chmouel"
-      },
-      "committer": {
-        "name": "Chmouel Boudjnah",
-        "email": "chmouel@redhat.com",
-        "username": "chmouel"
-      },
-      "added": [
-        "config/402-trigger-pull-request.yaml",
-        "test/fixtures/pull-req.json"
       ],
       "removed": [
 
       ],
       "modified": [
-        "config/400-triggers.yaml"
+        "README.md"
       ]
     },
     {
-      "id": "1e6b485a4a1348d19c8943cc71c54b6ed5fde503",
-      "tree_id": "95bb0e0a6c81e7a49d792370512ea31b6a91a169",
+      "id": "ef75c7db8a921a8c0adaabe2e309f2f9d7ce5bd4",
+      "tree_id": "4bf257c4d62a867b78ee04d521d976634be76363",
       "distinct": true,
-      "message": "Merge pull request #79 from chmouel/yamls-beurk",
-      "timestamp": "2021-05-21T13:31:28+02:00",
-      "url": "https://github.com/openshift-pipelines/pipelines-as-code/commit/1e6b485a4a1348d19c8943cc71c54b6ed5fde503",
+      "message": "Merge pull request #108 from chmouel/update-readme\n\nSeem like you don't need the @latest to go install",
+      "timestamp": "2021-06-02T15:46:46+02:00",
+      "url": "https://github.com/openshift-pipelines/pipelines-as-code/commit/ef75c7db8a921a8c0adaabe2e309f2f9d7ce5bd4",
       "author": {
         "name": "Chmouel Boudjnah",
         "email": "cboudjna@redhat.com",
@@ -229,26 +200,23 @@
         "username": "web-flow"
       },
       "added": [
-        "config/401-trigger-issue-recheck.yaml",
-        "config/402-trigger-pull-request.yaml",
-        "test/fixtures/pull-req.json"
+
       ],
       "removed": [
 
       ],
       "modified": [
-        "config/400-triggers.yaml",
-        "test/fixtures/check_suite_rerequest_prcheck.json"
+        "README.md"
       ]
     }
   ],
   "head_commit": {
-    "id": "1e6b485a4a1348d19c8943cc71c54b6ed5fde503",
-    "tree_id": "95bb0e0a6c81e7a49d792370512ea31b6a91a169",
+    "id": "ef75c7db8a921a8c0adaabe2e309f2f9d7ce5bd4",
+    "tree_id": "4bf257c4d62a867b78ee04d521d976634be76363",
     "distinct": true,
-    "message": "Merge pull request #79 from chmouel/yamls-beurk",
-    "timestamp": "2021-05-21T13:31:28+02:00",
-    "url": "https://github.com/openshift-pipelines/pipelines-as-code/commit/1e6b485a4a1348d19c8943cc71c54b6ed5fde503",
+    "message": "Merge pull request #108 from chmouel/update-readme\n\nSeem like you don't need the @latest to go install",
+    "timestamp": "2021-06-02T15:46:46+02:00",
+    "url": "https://github.com/openshift-pipelines/pipelines-as-code/commit/ef75c7db8a921a8c0adaabe2e309f2f9d7ce5bd4",
     "author": {
       "name": "Chmouel Boudjnah",
       "email": "cboudjna@redhat.com",
@@ -260,16 +228,13 @@
       "username": "web-flow"
     },
     "added": [
-      "config/401-trigger-issue-recheck.yaml",
-      "config/402-trigger-pull-request.yaml",
-      "test/fixtures/pull-req.json"
+
     ],
     "removed": [
 
     ],
     "modified": [
-      "config/400-triggers.yaml",
-      "test/fixtures/check_suite_rerequest_prcheck.json"
+      "README.md"
     ]
   }
 }