Skip to content

Commit

Permalink
Merge branch 'main' into prow-jobs-for-provider-multi-arch-images
Browse files Browse the repository at this point in the history
Signed-off-by: chandramerla <[email protected]>
  • Loading branch information
chandramerla authored Aug 22, 2024
2 parents e8d94fe + 29a87bc commit 5f11ef5
Show file tree
Hide file tree
Showing 104 changed files with 1,884 additions and 1,232 deletions.
2 changes: 1 addition & 1 deletion docs/how-to-add-a-prow-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ type: kubernetes.io/service-account-token
EOF
# export secret token data to add to user later on
kubectl get secret prow-workloads-cluster-automation \
-n "default" -o yaml | \
-n "kubevirt-prow-jobs" -o yaml | \
yq -r '.data.token' | \
base64 -d
```
Expand Down
2 changes: 1 addition & 1 deletion external-plugins/botreview/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ test:

push:
podman build -f ../../images/$(CONTAINER_IMAGE)/Containerfile -t $(CONTAINER_REPO):$(CONTAINER_TAG) && podman push $(CONTAINER_REPO):$(CONTAINER_TAG)
bash -x ../../hack/update-deployments-with-latest-image.sh $(CONTAINER_REPO)
bash -x ../../hack/update-deployments-with-latest-image.sh $(CONTAINER_REPO) $(CONTAINER_TAG)
2 changes: 1 addition & 1 deletion external-plugins/referee/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ format:

push:
podman build -f ../../images/$(CONTAINER_IMAGE)/Containerfile -t $(CONTAINER_REPO):$(CONTAINER_TAG) && podman push $(CONTAINER_REPO):$(CONTAINER_TAG)
bash -x ../../hack/update-deployments-with-latest-image.sh $(CONTAINER_REPO)
bash -x ../../hack/update-deployments-with-latest-image.sh $(CONTAINER_REPO) $(CONTAINER_TAG)
51 changes: 30 additions & 21 deletions external-plugins/referee/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,31 +149,39 @@ func (s *Server) handlePREvent(pr github.PullRequestEvent) error {
log := s.Log.WithField("pull_request_url", pullRequestURL)

switch action {
case github.PullRequestActionOpened:
case github.PullRequestActionReopened:
case github.PullRequestActionSynchronize:
// update metrics for PRs
prTimeLineForLastCommit, err := s.GHGraphQLClient.FetchPRTimeLineForLastCommit(org, repo, num)
if err != nil {
return fmt.Errorf("%s - failed to fetch number of retest comments: %w", pullRequestURL, err)
}
switch prTimeLineForLastCommit.NumberOfRetestComments {
case 0:
metrics.DeleteForPullRequest(org, repo, num)
break
default:
metrics.SetForPullRequest(org, repo, num, prTimeLineForLastCommit.NumberOfRetestComments)
}
log.Infof("updated metrics on PR")
break
case github.PullRequestActionConvertedToDraft:
// PRs that have been converted to draft are not tested thus they are not of interest for metrics
metrics.DeleteForPullRequest(org, repo, num)
return nil
case github.PullRequestActionClosed:
// PRs that have been merged or closed are not of interest for metrics
metrics.DeleteForPullRequest(org, repo, num)
break
return nil
case github.PullRequestActionOpened:
case github.PullRequestActionReopened:
case github.PullRequestActionReadyForReview:
case github.PullRequestActionSynchronize:
// the above cases are the ones where we need to update the metrics
default:
// all other cases -> no metric action necessary
log.Infof("skipping pull_request event action %s", action)
return nil
}
return updateMetricsForPRs(s, org, repo, num, pullRequestURL, log)
}

func updateMetricsForPRs(s *Server, org string, repo string, num int, pullRequestURL string, log *logrus.Entry) error {
prTimeLineForLastCommit, err := s.GHGraphQLClient.FetchPRTimeLineForLastCommit(org, repo, num)
if err != nil {
return fmt.Errorf("%s - failed to fetch number of retest comments: %w", pullRequestURL, err)
}
switch prTimeLineForLastCommit.NumberOfRetestComments {
case 0:
metrics.DeleteForPullRequest(org, repo, num)
default:
metrics.SetForPullRequest(org, repo, num, prTimeLineForLastCommit.NumberOfRetestComments)
}
log.Infof("updated metrics on PR")
return nil
}

Expand All @@ -182,15 +190,15 @@ func (s *Server) handlePullRequestComment(ic github.IssueCommentEvent) error {
repo := ic.Repo.Name
num := ic.Issue.Number
action := ic.Action
user := ic.Comment.User.Login
commentAuthor := ic.Comment.User.Login

pullRequestURL := fmt.Sprintf("https://github.com/%s/%s/pull/%d", org, repo, num)
log := s.Log.WithField("pull_request_url", pullRequestURL)

switch action {
case github.IssueCommentActionCreated:
default:
log.Debugf("skipping for action %s by %s", action, user)
log.Debugf("skipping for action %s by %s", action, commentAuthor)
return nil
}

Expand Down Expand Up @@ -248,9 +256,10 @@ func (s *Server) handlePullRequestComment(ic github.IssueCommentEvent) error {
}

if !s.DryRun {
prAuthor := ic.Issue.User.Login
var output bytes.Buffer
err := tooManyRetestsCommentTemplate.Execute(&output, TooManyRequestsData{
Author: user,
Author: prAuthor,
Team: s.Team,
})
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ postsubmits:
cluster: kubevirt-prow-workloads
spec:
containers:
- image: quay.io/kubevirtci/bootstrap:v20240711-f55d15c
- image: quay.io/kubevirtci/bootstrap:v20240814-9b6c4af
command:
- "/usr/local/bin/runner.sh"
- "/bin/bash"
Expand All @@ -37,15 +37,15 @@ postsubmits:
cluster: kubevirt-prow-workloads
spec:
containers:
- image: quay.io/kubevirtci/bootstrap:v20240711-f55d15c
- image: quay.io/kubevirtci/bootstrap:v20240814-9b6c4af
command:
- "/usr/local/bin/runner.sh"
- "/bin/bash"
- "-c"
- |
cat $QUAY_PASSWORD | docker login --username $(cat $QUAY_USER) --password-stdin=true quay.io &&
# Only push images on tags
COMMIT_TAG=$(git tag --points-at HEAD | head -1)
COMMIT_TAG=$(git tag --points-at HEAD | tail -1)
[ -z "$COMMIT_TAG" ] ||
make container docker-push IMAGE_TAG=$COMMIT_TAG
# docker-in-docker needs privileged mode
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
presubmits:
k8snetworkplumbingwg/kubemacpool:
- name: pull-kubemacpool-unit-test-v0.44
context: pull-kubemacpool-unit-test
branches:
- release-0.44
always_run: true
optional: false
decorate: true
decoration_config:
timeout: 3h
grace_period: 5m
cluster: kubevirt-prow-control-plane
max_concurrency: 6
labels:
preset-podman-in-container-enabled: "true"
preset-docker-mirror-proxy: "true"
preset-shared-images: "true"
spec:
containers:
- image: quay.io/kubevirtci/bootstrap:v20230801-94954c0
securityContext:
privileged: true
command:
- "/usr/local/bin/runner.sh"
- "/bin/sh"
- "-c"
- "automation/check-patch.unit-test.sh"

- name: pull-kubemacpool-e2e-k8s-v0.44
context: pull-kubemacpool-e2e-k8s
branches:
- release-0.44
always_run: true
optional: false
decorate: true
cluster: kubevirt-prow-workloads
decoration_config:
timeout: 3h
grace_period: 5m
max_concurrency: 6
labels:
preset-podman-in-container-enabled: "true"
preset-docker-mirror-proxy: "true"
preset-shared-images: "true"
spec:
nodeSelector:
type: bare-metal-external
containers:
- image: quay.io/kubevirtci/bootstrap:v20230801-94954c0
securityContext:
privileged: true
resources:
requests:
memory: "29Gi"
command:
- "/usr/local/bin/runner.sh"
- "/bin/sh"
- "-c"
- "automation/check-patch.e2e-k8s.sh"

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ presubmits:
preset-shared-images: "true"
spec:
containers:
- image: quay.io/kubevirtci/bootstrap:v20240711-f55d15c
- image: quay.io/kubevirtci/bootstrap:v20240814-9b6c4af
securityContext:
privileged: true
command:
Expand Down Expand Up @@ -52,7 +52,7 @@ presubmits:
nodeSelector:
type: bare-metal-external
containers:
- image: quay.io/kubevirtci/bootstrap:v20240711-f55d15c
- image: quay.io/kubevirtci/bootstrap:v20240814-9b6c4af
securityContext:
privileged: true
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ presubmits:
nodeSelector:
type: bare-metal-external
containers:
- image: quay.io/kubevirtci/bootstrap:v20240711-f55d15c
- image: quay.io/kubevirtci/bootstrap:v20240814-9b6c4af
securityContext:
privileged: true
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ presubmits:
- /bin/sh
- -c
- make functest
image: quay.io/kubevirtci/golang:v20240711-f55d15c
image: quay.io/kubevirtci/golang:v20240814-9b6c4af
name: ""
resources:
requests:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ postsubmits:
preset-kubevirtci-quay-credential: "true"
spec:
containers:
- image: quay.io/kubevirtci/bootstrap:v20240711-f55d15c
- image: quay.io/kubevirtci/bootstrap:v20240814-9b6c4af
env:
- name: DOCKER_PREFIX
value: quay.io/kubevirt
Expand Down Expand Up @@ -56,7 +56,7 @@ postsubmits:
preset-kubevirtci-quay-credential: "true"
spec:
containers:
- image: quay.io/kubevirtci/bootstrap:v20240711-f55d15c
- image: quay.io/kubevirtci/bootstrap:v20240814-9b6c4af
env:
- name: DOCKER_PREFIX
value: quay.io/kubevirt
Expand Down Expand Up @@ -92,7 +92,7 @@ postsubmits:
preset-github-credentials: "true"
spec:
containers:
- image: quay.io/kubevirtci/bootstrap:v20240711-f55d15c
- image: quay.io/kubevirtci/bootstrap:v20240814-9b6c4af
env:
- name: DOCKER_PREFIX
value: quay.io/kubevirt
Expand Down Expand Up @@ -131,7 +131,7 @@ postsubmits:
preset-github-credentials: "true"
spec:
containers:
- image: quay.io/kubevirtci/bootstrap:v20240711-f55d15c
- image: quay.io/kubevirtci/bootstrap:v20240814-9b6c4af
env:
- name: DOCKER_PREFIX
value: quay.io/kubevirt
Expand Down Expand Up @@ -173,7 +173,7 @@ postsubmits:
preset-kubevirtci-quay-credential: "true"
spec:
containers:
- image: quay.io/kubevirtci/bootstrap:v20240711-f55d15c
- image: quay.io/kubevirtci/bootstrap:v20240814-9b6c4af
env:
- name: DOCKER_PREFIX
value: quay.io/kubevirt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ presubmits:
preset-docker-mirror-proxy: "true"
spec:
containers:
- image: quay.io/kubevirtci/bootstrap:v20240711-f55d15c
- image: quay.io/kubevirtci/bootstrap:v20240814-9b6c4af
command:
- "/usr/local/bin/runner.sh"
- "/bin/sh"
Expand Down Expand Up @@ -47,7 +47,7 @@ presubmits:
preset-bazel-cache: "true"
spec:
containers:
- image: quay.io/kubevirtci/bootstrap:v20240711-f55d15c
- image: quay.io/kubevirtci/bootstrap:v20240814-9b6c4af
command:
- "/usr/local/bin/runner.sh"
- "/bin/sh"
Expand Down Expand Up @@ -80,7 +80,7 @@ presubmits:
nodeSelector:
type: bare-metal-external
containers:
- image: quay.io/kubevirtci/bootstrap:v20240711-f55d15c
- image: quay.io/kubevirtci/bootstrap:v20240814-9b6c4af
command:
- "/usr/local/bin/runner.sh"
- "/bin/sh"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ postsubmits:
cluster: kubevirt-prow-workloads
spec:
containers:
- image: quay.io/kubevirtci/bootstrap:v20240711-f55d15c
- image: quay.io/kubevirtci/bootstrap:v20240814-9b6c4af
command:
- "/usr/local/bin/runner.sh"
- "/bin/bash"
Expand All @@ -37,7 +37,7 @@ postsubmits:
cluster: kubevirt-prow-workloads
spec:
containers:
- image: quay.io/kubevirtci/bootstrap:v20240711-f55d15c
- image: quay.io/kubevirtci/bootstrap:v20240814-9b6c4af
command:
- "/usr/local/bin/runner.sh"
- "/bin/bash"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ presubmits:
nodeSelector:
type: bare-metal-external
containers:
- image: quay.io/kubevirtci/bootstrap:v20240711-f55d15c
- image: quay.io/kubevirtci/bootstrap:v20240814-9b6c4af
securityContext:
privileged: true
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ presubmits:
nodeSelector:
type: bare-metal-external
containers:
- image: quay.io/kubevirtci/golang:v20240711-f55d15c
- image: quay.io/kubevirtci/golang:v20240814-9b6c4af
command:
- "/usr/local/bin/runner.sh"
- "/bin/sh"
Expand Down Expand Up @@ -61,7 +61,7 @@ presubmits:
nodeSelector:
type: bare-metal-external
containers:
- image: quay.io/kubevirtci/golang:v20240711-f55d15c
- image: quay.io/kubevirtci/golang:v20240814-9b6c4af
command:
- "/usr/local/bin/runner.sh"
- "/bin/sh"
Expand Down Expand Up @@ -97,7 +97,7 @@ presubmits:
- /bin/sh
- -c
- make functest
image: quay.io/kubevirtci/golang:v20240711-f55d15c
image: quay.io/kubevirtci/golang:v20240814-9b6c4af
name: ""
resources:
requests:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ postsubmits:
cluster: kubevirt-prow-control-plane
spec:
containers:
- image: quay.io/kubevirtci/bootstrap:v20240711-f55d15c
- image: quay.io/kubevirtci/bootstrap:v20240814-9b6c4af
command:
- "/usr/local/bin/runner.sh"
- "/bin/bash"
Expand Down
Loading

0 comments on commit 5f11ef5

Please sign in to comment.