Skip to content

Commit

Permalink
[ci] Update codeowners script (#5212)
Browse files Browse the repository at this point in the history
Co-authored-by: Jan-Otto Kröpke <github@jkroepke.de>
  • Loading branch information
SuperQ and jkroepke authored Jan 20, 2025
1 parent 87187e1 commit f726405
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
root = true

[*.sh]
indent_style = space
indent_size = 2
14 changes: 7 additions & 7 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
# See https://github.com/scottrigby/prometheus-helm-charts/issues/12
# See https://github.com/prometheus-community/helm-charts/issues/12
# https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
# https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax

# The repo admins team will be the default owners for everything in the repo.
# Unless a later match takes precedence, they will be requested for review when someone opens a pull request.
* @prometheus-community/helm-charts-admins

/.github/workflows/ @prometheus-community/helm-charts-admins @jkroepke @GMartinez-Sisti
/renovate.json @prometheus-community/helm-charts-admins @jkroepke @GMartinez-Sisti
/.github/workflows/ @prometheus-community/helm-charts-admins @GMartinez-Sisti
/renovate.json @prometheus-community/helm-charts-admins @GMartinez-Sisti

/charts/alertmanager/ @monotek @naseemkullah
/charts/alertmanager-snmp-notifier/ @maxwo
/charts/alertmanager/ @monotek @naseemkullah
/charts/jiralert/ @jkroepke @zanhsieh
/charts/kube-prometheus-stack/ @andrewgkew @gianrubio @gkarthiks @GMartinez-Sisti @jkroepke @QuentinBisson @scottrigby @Xtigyro
/charts/kube-prometheus-stack/ @GMartinez-Sisti @QuentinBisson @Xtigyro @andrewgkew @gianrubio @gkarthiks @jkroepke @scottrigby
/charts/kube-state-metrics/ @dotdc @mrueg @tariq1890
/charts/prom-label-proxy/ @jkroepke
/charts/prometheus/ @gianrubio @naseemkullah @Xtigyro @zanhsieh @zeritti
/charts/prometheus-adapter/ @hectorj2f @mattiasgees @steven-sheehy
/charts/prometheus-blackbox-exporter/ @desaintmartin @gianrubio @monotek @rsotnychenko
/charts/prometheus-cloudwatch-exporter/ @asherf @gianrubio @torstenwalter
Expand All @@ -37,7 +36,7 @@
/charts/prometheus-node-exporter/ @gianrubio @zanhsieh @zeritti
/charts/prometheus-opencost-exporter/ @mattray
/charts/prometheus-operator-admission-webhook/ @zeritti
/charts/prometheus-operator-crds/ @dacamposol @desaintmartin @jkroepke @QuentinBisson
/charts/prometheus-operator-crds/ @QuentinBisson @dacamposol @desaintmartin @jkroepke
/charts/prometheus-pgbouncer-exporter/ @stewartshea @zeritti
/charts/prometheus-pingdom-exporter/ @monotek @rpahli
/charts/prometheus-pingmesh-exporter/ @dongjiang1989
Expand All @@ -54,3 +53,4 @@
/charts/prometheus-to-sd/ @acondrat
/charts/prometheus-windows-exporter/ @jkroepke
/charts/prometheus-yet-another-cloudwatch-exporter/ @cristiangreco @thomaspeitz
/charts/prometheus/ @Xtigyro @gianrubio @naseemkullah @zanhsieh @zeritti
2 changes: 1 addition & 1 deletion .github/workflows/check-codeowners.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

- name: generate CODEOWNERS
run: |
./scripts/check-codeowners.sh > .github/CODEOWNERS
./scripts/check-codeowners.sh | tee .github/CODEOWNERS
- name: check CODEOWNERS for modifications
run: |
Expand Down
20 changes: 10 additions & 10 deletions scripts/check-codeowners.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#!/usr/bin/env bash

# Make sure sort works predictably.
export LC_ALL=C

cat <<EOF
# See https://github.com/scottrigby/prometheus-helm-charts/issues/12
# See https://github.com/prometheus-community/helm-charts/issues/12
# https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
# https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax
# The repo admins team will be the default owners for everything in the repo.
# Unless a later match takes precedence, they will be requested for review when someone opens a pull request.
* @prometheus-community/helm-charts-admins
/.github/workflows/ @prometheus-community/helm-charts-admins @jkroepke @GMartinez-Sisti
/renovate.json @prometheus-community/helm-charts-admins @jkroepke @GMartinez-Sisti
/.github/workflows/ @prometheus-community/helm-charts-admins @GMartinez-Sisti
/renovate.json @prometheus-community/helm-charts-admins @GMartinez-Sisti
EOF

for DIR in $(ls -1 -d ./charts/*)
do
FILE="$DIR/Chart.yaml"
DIR=$(echo $DIR | sed 's/^\.//')
MAINTAINERS=$(yq e '.maintainers.[].url' $FILE | sed 's!^https://github.com/!@!' | sort --ignore-case)
echo $DIR/ $MAINTAINERS
done
yq_script='"/charts/" + .name + "/ " + ([.maintainers[].url | sub("https://github.com/", "@")] | sort | join(" "))'

yq e "${yq_script}" charts/*/Chart.yaml |
sort -t '/' -k 3

0 comments on commit f726405

Please sign in to comment.