Skip to content

Commit 1ce22e8

Browse files
razvanFelix Hennig
andauthored
Parallelize downstream PRs (#342)
* chore(gh): split repositories.yaml * feat(gh): use matrix strategy to speed up downstream prs * try toJSON * fix lint * fix lint * Some comments --------- Co-authored-by: Felix Hennig <[email protected]>
1 parent 59c766d commit 1ce22e8

File tree

5 files changed

+112
-11
lines changed

5 files changed

+112
-11
lines changed

.github/workflows/generate_prs.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,88 @@ on:
1515
jobs:
1616
create-prs:
1717
runs-on: ubuntu-latest
18+
strategy:
19+
# If you add a new repository here, also add it to config/repositories.yaml
20+
matrix:
21+
repository:
22+
- name: airflow-operator
23+
pretty_string: Apache Airflow
24+
product_string: airflow
25+
url: stackabletech/airflow-operator.git
26+
- name: commons-operator
27+
include_productconfig: false
28+
has_product: false
29+
pretty_string: Stackable Commons
30+
product_string: commons
31+
url: stackabletech/commons-operator.git
32+
- name: druid-operator
33+
pretty_string: Apache Druid
34+
product_string: druid
35+
url: stackabletech/druid-operator.git
36+
- name: hbase-operator
37+
pretty_string: Apache HBase
38+
product_string: hbase
39+
url: stackabletech/hbase-operator.git
40+
- name: edc-operator
41+
pretty_string: EDC
42+
product_string: edc
43+
url: stackabletech/edc-operator.git
44+
- name: hdfs-operator
45+
pretty_string: Apache HDFS
46+
product_string: hdfs
47+
url: stackabletech/hdfs-operator.git
48+
- name: hello-world-operator
49+
pretty_string: Hello World
50+
product_string: hello
51+
url: stackabletech/hello-world-operator.git
52+
- name: hive-operator
53+
pretty_string: Apache Hive
54+
product_string: hive
55+
url: stackabletech/hive-operator.git
56+
- name: kafka-operator
57+
pretty_string: Apache Kafka
58+
product_string: kafka
59+
url: stackabletech/kafka-operator.git
60+
- name: nifi-operator
61+
pretty_string: Apache NiFi
62+
product_string: nifi
63+
url: stackabletech/nifi-operator.git
64+
- name: listener-operator
65+
include_productconfig: false
66+
has_product: false
67+
pretty_string: Stackable Listener Operator
68+
product_string: listener-operator
69+
run_as: custom
70+
url: stackabletech/listener-operator.git
71+
- name: opa-operator
72+
extra_crates:
73+
- stackable-opa-bundle-builder
74+
pretty_string: OpenPolicyAgent
75+
product_string: opa
76+
url: stackabletech/opa-operator.git
77+
- name: secret-operator
78+
include_productconfig: false
79+
has_product: false
80+
pretty_string: Stackable Secret Operator
81+
product_string: secret-operator
82+
run_as: custom
83+
url: stackabletech/secret-operator.git
84+
- name: spark-k8s-operator
85+
pretty_string: Apache Spark-on-Kubernetes
86+
product_string: spark-k8s
87+
url: stackabletech/spark-k8s-operator.git
88+
- name: superset-operator
89+
pretty_string: Apache Superset
90+
product_string: superset
91+
url: stackabletech/superset-operator.git
92+
- name: trino-operator
93+
pretty_string: Trino
94+
product_string: trino
95+
url: stackabletech/trino-operator.git
96+
- name: zookeeper-operator
97+
pretty_string: Apache ZooKeeper
98+
product_string: zookeeper
99+
url: stackabletech/zookeeper-operator.git
18100
steps:
19101
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # tag=v4.1.1
20102
- uses: cachix/install-nix-action@6004951b182f8860210c8d6f0d808ec5b1a33d28 # tag=v25
@@ -52,6 +134,17 @@ jobs:
52134
run: |
53135
echo "REASON=Daily run triggered" >> "$GITHUB_ENV"
54136
137+
- name: Overwrite repositories.yaml for ${{ matrix.repository.name }}
138+
run: |
139+
cat >config/repositories.yaml <<CONFIG
140+
---
141+
repositories:
142+
- ${{ toJSON(matrix.repository) }}
143+
CONFIG
144+
145+
# For debugging
146+
cat config/repositories.yaml
147+
55148
# Generate PRs
56149
- name: Run playbook
57150
if: ${{ !inputs.dry-run }}

repositories.yaml renamed to config/repositories.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# This file exists just for the purpose of running test.sh locally.
2+
# The GH workflow generate_prs.yml will overwrite it with the contents if the
3+
# matrix run.
4+
# If you add a new repository here, you also need to add it to that workflow file.
15
---
26
repositories:
37
- name: airflow-operator
@@ -79,14 +83,4 @@ repositories:
7983
product_string: zookeeper
8084
url: stackabletech/zookeeper-operator.git
8185

82-
# IMPORTANT
83-
# If you change the Rust toolchain version here, make sure to also change
84-
# Docker-images/ubi8-rust-builder/Dockerfile
85-
rust_version: 1.76.0
8686

87-
# Anything specified in the retired_files variable will be deleted.
88-
# This is uncommented as I had issues with everything being deleted when this was just present as an empty key.
89-
# May be something to investigate.
90-
retired_files:
91-
- python/cargo_version.py
92-
- python/requirements.txt

config/retired_files.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
# Anything specified in the retired_files variable will be deleted.
3+
# This is uncommented as I had issues with everything being deleted when this was just present as an empty key.
4+
# May be something to investigate.
5+
retired_files:
6+
- python/cargo_version.py
7+
- python/requirements.txt

config/rust.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
# IMPORTANT
3+
# If you change the Rust toolchain version here, make sure to also change
4+
# Docker-images/ubi8-rust-builder/Dockerfile
5+
rust_version: 1.76.0

playbook/playbook.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55

66
tasks:
77
- name: Include data which repositories to check
8-
include_vars: ../repositories.yaml
8+
include_vars: "{{ item }}"
99
tags: local
10+
with_fileglob:
11+
- "../config/*.yaml"
1012

1113
- name: Ensure work directory exists
1214
file:

0 commit comments

Comments
 (0)