@@ -66,15 +66,54 @@ all_owners_raw()
66
66
done
67
67
}
68
68
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.
69
92
echo " # All approvers from all top-level OWNERS files, including OWNERS_ALIASES"
70
93
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
71
102
72
103
# remove maintainers groups
73
104
for owner in " ${OWNER_TYPES[@]} " ; do
74
105
echo -e " \n${owner} :"
75
- all_owners_raw " ${owner} " | \
106
+ maintainers= $( all_owners_raw " ${owner} " | \
76
107
grep -v -- " -maintainers" | \
77
108
grep -v " null" | \
78
109
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
80
119
done
0 commit comments