Skip to content

Commit a818b3e

Browse files
Merge pull request #1525 from alvaroaleman/prow-d736039ff3ea
Bump test-infra to 327f8d8
2 parents 86d701c + 8962695 commit a818b3e

File tree

100 files changed

+5144
-1218
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+5144
-1218
lines changed

cmd/autobumper/main.go

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"flag"
55
"fmt"
66
"os"
7+
"strings"
78

89
"github.com/sirupsen/logrus"
910

@@ -86,11 +87,45 @@ func main() {
8687
if err := os.Chdir(o.targetDir); err != nil {
8788
logrus.WithError(err).Fatal("Failed to change to root dir")
8889
}
89-
images, err := bumper.UpdateReferences(true, true, true, "latest", []string{"clusters/", "cluster/ci/config/prow/", "core-services/prow", "ci-operator/", "hack/"}, []string{}, extraFiles)
90+
91+
opts := &bumper.Options{
92+
GitHubOrg: "openshift",
93+
GitHubRepo: "release",
94+
GitHubLogin: o.githubLogin,
95+
GitHubToken: string(sa.GetTokenGenerator(o.GitHubOptions.TokenPath)()),
96+
GitName: o.gitName,
97+
GitEmail: o.gitEmail,
98+
IncludedConfigPaths: []string{"clusters/", "cluster/ci/config/prow/", "core-services/prow", "ci-operator/", "hack/"},
99+
ExtraFiles: extraFiles,
100+
TargetVersion: "latest",
101+
RemoteName: fmt.Sprintf("https://github.com/%s/%s.git", o.githubLogin, githubRepo),
102+
Prefixes: []bumper.Prefix{
103+
{
104+
Name: "Prow",
105+
Prefix: "gcr.io/k8s-prow/",
106+
Repo: "https://github.com/kubernetes/test-infra",
107+
Summarise: true,
108+
ConsistentImages: true,
109+
},
110+
{
111+
Name: "Boskos",
112+
Prefix: "gcr.io/k8s-staging-boskos/",
113+
Repo: "https://github.com/kubernetes-sigs/boskos",
114+
Summarise: true,
115+
ConsistentImages: true,
116+
},
117+
},
118+
}
119+
images, err := bumper.UpdateReferences(opts)
90120
if err != nil {
91121
logrus.WithError(err).Fatal("Failed to update references.")
92122
}
93123

124+
versions, err := getVersionsAndCheckConsistency(opts.Prefixes, images)
125+
if err != nil {
126+
logrus.WithError(err).Fatal("unable get get versions")
127+
}
128+
94129
changed, err := bumper.HasChanges()
95130
if err != nil {
96131
logrus.WithError(err).Fatal("error occurred when checking changes")
@@ -105,12 +140,31 @@ func main() {
105140
stderr := bumper.HideSecretsWriter{Delegate: os.Stderr, Censor: sa}
106141

107142
remoteBranch := "autobump"
108-
if err := bumper.MakeGitCommit(fmt.Sprintf("https://%s:%[email protected]/%s/%s.git", o.githubLogin,
109-
string(sa.GetTokenGenerator(o.GitHubOptions.TokenPath)()), o.githubLogin, githubRepo), remoteBranch, o.gitName, o.gitEmail, images, stdout, stderr); err != nil {
143+
if err := bumper.MakeGitCommit(fmt.Sprintf("[email protected]:%s/%s.git", o.githubLogin, githubRepo), remoteBranch, o.gitName, o.gitEmail, opts.Prefixes, stdout, stderr, versions); err != nil {
110144
logrus.WithError(err).Fatal("Failed to push changes.")
111145
}
112146

113-
if err := bumper.UpdatePR(gc, githubOrg, githubRepo, images, "/cc @"+o.assign, "Update prow to", o.githubLogin+":"+remoteBranch, "master", true); err != nil {
147+
if err := bumper.UpdatePR(gc, githubOrg, githubRepo, images, "/cc @"+o.assign, "Update prow to", o.githubLogin+":"+remoteBranch, "master", true, opts.Prefixes, versions); err != nil {
114148
logrus.WithError(err).Fatal("PR creation failed.")
115149
}
116150
}
151+
152+
func getVersionsAndCheckConsistency(prefixes []bumper.Prefix, images map[string]string) (map[string][]string, error) {
153+
// Key is tag, value is full image.
154+
versions := map[string][]string{}
155+
for _, prefix := range prefixes {
156+
newVersions := 0
157+
for k, v := range images {
158+
if strings.HasPrefix(k, prefix.Prefix) {
159+
if _, ok := versions[v]; !ok {
160+
newVersions++
161+
}
162+
versions[v] = append(versions[v], k)
163+
if prefix.ConsistentImages && newVersions > 1 {
164+
return nil, fmt.Errorf("%q was supposed to be bumped consistently but was not", prefix.Name)
165+
}
166+
}
167+
}
168+
}
169+
return versions, nil
170+
}

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ replace (
2323

2424
require (
2525
cloud.google.com/go/storage v1.12.0
26-
github.com/GoogleCloudPlatform/testgrid v0.0.13
26+
github.com/GoogleCloudPlatform/testgrid v0.0.30
2727
github.com/alecthomas/chroma v0.8.2-0.20201103103104-ab61726cdb54
28-
github.com/andygrunwald/go-jira v1.12.0
28+
github.com/andygrunwald/go-jira v1.13.0
2929
github.com/blang/semver v3.5.1+incompatible
3030
github.com/coreydaley/openshift-goimports v0.0.0-20201111145504-7b4aecddd198
3131
github.com/docker/distribution v2.7.1+incompatible
@@ -62,7 +62,7 @@ require (
6262
k8s.io/apimachinery v0.19.3
6363
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible
6464
k8s.io/klog/v2 v2.4.0
65-
k8s.io/test-infra v0.0.0-20201203231326-dd9f08023280
65+
k8s.io/test-infra v0.0.0-20201211195527-327f8d8ee04e
6666
k8s.io/utils v0.0.0-20200912215256-4140de9c8800
6767
sigs.k8s.io/boskos v0.0.0-20200617235605-f289ba6555ba
6868
sigs.k8s.io/controller-runtime v0.7.0-alpha.6.0.20201130155849-2879800afa6b

go.sum

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
5757
cloud.google.com/go/storage v1.9.0/go.mod h1:m+/etGaqZbylxaNT876QGXqEHp4PR2Rq5GMqICWb9bU=
5858
cloud.google.com/go/storage v1.10.0 h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA=
5959
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
60+
cloud.google.com/go/storage v1.10.1-0.20200805182106-fcd132957b02/go.mod h1:bdhVveip9CJX75wUu7ALOTnCSKjv6PHRY0bCeBmePnw=
6061
cloud.google.com/go/storage v1.12.0 h1:4y3gHptW1EHVtcPAVE0eBBlFuGqEejTTG3KdIE0lUX4=
6162
cloud.google.com/go/storage v1.12.0/go.mod h1:fFLk2dp2oAhDz8QFKwqrjdJvxSp/W2g7nillojlL5Ho=
6263
code.gitea.io/sdk/gitea v0.12.0/go.mod h1:z3uwDV/b9Ls47NGukYM9XhnHtqPh/J+t40lsUrR6JDY=
@@ -155,8 +156,8 @@ github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190822182118-27a4ced3
155156
github.com/GoogleCloudPlatform/testgrid v0.0.1-alpha.3/go.mod h1:f96W2HYy3tiBNV5zbbRc+NczwYHgG1PHXMQfoEWv680=
156157
github.com/GoogleCloudPlatform/testgrid v0.0.7 h1:tKM75ScxinVqDkguwG5AnsQZn9XCNpxAdEey1OfJgiE=
157158
github.com/GoogleCloudPlatform/testgrid v0.0.7/go.mod h1:lmtHGBL0M/MLbu1tR9BWV7FGZ1FEFIdPqmJiHNCL7y8=
158-
github.com/GoogleCloudPlatform/testgrid v0.0.13 h1:g7DP1uKfb3byfYetXoH1BsTeBlRzuQTO5o4i9pyGqv8=
159-
github.com/GoogleCloudPlatform/testgrid v0.0.13/go.mod h1:UlC/MvnkKjiVGijIKOHxnVyhDiTDCydw9H1XzmclQGU=
159+
github.com/GoogleCloudPlatform/testgrid v0.0.30 h1:Os7plKvCWxu37kdaqaHC+pvCva1nvsRuhVvMSPyhEqA=
160+
github.com/GoogleCloudPlatform/testgrid v0.0.30/go.mod h1:KGQ3wqPuX1xCqeSHvcGmAafuMtV7cRNST9hZS7VCahA=
160161
github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E=
161162
github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
162163
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
@@ -213,8 +214,8 @@ github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo
213214
github.com/andybalholm/brotli v0.0.0-20190621154722-5f990b63d2d6/go.mod h1:+lx6/Aqd1kLJ1GQfkvOnaZ1WGmLpMpbprPuIOOZX30U=
214215
github.com/andygrunwald/go-gerrit v0.0.0-20190120104749-174420ebee6c h1:uUuUZipfD5nPl2L/i0I3N4iRKJcoO2CPjktaH/kP9gQ=
215216
github.com/andygrunwald/go-gerrit v0.0.0-20190120104749-174420ebee6c/go.mod h1:0iuRQp6WJ44ts+iihy5E/WlPqfg5RNeQxOmzRkxCdtk=
216-
github.com/andygrunwald/go-jira v1.12.0 h1:JJi2cEDmDxVtTXxC8ruLDbtOU6pA4OLeL0niyfNcoWw=
217-
github.com/andygrunwald/go-jira v1.12.0/go.mod h1:jYi4kFDbRPZTJdJOVJO4mpMMIwdB+rcZwSO58DzPd2I=
217+
github.com/andygrunwald/go-jira v1.13.0 h1:vvIImGgX32bHfoiyUwkNo+/YrPnRczNarvhLOncP6dE=
218+
github.com/andygrunwald/go-jira v1.13.0/go.mod h1:jYi4kFDbRPZTJdJOVJO4mpMMIwdB+rcZwSO58DzPd2I=
218219
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
219220
github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q=
220221
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
@@ -375,6 +376,8 @@ github.com/devigned/tab v0.1.1/go.mod h1:XG9mPq0dFghrYvoBF3xdRrJzSTX1b7IQrvaL9mz
375376
github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
376377
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
377378
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
379+
github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 h1:CaO/zOnF8VvUfEbhRatPcwKVWamvbYd8tQGRWacE9kU=
380+
github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1/go.mod h1:+hnT3ywWDTAFrW5aE+u2Sa/wT555ZqwoCS+pk3p6ry4=
378381
github.com/dgryski/go-gk v0.0.0-20200319235926-a69029f61654/go.mod h1:qm+vckxRlDt0aOla0RYJJVeqHZlWfOm2UIxHaqPB46E=
379382
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
380383
github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8=
@@ -473,6 +476,8 @@ github.com/fsouza/go-dockerclient v0.0.0-20171004212419-da3951ba2e9e/go.mod h1:K
473476
github.com/fsouza/go-dockerclient v1.6.3 h1:VS/I3mxieZVIeaWXd57JKvSjheELafUJYtblGg75RIQ=
474477
github.com/fsouza/go-dockerclient v1.6.3/go.mod h1:OiSy/IhZIF+zheikZkXK7LVpGzxWchJPJKGWhBqOK4M=
475478
github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA=
479+
github.com/fvbommel/sortorder v1.0.1 h1:dSnXLt4mJYH25uDDGa3biZNQsozaUWDSWeKJ0qqFfzE=
480+
github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0=
476481
github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY=
477482
github.com/getlantern/deepcopy v0.0.0-20160317154340-7f45deb8130a h1:yU/FENpkHYISWsQrbr3pcZOBj0EuRjPzNc1+dTCLu44=
478483
github.com/getlantern/deepcopy v0.0.0-20160317154340-7f45deb8130a/go.mod h1:AEugkNu3BjBxyz958nJ5holD9PRjta6iprcoUauDbU4=
@@ -2063,6 +2068,7 @@ google.golang.org/genproto v0.0.0-20200626011028-ee7919e894b5/go.mod h1:FWY/as6D
20632068
google.golang.org/genproto v0.0.0-20200701001935-0939c5918c31/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
20642069
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
20652070
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
2071+
google.golang.org/genproto v0.0.0-20200804151602-45615f50871c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
20662072
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
20672073
google.golang.org/genproto v0.0.0-20200831141814-d751682dd103/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
20682074
google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
@@ -2257,8 +2263,8 @@ k8s.io/test-infra v0.0.0-20200407001919-bc7f71ef65b8/go.mod h1:/WpJWcaDvuykB322W
22572263
k8s.io/test-infra v0.0.0-20200514184223-ba32c8aae783/go.mod h1:bW6thaPZfL2hW7ecjx2WYwlP9KQLM47/xIJyttkVk5s=
22582264
k8s.io/test-infra v0.0.0-20200617221206-ea73eaeab7ff/go.mod h1:L3+cRvwftUq8IW1TrHji5m3msnc4uck/7LsE/GR/aZk=
22592265
k8s.io/test-infra v0.0.0-20200630233406-1dca6122872e/go.mod h1:L3+cRvwftUq8IW1TrHji5m3msnc4uck/7LsE/GR/aZk=
2260-
k8s.io/test-infra v0.0.0-20201203231326-dd9f08023280 h1:2sjBdoW6fgtTxtl1f0b8YGLsmLOfE+Q1mAEdxF4DNts=
2261-
k8s.io/test-infra v0.0.0-20201203231326-dd9f08023280/go.mod h1:47vVoo97eYXWJjJ5ocbqfo7PYvPOZlgCVSXxDYuFioY=
2266+
k8s.io/test-infra v0.0.0-20201211195527-327f8d8ee04e h1:eukWnG/YREkVk8vaqFbHaMUn7n7VqKUfTUNO7ZrOVAY=
2267+
k8s.io/test-infra v0.0.0-20201211195527-327f8d8ee04e/go.mod h1:w8UnlrLZZc6ANHdBaCoLrkF7PN4tX5H4OPlSDJMdPqM=
22622268
k8s.io/utils v0.0.0-20181019225348-5e321f9a457c/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0=
22632269
k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
22642270
k8s.io/utils v0.0.0-20190907131718-3d4f5b7dea0b/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=

vendor/github.com/GoogleCloudPlatform/testgrid/config/config.go

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/GoogleCloudPlatform/testgrid/metadata/job.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/GoogleCloudPlatform/testgrid/metadata/junit/BUILD.bazel

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/GoogleCloudPlatform/testgrid/metadata/junit/junit.go

Lines changed: 11 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)