From 7216aca1080fbf943bf1b12cac033ccdc225b114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Riobo=20Lorenzo?= Date: Wed, 11 Aug 2021 16:21:37 +0200 Subject: [PATCH] support for interop rhel programatically * Initial re structure for rhel event handling * Added pipeline and evet for interop-rhel * Change interop-rhel topic for testing * Add testing event for interop-rhel * Redactor for handling multiple events from same destination * Add logging for repos debug * fix for decoding _ https://github.com/golang/go/issues/40351 * bump tekton client version to V0.26.0 * Wait reconcile from informer to get results * Fix informer waiting for results on pipelinerun * Added helper function to inspect xunit files --- go.mod | 9 +- go.sum | 64 ++++++++++++ pkg/crc/pipelines/contants.go | 10 +- .../{pipelines.go => interop-ocp/pipeline.go} | 19 ++-- pkg/crc/pipelines/interop-rhel/pipeline.go | 97 +++++++++++++++++++ pkg/event/build-complete/build-complete.go | 6 ++ .../interop-ocp}/event.go | 26 +++-- pkg/event/build-complete/interop-ocp/types.go | 58 +++++++++++ .../build-complete/interop-rhel/event.go | 86 ++++++++++++++++ .../build-complete/interop-rhel/types.go | 63 ++++++++++++ pkg/event/build-complete/types.go | 33 +++++++ pkg/event/interop/ocp/types.go | 86 ---------------- pkg/manager/manager.go | 9 +- pkg/services/ci/pipelines/client.go | 9 +- pkg/services/messaging/umb/client.go | 12 ++- pkg/util/http/http.go | 34 +++++++ pkg/util/xunit/xunit.go | 19 ++++ 17 files changed, 513 insertions(+), 127 deletions(-) rename pkg/crc/pipelines/{pipelines.go => interop-ocp/pipeline.go} (63%) create mode 100644 pkg/crc/pipelines/interop-rhel/pipeline.go create mode 100644 pkg/event/build-complete/build-complete.go rename pkg/event/{interop/ocp => build-complete/interop-ocp}/event.go (82%) create mode 100644 pkg/event/build-complete/interop-ocp/types.go create mode 100644 pkg/event/build-complete/interop-rhel/event.go create mode 100644 pkg/event/build-complete/interop-rhel/types.go create mode 100644 pkg/event/build-complete/types.go delete mode 100644 pkg/event/interop/ocp/types.go create mode 100644 pkg/util/http/http.go create mode 100644 pkg/util/xunit/xunit.go diff --git a/go.mod b/go.mod index 765635e5..f5334a5a 100644 --- a/go.mod +++ b/go.mod @@ -5,8 +5,11 @@ go 1.14 require ( github.com/go-stomp/stomp v2.1.4+incompatible github.com/go-stomp/stomp/v3 v3.0.0 + github.com/gobuffalo/envy v1.7.1 // indirect github.com/golangci/golangci-lint v1.39.0 // indirect github.com/hjson/hjson-go v3.1.0+incompatible + github.com/joshdk/go-junit v0.0.0-20210226021600-6145f504ca0d + github.com/markbates/inflect v1.0.4 // indirect github.com/mitchellh/mapstructure v1.1.2 github.com/openshift/api v0.0.0-20210422150128-d8a48168c81c github.com/openshift/client-go v0.0.0-20210422153130-25c8450d1535 @@ -14,13 +17,13 @@ require ( github.com/spf13/cobra v1.1.3 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.7.1 - github.com/tektoncd/pipeline v0.23.0 - golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 + github.com/tektoncd/pipeline v0.26.0 + golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc google.golang.org/appengine v1.6.7 k8s.io/api v0.21.0 k8s.io/apimachinery v0.21.0 k8s.io/client-go v0.21.0 k8s.io/component-base v0.21.0 k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 - knative.dev/pkg v0.0.0-20210127163530-0d31134d5f4e + knative.dev/pkg v0.0.0-20210510175900-4564797bf3b7 ) diff --git a/go.sum b/go.sum index b5b3cca0..c99a41b2 100644 --- a/go.sum +++ b/go.sum @@ -41,7 +41,9 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d/go.mod h1:IshRmMJBhDfFj5Y67nVhMYTTIze91RUeT73ipWKs/GY= contrib.go.opencensus.io/exporter/prometheus v0.2.1-0.20200609204449-6bcf6f8577f0/go.mod h1:MjHoxkI7Ny27toPeFkRbXbzVjzIGkwOAptrAy8Mxtm8= +contrib.go.opencensus.io/exporter/prometheus v0.3.0/go.mod h1:rpCPVQKhiyH8oomWgm34ZmgIdZa8OVYO5WAIygPbBBE= contrib.go.opencensus.io/exporter/stackdriver v0.13.4/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= +contrib.go.opencensus.io/exporter/stackdriver v0.13.5/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= contrib.go.opencensus.io/exporter/zipkin v0.1.2/go.mod h1:mP5xM3rrgOjpn79MM8fZbj3gsxcuytSqtH0dxSWW1RE= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-sdk-for-go v43.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= @@ -49,9 +51,11 @@ github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= +github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= +github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= @@ -59,6 +63,7 @@ github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSY github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= +github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA= @@ -167,6 +172,7 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cloudevents/sdk-go/v2 v2.1.0/go.mod h1:3CTrpB4+u7Iaj6fd7E2Xvm5IxMdRoaAhqaRVnOr2rCU= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= @@ -232,6 +238,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.0.14/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/esimonov/ifshort v1.0.2 h1:K5s1W2fGfkoWXsFlxBNqT6J0ZCncPaKrGM5qe0bni68= @@ -362,6 +370,7 @@ github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b h1:khEcpUM4yFcxg4 github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/gobuffalo/envy v1.6.5/go.mod h1:N+GkhhZ/93bGZc6ZKhJLP6+m+tCNPKwgSpH9kaifseQ= github.com/gobuffalo/envy v1.7.1/go.mod h1:FurDp9+EDPE4aIUS3ZLyD+7/9fpx7YRt/ukY6jIHf0w= +github.com/gobuffalo/flect v0.2.2/go.mod h1:vmkQwuZYhN5Pc4ljYQZzP+1sq+NEkK+lh20jmEmX3jc= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gofrs/flock v0.8.0 h1:MSdYClljsF3PbENUUEx85nkWfJSGfzYI9yEBZOJz6CY= @@ -405,6 +414,9 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 h1:23T5iq8rbUYlhpt5DB4XJkc6BU31uODLD1o1gKvZmD0= github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= @@ -448,8 +460,11 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-containerregistry v0.4.1-0.20210128200529-19c2b639fab1 h1:o2ykCuuhHeUwtzNg89pH2hi+821aqjLWkaREVR3ziTQ= github.com/google/go-containerregistry v0.4.1-0.20210128200529-19c2b639fab1/go.mod h1:GU9FUA/X9rd2cV3ZoUNaWihp27tki6/38EsVzL2Dyzc= github.com/google/go-containerregistry/pkg/authn/k8schain v0.0.0-20210129212729-5c4818de4025/go.mod h1:n9wRxRfKkHy6ZFyj0jJQHw11P+mGLnED4sqegwrXxDk= @@ -481,6 +496,7 @@ github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4Mgqvf github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= @@ -598,10 +614,13 @@ github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22 github.com/jonboulle/clockwork v0.2.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/joshdk/go-junit v0.0.0-20210226021600-6145f504ca0d h1:lcSbmPJf3b19MTZtGDLI6Y2Jnk3VBDT8UG/8IVCEMxA= +github.com/joshdk/go-junit v0.0.0-20210226021600-6145f504ca0d/go.mod h1:TiiV0PqkaNfFXjEiyjWM3XXrhVyCa1K4Zfga6W52ung= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= @@ -840,8 +859,11 @@ github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDf github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.2.1/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= +github.com/prometheus/client_golang v1.6.0/go.mod h1:ZLOG9ck3JLRdB5MgO8f+lLTe83AXG6ro35rLTxvnIl4= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.8.0/go.mod h1:O9VU6huf47PktckDQfMTX0Y8tY0/7TSWwj+ITvv0TnM= +github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= +github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -853,9 +875,12 @@ github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.20.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -863,9 +888,12 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.6/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/statsd_exporter v0.15.0/go.mod h1:Dv8HnkoLQkeEjkIE4/2ndAA7WL1zHKK7WMqFQqu72rw= +github.com/prometheus/statsd_exporter v0.20.0/go.mod h1:YL3FWCG8JBBtaUSxAg4Gz2ZYu22bS84XM89ZQXXTWmQ= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/pseudomuto/protoc-gen-doc v1.3.2/go.mod h1:y5+P6n3iGrbKG+9O04V5ld71in3v/bX88wUwgt+U8EA= github.com/pseudomuto/protokit v0.2.0/go.mod h1:2PdH30hxVHsup8KpBTOXTBeMVhJZVio3Q8ViKSAXT0Q= @@ -980,7 +1008,10 @@ github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b h1:HxLVTlqcHhF github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= github.com/tektoncd/pipeline v0.23.0 h1:nOyk1KqXTZBlqRx20YrITUh7F/uDI2bXMfHedIxIzEY= github.com/tektoncd/pipeline v0.23.0/go.mod h1:QcD1kMaXVIHA/V7RCi4NQUCR6z3plBVjmglRbpS71FQ= +github.com/tektoncd/pipeline v0.26.0 h1:vW6Bv2RHXwdwgLWaIntPjvDRYDyrpBUVE+V8siXWbVo= +github.com/tektoncd/pipeline v0.26.0/go.mod h1:SqTj2NHfiqhJLbXUZQdt4cKeD3Z7xyT5+PCdfltR9FA= github.com/tektoncd/plumbing v0.0.0-20201021153918-6b7e894737b5/go.mod h1:WTWwsg91xgm+jPOKoyKVK/yRYxnVDlUYeDlypB1lDdQ= +github.com/tektoncd/plumbing v0.0.0-20210514044347-f8a9689d5bd5/go.mod h1:WTWwsg91xgm+jPOKoyKVK/yRYxnVDlUYeDlypB1lDdQ= github.com/tetafro/godot v1.4.4 h1:VAtLEoAMmopIzHVWVBrztjVWDeYm1OD/DKqhqXR4828= github.com/tetafro/godot v1.4.4/go.mod h1:FVDd4JuKliW3UgjswZfJfHq4vAx0bD/Jd5brJjGeaz4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -1046,12 +1077,14 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4-0.20200608061201-1901b56b9515/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.3.0/go.mod h1:9CWT6lKIep8U41DDaPiH6eFscnTyjfTANNQNx6LrIcA= +go.uber.org/automaxprocs v1.4.0/go.mod h1:/mTEdr7LvHhs0v7mjdxDreTz1OG5zdZGqgOnhWiR/+Q= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= @@ -1082,6 +1115,7 @@ golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1106,6 +1140,7 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -1173,6 +1208,9 @@ golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 h1:OgUuv8lsRpBibGNbSizVwKWly golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210415231046-e915ea6b2b7d h1:BgJvlyh+UqCUaPlscHJ+PN8GcpfrFdr7NHjd1JL0+Gs= +golang.org/x/net v0.0.0-20210415231046-e915ea6b2b7d/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1184,6 +1222,8 @@ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210126194326-f9ce19ea3013 h1:55H5j7lotzuFCEOKDsMch+fRNUQ9DgtyHOUP31FNqKc= golang.org/x/oauth2 v0.0.0-20210126194326-f9ce19ea3013/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210413134643-5e61552d6c78 h1:rPRtHfUb0UKZeZ6GH4K4Nt4YRbE9V1u+QZX5upZXqJQ= +golang.org/x/oauth2 v0.0.0-20210413134643-5e61552d6c78/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1195,6 +1235,7 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1260,6 +1301,7 @@ golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1268,6 +1310,11 @@ golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073 h1:8qxJSnu+7dRq6upnbntrmriWB golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210228012217-479acdf4ea46 h1:V066+OYJ66oTjnhm4Yrn7SXIwSCiDQJxpBxmvqb1N1c= golang.org/x/sys v0.0.0-20210228012217-479acdf4ea46/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44 h1:Bli41pIlzTzf3KEY06n+xnzK/BESIg2ze4Pgfh/aI8c= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1282,6 +1329,8 @@ golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1482,6 +1531,7 @@ google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201211151036-40ec1c210f7a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210416161957-9910b6c460de/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1505,6 +1555,8 @@ google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1516,6 +1568,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1577,22 +1632,26 @@ honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.1.3 h1:qTakTkI6ni6LFD5sBwwsdSO+AQqbSIxOauHTTQKZ/7o= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= k8s.io/api v0.19.7/go.mod h1:KTryDUT3l6Mtv7K2J2486PNL9DBns3wOYTkGR+iz63Y= +k8s.io/api v0.20.7/go.mod h1:4x0yErUkcEWYG+O0S4QdrYa2+PLEeY2M7aeQe++2nmk= k8s.io/api v0.21.0-rc.0/go.mod h1:Dkc/ZauWJrgZhjOjeBgW89xZQiTBJA2RaBKYHXPsi2Y= k8s.io/api v0.21.0 h1:gu5iGF4V6tfVCQ/R+8Hc0h7H1JuEhzyEi9S4R5LM8+Y= k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU= k8s.io/apiextensions-apiserver v0.19.7/go.mod h1:XJNNtjISNNePDEUClHt/igzMpQcmjVVh88QH+PKztPU= k8s.io/apimachinery v0.0.0-20190703205208-4cfb76a8bf76/go.mod h1:M2fZgZL9DbLfeJaPBCDqSqNsdsmLN+V29knYJnIXlMA= k8s.io/apimachinery v0.19.7/go.mod h1:6sRbGRAVY5DOCuZwB5XkqguBqpqLU6q/kOaOdk29z6Q= +k8s.io/apimachinery v0.20.7/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= k8s.io/apimachinery v0.21.0-rc.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= k8s.io/apimachinery v0.21.0 h1:3Fx+41if+IRavNcKOz09FwEXDBG6ORh6iMsTSelhkMA= k8s.io/apimachinery v0.21.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= k8s.io/apiserver v0.19.7/go.mod h1:DmWVQggNePspa+vSsVytVbS3iBSDTXdJVt0akfHacKk= k8s.io/client-go v0.19.7/go.mod h1:iytGI7S3kmv6bWnn+bSQUE4VlrEi4YFssvVB7J7Hvqg= +k8s.io/client-go v0.20.7/go.mod h1:uGl3qh/Jy3cTF1nDoIKBqUZlRWnj/EM+/leAXETKRuA= k8s.io/client-go v0.21.0-rc.0/go.mod h1:zU5HY/bSOKH3YOqoge9nFvICgrpeSdJu8DQ4fkjKIZk= k8s.io/client-go v0.21.0 h1:n0zzzJsAQmJngpC0IhgFcApZyoGXPrDIAD601HD09ag= k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= k8s.io/cloud-provider v0.19.7/go.mod h1:aO/VpUwkG+JQN7ZXc5WBLZ5NBXuq/Y5B6vri6U94PZ8= k8s.io/code-generator v0.19.7/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0= +k8s.io/code-generator v0.20.7/go.mod h1:i6FmG+QxaLxvJsezvZp0q/gAEzzOz3U53KFibghWToU= k8s.io/code-generator v0.21.0-rc.0/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q= k8s.io/component-base v0.19.7/go.mod h1:YX8spPBgwl3I6UGcSdQiEMAqRMSUsGQOW7SEr4+Qa3U= k8s.io/component-base v0.21.0 h1:tLLGp4BBjQaCpS/KiuWh7m2xqvAdsxLm4ATxHSe5Zpg= @@ -1613,6 +1672,7 @@ k8s.io/klog/v2 v2.8.0 h1:Q3gmuM9hKEjefWFFYF0Mat+YyFJvsUyYuwyNNJ5C9Ts= k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= +k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= k8s.io/kube-openapi v0.0.0-20210113233702-8566a335510f/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 h1:vEx13qjvaZ4yfObSSXW7BrMc/KQBBT/Jyee8XtLf4x0= k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= @@ -1623,8 +1683,11 @@ k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 h1:0T5IaWHO3sJTEmCP6mUlBvMukxPKUQWqiI/YuiBNMiQ= k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= knative.dev/hack v0.0.0-20210120165453-8d623a0af457/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= +knative.dev/hack v0.0.0-20210428122153-93ad9129c268/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI= knative.dev/pkg v0.0.0-20210127163530-0d31134d5f4e h1:gChYSjSASTy59BGX9R1zaZy7s4tP9EFhAA7WMwQo8nY= knative.dev/pkg v0.0.0-20210127163530-0d31134d5f4e/go.mod h1:X4NPrCo8NK3hbDVan9Vm7mf5io3ZoINakAdrpSXVB08= +knative.dev/pkg v0.0.0-20210510175900-4564797bf3b7 h1:i4P8emOPrLctmbaPHp5eRIOqz+XTOkit7KgZeS+onKs= +knative.dev/pkg v0.0.0-20210510175900-4564797bf3b7/go.mod h1:fIl4l4OmZodkElyaHoT0LCF5wT+3+P/kinawQ4XlLtE= mvdan.cc/gofumpt v0.1.1 h1:bi/1aS/5W00E2ny5q65w9SnKpWEF/UIOqDYBILpo9rA= mvdan.cc/gofumpt v0.1.1/go.mod h1:yXG1r1WqZVKWbVRtBWKWX9+CxGYfA51nSomhM0woR48= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I= @@ -1640,6 +1703,7 @@ rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.9/go.mod h1:dzAXnQbTRyDlZPJX2SUPEqvnB+j7AJjtlox7PEwigU0= sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.1.0 h1:C4r9BgJ98vrKnnVCjwCSXcWjWe0NKcUQkmzDXZXGwH8= sigs.k8s.io/structured-merge-diff/v4 v4.1.0/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/pkg/crc/pipelines/contants.go b/pkg/crc/pipelines/contants.go index c7dc410b..0d3fdd85 100644 --- a/pkg/crc/pipelines/contants.go +++ b/pkg/crc/pipelines/contants.go @@ -9,19 +9,19 @@ import ( ) const ( - crcNamespace string = "codeready-container" - pipelinesDashboardBaseUrl string = "https://tekton-dashboard-openshift-pipelines.apps.ocp4.prod.psi.redhat.com" - pipelinesDashboardUrlFormat string = "%s/#/namespaces/%s/pipelineruns/%s" + Namespace string = "codeready-container" + DashboardBaseUrl string = "https://tekton-dashboard-openshift-pipelines.apps.ocp4.prod.psi.redhat.com" + DashboardUrlFormat string = "%s/#/namespaces/%s/pipelineruns/%s" ) var ( - crcWorkspace v1beta1.WorkspaceBinding = v1beta1.WorkspaceBinding{ + Workspace v1beta1.WorkspaceBinding = v1beta1.WorkspaceBinding{ Name: "pipelines-data", PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ ClaimName: "pipelines-data"}, } - defaultTimeout v1.Duration = v1.Duration{ + DefaultTimeout v1.Duration = v1.Duration{ Duration: 8 * time.Hour, } ) diff --git a/pkg/crc/pipelines/pipelines.go b/pkg/crc/pipelines/interop-ocp/pipeline.go similarity index 63% rename from pkg/crc/pipelines/pipelines.go rename to pkg/crc/pipelines/interop-ocp/pipeline.go index aef830ed..68c24727 100644 --- a/pkg/crc/pipelines/pipelines.go +++ b/pkg/crc/pipelines/interop-ocp/pipeline.go @@ -1,8 +1,9 @@ -package pipelines +package interopOCP import ( "fmt" + crcPipelines "github.com/adrianriobo/qe-eventmanager/pkg/crc/pipelines" "github.com/adrianriobo/qe-eventmanager/pkg/services/ci/pipelines" v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" @@ -19,8 +20,8 @@ const ( platformsParamName string = "platforms" ) -func RunInteropOCP(ocpVersion, correlation, serversids, platforms string) (string, string, *v1beta1.PipelineRunStatus, error) { - pipelinerun, err := pipelines.CreatePipelinerun(crcNamespace, getSpecInteropOCP(ocpVersion, correlation, serversids, platforms)) +func Run(ocpVersion, correlation, serversids, platforms string) (string, string, *v1beta1.PipelineRunStatus, error) { + pipelinerun, err := pipelines.CreatePipelinerun(crcPipelines.Namespace, getSpec(ocpVersion, correlation, serversids, platforms)) if err != nil { return "", "", nil, err } @@ -28,14 +29,14 @@ func RunInteropOCP(ocpVersion, correlation, serversids, platforms string) (strin informerStopper := make(chan struct{}) defer close(status) defer close(informerStopper) - go pipelines.AddInformer(crcNamespace, pipelinerun.GetName(), status, informerStopper) + go pipelines.AddInformer(crcPipelines.Namespace, pipelinerun.GetName(), status, informerStopper) return pipelinerun.GetName(), correlation, <-status, nil } -func getSpecInteropOCP(ocpVersion, correlation, serversids, platforms string) *v1beta1.PipelineRun { +func getSpec(ocpVersion, correlation, serversids, platforms string) *v1beta1.PipelineRun { return &v1beta1.PipelineRun{ TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{GenerateName: pipelineRunName, Namespace: crcNamespace}, + ObjectMeta: v1.ObjectMeta{GenerateName: pipelineRunName, Namespace: crcPipelines.Namespace}, Spec: v1beta1.PipelineRunSpec{ PipelineRef: &v1beta1.PipelineRef{Name: pipelineRefName}, Params: []v1beta1.Param{ @@ -43,11 +44,11 @@ func getSpecInteropOCP(ocpVersion, correlation, serversids, platforms string) *v {Name: correlationParamName, Value: *v1beta1.NewArrayOrString(correlation)}, {Name: serversidsParamName, Value: *v1beta1.NewArrayOrString(serversids)}, {Name: platformsParamName, Value: *v1beta1.NewArrayOrString(platforms)}}, - Timeout: &defaultTimeout, - Workspaces: []v1beta1.WorkspaceBinding{crcWorkspace}}, + Timeout: &crcPipelines.DefaultTimeout, + Workspaces: []v1beta1.WorkspaceBinding{crcPipelines.Workspace}}, } } func GetPipelinerunDashboardUrl(pipelinerunName string) string { - return fmt.Sprintf(pipelinesDashboardUrlFormat, pipelinesDashboardBaseUrl, crcNamespace, pipelinerunName) + return fmt.Sprintf(crcPipelines.DashboardUrlFormat, crcPipelines.DashboardBaseUrl, crcPipelines.Namespace, pipelinerunName) } diff --git a/pkg/crc/pipelines/interop-rhel/pipeline.go b/pkg/crc/pipelines/interop-rhel/pipeline.go new file mode 100644 index 00000000..97c5fd82 --- /dev/null +++ b/pkg/crc/pipelines/interop-rhel/pipeline.go @@ -0,0 +1,97 @@ +package interopRHEL + +import ( + "fmt" + + crcPipelines "github.com/adrianriobo/qe-eventmanager/pkg/crc/pipelines" + "github.com/adrianriobo/qe-eventmanager/pkg/services/ci/pipelines" + "github.com/adrianriobo/qe-eventmanager/pkg/util/http" + "github.com/adrianriobo/qe-eventmanager/pkg/util/logging" + "github.com/adrianriobo/qe-eventmanager/pkg/util/xunit" + + v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +const ( + pipelineRefName string = "interop-rhel" + pipelineRunName string = pipelineRefName + "-" + + rhelVersionParamName string = "rhel-version" + repoBaseosParamName string = "repo-baseos-url" + repoAppStreamParamName string = "repo-appstream-url" + imageIDParamName string = "image-id" + + xunitURLResultName string = "results-url" + qeDurationResultName string = "qe-duration" + + resultStatusPassed string = "passed" + resultStatusFailed string = "failed" +) + +func Run(rhelVersion, repoBaseos, repoAppStream, imageID string) (string, string, string, string, error) { + pipelinerun, err := pipelines.CreatePipelinerun(crcPipelines.Namespace, getSpec(rhelVersion, repoBaseos, repoAppStream, imageID)) + if err != nil { + return "", "", "", "", err + } + status := make(chan *v1beta1.PipelineRunStatus) + informerStopper := make(chan struct{}) + defer close(status) + defer close(informerStopper) + go pipelines.AddInformer(crcPipelines.Namespace, pipelinerun.GetName(), status, informerStopper) + runStatus := <-status + xunitURL := getResultValue(runStatus.PipelineResults, xunitURLResultName) + return pipelinerun.GetName(), + xunitURL, + getResultValue(runStatus.PipelineResults, qeDurationResultName), + getResultState(xunitURL), + nil +} + +// TODO make general vailable +func getResultValue(results []v1beta1.PipelineRunResult, resultParamID string) string { + for _, result := range results { + if result.Name == resultParamID { + return result.Value + } + } + return "" +} + +// TODO this should be moved to result parameter from the pipeline +func getResultState(url string) string { + file, err := http.GetFile(url) + if err != nil { + logging.Error(err) + return "" + } + count, err := xunit.CountFailures(file) + if err != nil { + logging.Error(err) + return "" + } + if count == 0 { + return resultStatusPassed + } + return resultStatusFailed +} + +func getSpec(rhelVersion, repoBaseos, repoAppStream, imageID string) *v1beta1.PipelineRun { + return &v1beta1.PipelineRun{ + TypeMeta: v1.TypeMeta{}, + ObjectMeta: v1.ObjectMeta{GenerateName: pipelineRunName, Namespace: crcPipelines.Namespace}, + Spec: v1beta1.PipelineRunSpec{ + PipelineRef: &v1beta1.PipelineRef{Name: pipelineRefName}, + Params: []v1beta1.Param{ + {Name: rhelVersionParamName, Value: *v1beta1.NewArrayOrString(rhelVersion)}, + {Name: repoBaseosParamName, Value: *v1beta1.NewArrayOrString(repoBaseos)}, + {Name: repoAppStreamParamName, Value: *v1beta1.NewArrayOrString(repoAppStream)}, + {Name: imageIDParamName, Value: *v1beta1.NewArrayOrString(imageID)}}, + Timeout: &crcPipelines.DefaultTimeout, + Workspaces: []v1beta1.WorkspaceBinding{crcPipelines.Workspace}}, + } +} + +func GetPipelinerunDashboardUrl(pipelinerunName string) string { + return fmt.Sprintf(crcPipelines.DashboardUrlFormat, crcPipelines.DashboardBaseUrl, crcPipelines.Namespace, pipelinerunName) +} diff --git a/pkg/event/build-complete/build-complete.go b/pkg/event/build-complete/build-complete.go new file mode 100644 index 00000000..26aec98b --- /dev/null +++ b/pkg/event/build-complete/build-complete.go @@ -0,0 +1,6 @@ +package buildComplete + +const ( + // Topic string = "VirtualTopic.qe.ci.product-scenario.vipatel.build.complete" + Topic string = "VirtualTopic.qe.ci.product-scenario.build.complete" +) diff --git a/pkg/event/interop/ocp/event.go b/pkg/event/build-complete/interop-ocp/event.go similarity index 82% rename from pkg/event/interop/ocp/event.go rename to pkg/event/build-complete/interop-ocp/event.go index 56f5b6be..3ec7068d 100644 --- a/pkg/event/interop/ocp/event.go +++ b/pkg/event/build-complete/interop-ocp/event.go @@ -1,22 +1,21 @@ -package ocp +package interopOCP import ( "fmt" "strings" "time" - "github.com/mitchellh/mapstructure" - - "github.com/adrianriobo/qe-eventmanager/pkg/crc/pipelines" + interopPipelineOCP "github.com/adrianriobo/qe-eventmanager/pkg/crc/pipelines/interop-ocp" + buildComplete "github.com/adrianriobo/qe-eventmanager/pkg/event/build-complete" "github.com/adrianriobo/qe-eventmanager/pkg/services/messaging/umb" "github.com/adrianriobo/qe-eventmanager/pkg/util" "github.com/adrianriobo/qe-eventmanager/pkg/util/logging" + "github.com/mitchellh/mapstructure" ) const ( - topicBuildComplete string = "VirtualTopic.qe.ci.product-scenario.build.complete" - topicTestComplete string = "VirtualTopic.qe.ci.product-scenario.test.complete" - // testError string = "VirtualTopic.qe.ci.product-scenario.ascerra.test.error" + topicTestComplete string = "VirtualTopic.qe.ci.product-scenario.test.complete" + // testError string = "VirtualTopic.qe.ci.product-scenario.test.error" ) var ( @@ -34,9 +33,6 @@ func New() ProductScenarioBuild { return ProductScenarioBuild{} } -func (p ProductScenarioBuild) GetDestination() string { - return topicBuildComplete -} func (p ProductScenarioBuild) Handler(event interface{}) error { var data BuildComplete @@ -57,7 +53,7 @@ func (p ProductScenarioBuild) Handler(event interface{}) error { // Filtering this will be improved in future versions if len(openshiftVersion) > 0 && codereadyContainersMessage { name, correlation, _, err := - pipelines.RunInteropOCP(openshiftVersion, util.GenerateCorrelation(), + interopPipelineOCP.Run(openshiftVersion, util.GenerateCorrelation(), strings.Join(serversids[:], ","), strings.Join(platforms[:], ",")) if err != nil { @@ -73,10 +69,10 @@ func (p ProductScenarioBuild) Handler(event interface{}) error { func buildResponse(name, correlation string, source *BuildComplete) *TestComplete { return &TestComplete{ Artifact: source.Artifact, - Run: Run{ - URL: pipelines.GetPipelinerunDashboardUrl(name), - Log: pipelines.GetPipelinerunDashboardUrl(name)}, - Test: Test{ + Run: buildComplete.Run{ + URL: interopPipelineOCP.GetPipelinerunDashboardUrl(name), + Log: interopPipelineOCP.GetPipelinerunDashboardUrl(name)}, + Test: buildComplete.Test{ Category: "interoperability", Namespace: "interop", TestType: "product-scenario", diff --git a/pkg/event/build-complete/interop-ocp/types.go b/pkg/event/build-complete/interop-ocp/types.go new file mode 100644 index 00000000..941608c5 --- /dev/null +++ b/pkg/event/build-complete/interop-ocp/types.go @@ -0,0 +1,58 @@ +package interopOCP + +import ( + buildComplete "github.com/adrianriobo/qe-eventmanager/pkg/event/build-complete" +) + +type BuildComplete struct { + Artifact Artifact `json:"artifact"` + Contact buildComplete.Contact `json:"contact"` + GenerateAt string `json:"generated_at"` + System []buildComplete.System `json:"system"` + Version string `json:"version"` +} + +type TestComplete struct { + Contact buildComplete.Contact `json:"contact"` + Run buildComplete.Run `json:"run"` + Artifact Artifact `json:"artifact"` + Test buildComplete.Test `json:"test"` + GenerateAt string `json:"generated_at"` + System []buildComplete.System `json:"system"` + Version string `json:"version"` +} + +type TestError struct { + Contact buildComplete.Contact `json:"contact"` + Run buildComplete.Run `json:"run"` + Artifact Artifact `json:"artifact"` + Test buildComplete.Test `json:"test"` + Error buildComplete.Error `json:"error"` + GenerateAt string `json:"generated_at"` + System []buildComplete.System `json:"system"` + Version string `json:"version"` +} + +type Artifact struct { + ArtifcatType string `json:"type"` + Id string `json:"id"` + Products []Product `json:"products"` + Email string `json:"email"` + Url string `json:"url"` +} + +type Product struct { + Id string `json:"id"` + NVR string `json:"nvr"` + Name string `json:"name"` + Version string `json:"version"` + Architecture string `json:"architecture"` + Build string `json:"build"` + Internal_build_index_url string `json:"internal_build_index_url"` + External_build_index_url string `json:"external_build_index_url"` + ProductType string `json:"type"` + State string `json:"state"` + Artifacts []interface{} `json:"artifacts"` + Phase string `json:"phase"` + Release string `json:"release"` +} diff --git a/pkg/event/build-complete/interop-rhel/event.go b/pkg/event/build-complete/interop-rhel/event.go new file mode 100644 index 00000000..eee3101d --- /dev/null +++ b/pkg/event/build-complete/interop-rhel/event.go @@ -0,0 +1,86 @@ +package interopRHEL + +import ( + interopPipelineRHEL "github.com/adrianriobo/qe-eventmanager/pkg/crc/pipelines/interop-rhel" + buildComplete "github.com/adrianriobo/qe-eventmanager/pkg/event/build-complete" + "github.com/adrianriobo/qe-eventmanager/pkg/services/messaging/umb" + "github.com/adrianriobo/qe-eventmanager/pkg/util/logging" + "github.com/mitchellh/mapstructure" +) + +const ( + topicTestComplete string = "VirtualTopic.qe.ci.product-scenario.test.complete" + // testError string = "VirtualTopic.qe.ci.product-scenario.test.error" + + baseosRepositoryName string = "baseos" + appstreamRepositoryName string = "appstream" +) + +type ProductScenarioBuild struct { +} + +func New() ProductScenarioBuild { + return ProductScenarioBuild{} +} + +func (p ProductScenarioBuild) Handler(event interface{}) error { + var data BuildComplete + + if err := mapstructure.Decode(event, &data); err != nil { + return err + } + // Business Logic + var rhelVersion, baseosURL, appstreamURL, imageID string + var codereadyContainersMessage bool = false + for _, product := range data.Artifact.Products { + if product.Name == "rhel" { + rhelVersion = product.Id + baseosURL, appstreamURL = getRepositoriesURLs(product.Repos) + logging.Debugf("Got repos baseos: %s, appstream %s", baseosURL, appstreamURL) + imageID = product.Image + } + if product.Name == "codeready_containers" { + codereadyContainersMessage = true + } + } + // Filtering this will be improved in future versions + if len(rhelVersion) > 0 && codereadyContainersMessage { + name, xunitURL, duration, resultStatus, err := + interopPipelineRHEL.Run(rhelVersion, baseosURL, appstreamURL, imageID) + if err != nil { + logging.Error(err) + } + // We will take info from status to send back the results + response := buildResponse(name, xunitURL, duration, resultStatus, &data) + return umb.Send(topicTestComplete, response) + } + return nil +} + +func getRepositoriesURLs(repositories []Repository) (baseosURL, appstreamURL string) { + for _, repository := range repositories { + switch repository.Name { + case baseosRepositoryName: + baseosURL = repository.Base_Url + case appstreamRepositoryName: + appstreamURL = repository.Base_Url + } + } + return +} + +func buildResponse(name, xunitURL, duration, resultStatus string, source *BuildComplete) *TestComplete { + return &TestComplete{ + Artifact: source.Artifact, + Run: buildComplete.Run{ + URL: interopPipelineRHEL.GetPipelinerunDashboardUrl(name), + Log: interopPipelineRHEL.GetPipelinerunDashboardUrl(name)}, + Test: buildComplete.Test{ + Category: "interoperability", + Namespace: "interop", + TestType: "product-scenario", + Result: resultStatus, + Runtime: duration, + XunitUrls: []string{xunitURL}}, + } +} diff --git a/pkg/event/build-complete/interop-rhel/types.go b/pkg/event/build-complete/interop-rhel/types.go new file mode 100644 index 00000000..5227049c --- /dev/null +++ b/pkg/event/build-complete/interop-rhel/types.go @@ -0,0 +1,63 @@ +package interopRHEL + +import ( + buildComplete "github.com/adrianriobo/qe-eventmanager/pkg/event/build-complete" +) + +type BuildComplete struct { + Artifact Artifact `json:"artifact"` + Contact buildComplete.Contact `json:"contact"` + GenerateAt string `json:"generated_at"` + System []buildComplete.System `json:"system"` + Version string `json:"version"` +} + +type TestComplete struct { + Contact buildComplete.Contact `json:"contact"` + Run buildComplete.Run `json:"run"` + Artifact Artifact `json:"artifact"` + Test buildComplete.Test `json:"test"` + GenerateAt string `json:"generated_at"` + System []buildComplete.System `json:"system"` + Version string `json:"version"` +} + +type TestError struct { + Contact buildComplete.Contact `json:"contact"` + Run buildComplete.Run `json:"run"` + Artifact Artifact `json:"artifact"` + Test buildComplete.Test `json:"test"` + Error buildComplete.Error `json:"error"` + GenerateAt string `json:"generated_at"` + System []buildComplete.System `json:"system"` + Version string `json:"version"` +} + +type Artifact struct { + ArtifcatType string `json:"type"` + Id string `json:"id"` + Products []Product `json:"products"` + Email string `json:"email"` + Url string `json:"url"` +} + +type Product struct { + Architecture string `json:"architecture"` + Artifacts []interface{} `json:"artifacts"` + Build string `json:"build"` + Id string `json:"id"` + Image string `json:"image"` + Name string `json:"name"` + NVR string `json:"nvr"` + Phase string `json:"phase"` + Release string `json:"release"` + Repos []Repository `json:"repos"` + State string `json:"state"` + ProductType string `json:"type"` + Version string `json:"version"` +} + +type Repository struct { + Base_Url string `json:"base_url"` + Name string `json:"name"` +} diff --git a/pkg/event/build-complete/types.go b/pkg/event/build-complete/types.go new file mode 100644 index 00000000..c0a011b6 --- /dev/null +++ b/pkg/event/build-complete/types.go @@ -0,0 +1,33 @@ +package buildComplete + +type Contact struct { + Name string `json:"name"` + Team string `json:"team"` + Docs string `json:"docs"` + Email string `json:"email"` + Url string `json:"url"` +} + +type System struct { + Architecture string `json:"architecture"` + Provider string `json:"provider"` + OS string `json:"os"` +} + +type Run struct { + URL string `json:"url"` + Log string `json:"log"` +} + +type Test struct { + Category string `json:"category"` + Namespace string `json:"namespace"` + TestType string `json:"type"` + Result string `json:"result"` + Runtime string `json:"runtime"` + XunitUrls []string `json:"xunit_urls"` +} + +type Error struct { + Reason string `json:"reason"` +} diff --git a/pkg/event/interop/ocp/types.go b/pkg/event/interop/ocp/types.go deleted file mode 100644 index 074f1fbe..00000000 --- a/pkg/event/interop/ocp/types.go +++ /dev/null @@ -1,86 +0,0 @@ -package ocp - -type BuildComplete struct { - Artifact Artifact `json:"artifact"` - Contact Contact `json:"contact"` - GenerateAt string `json:"generated_at"` - System []System `json:"system"` - Version string `json:"version"` -} - -type TestComplete struct { - Contact Contact `json:"contact"` - Run Run `json:"run"` - Artifact Artifact `json:"artifact"` - Test Test `json:"test"` - GenerateAt string `json:"generated_at"` - System []System `json:"system"` - Version string `json:"version"` -} - -type TestError struct { - Contact Contact `json:"contact"` - Run Run `json:"run"` - Artifact Artifact `json:"artifact"` - Test Test `json:"test"` - Error Error `json:"error"` - GenerateAt string `json:"generated_at"` - System []System `json:"system"` - Version string `json:"version"` -} - -type Contact struct { - Name string `json:"name"` - Team string `json:"team"` - Docs string `json:"docs"` - Email string `json:"email"` - Url string `json:"url"` -} - -type Artifact struct { - ArtifcatType string `json:"type"` - Id string `json:"id"` - Products []Product `json:"products"` - Email string `json:"email"` - Url string `json:"url"` -} - -type Product struct { - Id string `json:"id"` - NVR string `json:"nvr"` - Name string `json:"name"` - Version string `json:"version"` - Architecture string `json:"architecture"` - Build string `json:"build"` - Internal_build_index_url string `json:"internal_build_index_url"` - External_build_index_url string `json:"external_build_index_url"` - ProductType string `json:"type"` - State string `json:"state"` - Artifacts []interface{} `json:"artifacts"` - Phase string `json:"phase"` - Release string `json:"release"` -} - -type System struct { - Architecture string `json:"architecture"` - Provider string `json:"provider"` - OS string `json:"os"` -} - -type Run struct { - URL string `json:"url"` - Log string `json:"log"` -} - -type Test struct { - Category string `json:"category"` - Namespace string `json:"namespace"` - TestType string `json:"type"` - Result string `json:"result"` - Runtime string `json:"runtime"` - XunitUrls []string `json:"xunit_urls"` -} - -type Error struct { - Reason string `json:"reason"` -} diff --git a/pkg/manager/manager.go b/pkg/manager/manager.go index f7da4cbb..297347b9 100644 --- a/pkg/manager/manager.go +++ b/pkg/manager/manager.go @@ -5,7 +5,9 @@ import ( "os/signal" "syscall" - eventInteropOCP "github.com/adrianriobo/qe-eventmanager/pkg/event/interop/ocp" + buildComplete "github.com/adrianriobo/qe-eventmanager/pkg/event/build-complete" + interopOCP "github.com/adrianriobo/qe-eventmanager/pkg/event/build-complete/interop-ocp" + interopRHEL "github.com/adrianriobo/qe-eventmanager/pkg/event/build-complete/interop-rhel" "github.com/adrianriobo/qe-eventmanager/pkg/services/ci/pipelines" "github.com/adrianriobo/qe-eventmanager/pkg/services/messaging/umb" "github.com/adrianriobo/qe-eventmanager/pkg/util/logging" @@ -37,8 +39,9 @@ func Initialize(certificateFile, privateKeyFile, caCertsFile, kubeconfigPath str } func handleEvents() error { - eventDefinition := eventInteropOCP.New() - if err := umb.Subscribe(eventDefinition.GetDestination(), func(event interface{}) error { return eventDefinition.Handler(event) }); err != nil { + if err := umb.Subscribe(buildComplete.Topic, []func(event interface{}) error{ + func(event interface{}) error { return interopOCP.New().Handler(event) }, + func(event interface{}) error { return interopRHEL.New().Handler(event) }}); err != nil { umb.GracefullShutdown() return err } diff --git a/pkg/services/ci/pipelines/client.go b/pkg/services/ci/pipelines/client.go index 6caeb072..f0530e40 100644 --- a/pkg/services/ci/pipelines/client.go +++ b/pkg/services/ci/pipelines/client.go @@ -61,7 +61,9 @@ func AddInformer(namespace, pipelinerunName string, status chan *v1beta1.Pipelin } logging.Debugf("Change on pipelinerun %s", pipelineRun.GetName()) if pipelineRun.GetName() == pipelinerunName && - (pipelineRun.IsDone() || pipelineRun.IsCancelled() || pipelineRun.IsTimedOut()) { + (pipelineRun.IsDone() && waitForResults(pipelineRun) || + pipelineRun.IsCancelled() || + pipelineRun.IsTimedOut()) { // Send the status of the pipelinerun when is done status <- &pipelineRun.Status } @@ -69,6 +71,11 @@ func AddInformer(namespace, pipelinerunName string, status chan *v1beta1.Pipelin informer.Run(informerStopper) } +func waitForResults(pipelineRun *v1beta1.PipelineRun) bool { + return len(pipelineRun.Status.PipelineRunStatusFields.PipelineSpec.Results) > 0 && + len(pipelineRun.Status.PipelineRunStatusFields.PipelineResults) > 0 +} + func checkInitialization() error { if client == nil { return fmt.Errorf("pipelines client is not initialized") diff --git a/pkg/services/messaging/umb/client.go b/pkg/services/messaging/umb/client.go index f7cdc027..9645fb3e 100644 --- a/pkg/services/messaging/umb/client.go +++ b/pkg/services/messaging/umb/client.go @@ -46,7 +46,7 @@ func NewClient(certificateFile, privateKeyFile, caCertsFile string, brokers []st } // TODO add selector based on regex?? -func Subscribe(virtualTopic string, handler func(event interface{}) error) error { +func Subscribe(virtualTopic string, handlers []func(event interface{}) error) error { destination := consumerId + virtualTopic client.subscribe.Lock() defer client.subscribe.Unlock() @@ -57,7 +57,7 @@ func Subscribe(virtualTopic string, handler func(event interface{}) error) error } client.subscriptions = append(client.subscriptions, subscription) client.consumers.Add(1) - go consume(&client, subscription, handler) + go consume(&client, subscription, handlers) return nil } @@ -67,7 +67,7 @@ func Send(destination string, message interface{}) error { return client.connection.FailoverSend("/topic/"+destination, message) } -func consume(client *Client, subscription *stomp.Subscription, handler func(event interface{}) error) { +func consume(client *Client, subscription *stomp.Subscription, handlers []func(event interface{}) error) { defer client.consumers.Done() for subscription.Active() { msg, err := subscription.Read() @@ -80,8 +80,10 @@ func consume(client *Client, subscription *stomp.Subscription, handler func(even break } logging.Infof("New message from %s, adding new handler for it", subscription.Destination()) - client.handlers.Add(1) - go handle(client, msg, handler) + for _, handler := range handlers { + client.handlers.Add(1) + go handle(client, msg, handler) + } } logging.Debugf("Finalize consumer for subscription %s", subscription.Destination()) } diff --git a/pkg/util/http/http.go b/pkg/util/http/http.go new file mode 100644 index 00000000..34482b53 --- /dev/null +++ b/pkg/util/http/http.go @@ -0,0 +1,34 @@ +package http + +import ( + "io/ioutil" + "net/http" + "net/url" + + "github.com/adrianriobo/qe-eventmanager/pkg/util/logging" +) + +func GetFile(fileUrl string) ([]byte, error) { + _, err := url.Parse(fileUrl) + if err != nil { + return nil, err + } + logging.Debugf("downloading %s", fileUrl) + resp, err := httpClient().Get(fileUrl) + if err != nil { + return nil, err + } + defer resp.Body.Close() + return ioutil.ReadAll(resp.Body) +} + +// TODO pooling or delegate to lib +func httpClient() *http.Client { + client := http.Client{ + CheckRedirect: func(r *http.Request, via []*http.Request) error { + r.URL.Opaque = r.URL.Path + return nil + }, + } + return &client +} diff --git a/pkg/util/xunit/xunit.go b/pkg/util/xunit/xunit.go new file mode 100644 index 00000000..82516e61 --- /dev/null +++ b/pkg/util/xunit/xunit.go @@ -0,0 +1,19 @@ +package xunit + +import ( + "github.com/adrianriobo/qe-eventmanager/pkg/util/logging" + "github.com/joshdk/go-junit" +) + +func CountFailures(xunit []byte) (int, error) { + suites, err := junit.Ingest(xunit) + if err != nil { + logging.Error(err) + return 0, err + } + failures := 0 + for _, suite := range suites { + failures += suite.Totals.Failed + } + return failures, nil +}