Skip to content

Commit

Permalink
Discover branches (#120)
Browse files Browse the repository at this point in the history
* Automatically discover branches

Signed-off-by: Pierangelo Di Pilato <[email protected]>

* Run make discover-branches ARGS="--config config/"

Signed-off-by: Pierangelo Di Pilato <[email protected]>

* Fix unit tests

Signed-off-by: Pierangelo Di Pilato <[email protected]>

* Remove push to fork

Signed-off-by: Pierangelo Di Pilato <[email protected]>

* Remove debug logging

Co-authored-by: Christoph Stäbler <[email protected]>

* Separate job

Signed-off-by: Pierangelo Di Pilato <[email protected]>

---------

Signed-off-by: Pierangelo Di Pilato <[email protected]>
Co-authored-by: Christoph Stäbler <[email protected]>
  • Loading branch information
pierDipi and creydr authored Feb 7, 2024
1 parent 08401fb commit c1892f4
Show file tree
Hide file tree
Showing 17 changed files with 812 additions and 567 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/release-discover-branches.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: Discover branches

on:
pull_request:
branches:
- '**'
push:
branches:
- 'main'
schedule:
- cron: "0 5 * * *" # Daily at 05:00.
workflow_dispatch: # Manual workflow trigger

jobs:
discover-branches:
name: generate-ci
runs-on: ubuntu-latest
env:
GOPATH: ${{ github.workspace }}
steps:

- name: Checkout openshift-knative/hack
uses: actions/checkout@v3
with:
path: ./src/github.com/openshift-knative/hack

- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version-file: ./src/github.com/openshift-knative/hack/go.mod

- name: Configure Git user
run: |
git config --global user.email "[email protected]"
git config --global user.name "OpenShift Serverless"
- name: Discover branches
working-directory: ./src/github.com/openshift-knative/hack
run: make discover-branches ARGS="--config config/"

- name: Create Discovery Pull Request
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref_name == 'main'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.SERVERLESS_QE_ROBOT }}
path: ./src/github.com/openshift-knative/hack
base: main
branch: discover-serverless-ci
title: "Add new midstream branches"
commit-message: "Discover new branches"
delete-branch: true
body: |
Discover new branches using openshift-knative/hack.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ generate-serverless-operator-ci:
go run github.com/openshift-knative/hack/cmd/prowgen --config config/serverless-operator.yaml $(ARGS)
.PHONY: generate-serverless-operator-ci

discover-branches:
go run github.com/openshift-knative/hack/cmd/discover $(ARGS)
.PHONY: discover-branches

unit-tests:
go test ./pkg/...

Expand Down
9 changes: 9 additions & 0 deletions cmd/discover/discover.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

import (
"github.com/openshift-knative/hack/pkg/discover"
)

func main() {
discover.Main()
}
27 changes: 13 additions & 14 deletions config/eventing-hyperfoil-benchmark.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# Full struct in cmd/prowgen/prowgen.go#Config

config:
branches:
"main":
main:
openShiftVersions:
- version: "4.14"

- version: "4.14"
repositories:
- org: openshift-knative
repo: eventing-hyperfoil-benchmark
imagePrefix: knative-eventing-hyperfoil-benchmark
slackChannel: "#knative-eventing-ci"
e2e:
- match: ".*test-kafka-broker-upstream-.*"
- match: ".*test-kafka-broker-namespaced-midstream-.*"
onDemand: true

- dockerfiles: {}
e2e:
- match: .*test-kafka-broker-upstream-.*
- match: .*test-kafka-broker-namespaced-midstream-.*
onDemand: true
ignoreConfigs: {}
imagePrefix: knative-eventing-hyperfoil-benchmark
org: openshift-knative
promotion: {}
repo: eventing-hyperfoil-benchmark
slackChannel: '#knative-eventing-ci'
51 changes: 25 additions & 26 deletions config/eventing-istio.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
# Full struct in cmd/prowgen/prowgen.go#Config

