Skip to content

Commit 55ad00a

Browse files
Merge pull request #20 from Nordix/update_all_owners
update the all-owners.sh and the ALL-OWNERS
2 parents ec4a1eb + 3e0dc82 commit 55ad00a

File tree

3 files changed

+62
-18
lines changed

3 files changed

+62
-18
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.git
2+
*.csv

maintainers/ALL-OWNERS

+19-16
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
# All approvers from all top-level OWNERS files, including OWNERS_ALIASES
22
# Generated by community/maintainers/all-owners.sh
3+
# Each line represents an individual maintainer and the line has to
4+
# contain the name, affiliation, GitHub handle and the e-mail of the
5+
# maintainer.
36

47
approvers:
5-
- adilGhaffarDev
6-
- bfournie
7-
- derekhiggins
8-
- dtantsur
9-
- elfosardo
10-
- honza
11-
- hroyrh
12-
- iurygregory
13-
- kashifest
14-
- lentzi90
15-
- mboukhalfa
16-
- Rozzii
17-
- smoshiur1237
18-
- Sunnatillo
19-
- tuminoid
20-
- zaneb
8+
- Muhammad Adil Ghaffar,Ericsson Software Technology,adilGhaffarDev,[email protected]
9+
- Bob Fournier,Red Hat,bfournie,[email protected]
10+
- Derek Higgins,Red Hat,derekhiggins,[email protected]
11+
- Dmitry Tantsur,Red Hat,dtantsur,[email protected]
12+
- Riccardo Pittau,Red Hat,elfosardo,[email protected]
13+
- Honza Pokorny,Red Hat,honza,[email protected]
14+
- Himanshu Roy,Red Hat,hroyrh,[email protected]
15+
- Iury Gregory Melo Ferreira,Red Hat,iurygregory,[email protected]
16+
- Kashif Khan,Ericsson Software Technology,kashifest,[email protected]
17+
- Lennart Jern,Ericsson Software Technology,lentzi90,[email protected]
18+
- Mohammed Boukhalfa,Ericsson Software Technology,mboukhalfa,[email protected]
19+
- Adam Rozman,Ericsson Software Technology,Rozzii,[email protected]
20+
- Moshiur Rahman,Ericsson Software Technology,smoshiur1237,[email protected]
21+
- Sunnat Samadov,Ericsson Software Technology,Sunnatillo,[email protected]
22+
- Tuomo Tanskanen,Ericsson Software Technology,tuminoid,[email protected]
23+
- Zane Bitter,Red Hat,zaneb,[email protected]

maintainers/all-owners.sh

+41-2
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,54 @@ all_owners_raw()
6666
done
6767
}
6868

69+
# Find e-mail address of the committer based on their name and DCO metadata
70+
find_mail()
71+
{
72+
local mail name
73+
name="$1"
74+
for repo in "${REPOS[@]}"; do
75+
cd "${repo}.git"
76+
mail=$(git log --grep="$name" -n 1 | grep "Signed" | sed -e 's/.*<\(.*\)>/\1/g')
77+
cd ..
78+
if [[ -n "${mail}" ]]; then
79+
break
80+
fi
81+
done
82+
echo "${mail}"
83+
}
84+
85+
# The idea is to match 3 sources of truth against each other, the DCO
86+
# signatures, the CNCF maintainer spread sheet, the OWNERS and OWNERS_ALIASES
87+
# files form each repo. The beneficial side effect of such 3 way matching is
88+
# that anomalies related to DCO, OWNERS files and the spread sheet can be
89+
# detected and fixed in order to keep them in sync. Manual intervention might
90+
# be required e.g. in case of folks who have never signed a DCO or represented
91+
# under different names in different sources.
6992
echo "# All approvers from all top-level OWNERS files, including OWNERS_ALIASES"
7093
echo "# Generated by community/maintainers/all-owners.sh"
94+
echo "# Each line represents an individual maintainer and the line has to"
95+
echo "# contain the name, affiliation, GitHub handle and the e-mail of the"
96+
echo "# maintainer."
97+
# Download the CNCF maintainer doc and the repository metadata (not the full repo)
98+
curl "${CURL_OPTS[@]}" "https://raw.githubusercontent.com/cncf/foundation/main/project-maintainers.csv" > "project-maintainers.csv"
99+
for repo in "${REPOS[@]}"; do
100+
git clone --quiet --bare "https://github.com/metal3-io/${repo}"
101+
done
71102

72103
# remove maintainers groups
73104
for owner in "${OWNER_TYPES[@]}"; do
74105
echo -e "\n${owner}:"
75-
all_owners_raw "${owner}" | \
106+
maintainers=$(all_owners_raw "${owner}" | \
76107
grep -v -- "-maintainers" | \
77108
grep -v "null" | \
78109
grep -v "\.\.\." | \
79-
sort -uf
110+
sort -uf | sed -e 's/- //g')
111+
mapfile -t < <(echo "${maintainers[@]}")
112+
for maintainer in "${MAPFILE[@]}"; do
113+
# match the GitHub handle against the CNCF maintainer file
114+
# remove the double ',' and the windows carrige return from the lines
115+
individual="$(grep "${maintainer}" "project-maintainers.csv" | sed -e 's/,,//g' | sed -e 's/\r//g')"
116+
mail=$(find_mail "${individual%%,*}")
117+
echo "- ${individual}${mail}"
118+
done
80119
done

0 commit comments

Comments
 (0)