config:
branches:
"release-v1.10":
release-next:
openShiftVersions:
- version: "4.14"
- version: "4.11"
"release-v1.11":
- version: "4.14"
- version: "4.11"
release-v1.10:
openShiftVersions:
- version: "4.14"
- version: "4.11"
"release-v1.12":
- version: "4.14"
- version: "4.11"
release-v1.11:
openShiftVersions:
- version: "4.14"
- version: "4.11"
"release-v1.13":
- version: "4.14"
- version: "4.11"
release-v1.12:
openShiftVersions:
- version: "4.14"
- version: "4.11"
"release-next":
- version: "4.14"
- version: "4.11"
release-v1.13:
openShiftVersions:
- version: "4.14"
- version: "4.11"

- version: "4.14"
- version: "4.11"
repositories:
- org: openshift-knative
repo: eventing-istio
promotion:
namespace: openshift
imagePrefix: knative-eventing-istio
slackChannel: "#knative-eventing-ci"
e2e:
- match: ".*e2e-tests$"
- dockerfiles: {}
e2e:
- match: .*e2e-tests$
ignoreConfigs: {}
imagePrefix: knative-eventing-istio
org: openshift-knative
promotion:
namespace: openshift
repo: eventing-istio
slackChannel: '#knative-eventing-ci'
55 changes: 27 additions & 28 deletions config/eventing-kafka-broker.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
# Full struct in cmd/prowgen/prowgen.go#Config

config:
branches:
"release-v1.10":
release-next:
openShiftVersions:
- version: "4.14"
- version: "4.11"
"release-v1.11":
- version: "4.14"
- version: "4.11"
release-v1.10:
openShiftVersions:
- version: "4.14"
- version: "4.11"
"release-v1.12":
- version: "4.14"
- version: "4.11"
release-v1.11:
openShiftVersions:
- version: "4.14"
- version: "4.11"
"release-v1.13":
- version: "4.14"
- version: "4.11"
release-v1.12:
openShiftVersions:
- version: "4.14"
- version: "4.11"
"release-next":
- version: "4.14"
- version: "4.11"
release-v1.13:
openShiftVersions:
- version: "4.14"
- version: "4.11"

- version: "4.14"
- version: "4.11"
repositories:
- org: openshift-knative
repo: eventing-kafka-broker
promotion:
namespace: openshift
imagePrefix: knative-eventing-kafka-broker
slackChannel: "#knative-eventing-ci"
e2e:
- match: ".*e2e$"
- match: ".*reconciler.*"
- match: ".*conformance.*"
- dockerfiles: {}
e2e:
- match: .*e2e$
- match: .*reconciler.*
- match: .*conformance.*
ignoreConfigs: {}
imagePrefix: knative-eventing-kafka-broker
org: openshift-knative
promotion:
namespace: openshift
repo: eventing-kafka-broker
slackChannel: '#knative-eventing-ci'
55 changes: 27 additions & 28 deletions config/eventing.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
# Full struct in cmd/prowgen/prowgen.go#Config

config:
branches:
"release-v1.10":
release-next:
openShiftVersions:
- version: "4.14"
- version: "4.11"
"release-v1.11":
- version: "4.14"
- version: "4.11"
release-v1.10:
openShiftVersions:
- version: "4.14"
- version: "4.11"
"release-v1.12":
- version: "4.14"
- version: "4.11"
release-v1.11:
openShiftVersions:
- version: "4.14"
- version: "4.11"
"release-v1.13":
- version: "4.14"
- version: "4.11"
release-v1.12:
openShiftVersions:
- version: "4.14"
- version: "4.11"
"release-next":
- version: "4.14"
- version: "4.11"
release-v1.13:
openShiftVersions:
- version: "4.14"
- version: "4.11"

- version: "4.14"
- version: "4.11"
repositories:
- org: openshift-knative
repo: eventing
promotion:
namespace: openshift
imagePrefix: knative-eventing
slackChannel: "#knative-eventing-ci"
e2e:
- match: ".*e2e$"
- match: ".*reconciler.*"
- match: ".*conformance.*"
- dockerfiles: {}
e2e:
- match: .*e2e$
- match: .*reconciler.*
- match: .*conformance.*
ignoreConfigs: {}
imagePrefix: knative-eventing
org: openshift-knative
promotion:
namespace: openshift
repo: eventing
slackChannel: '#knative-eventing-ci'
Loading

0 comments on commit c1892f4

Please sign in to comment.