Skip to content

Commit 2cdb82a

Browse files
committed
sync_team_membership: Add maintainers to collaborators team
By definition, all maintainers are collaborators -- from Zephyr TSC Project Roles documentation: A Maintainer is a Collaborator who is also responsible for knowing, directing and anticipating the needs of a given zephyr source code area. This commit updates the team membership sync script to add all maintainers to the 'collaborators' team such that the 'collaborators' team is a superset of the 'maintainers' team. Note that the same logic applies for collaborators and contributors, which is already handled. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent 0502ac9 commit 2cdb82a

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

terraform/github-zephyrproject-rtos/scripts/sync_team_membership.sh

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,9 @@ echo "${maintainers_data}" | yq &> /dev/null || (
4747

4848
# Get the list of all collaborators
4949
all_collaborators=$(echo "${maintainers_data}" | yq -r '.[].collaborators.[]')
50-
all_collaborators=$(echo "${all_collaborators}" | sort -f -u)
5150

5251
# Get the list of all maintainers
5352
all_maintainers=$(echo "${maintainers_data}" | yq -r '.[].maintainers.[]')
54-
all_maintainers=$(echo "${all_maintainers}" | sort -f -u)
5553

5654
# Read global admin list
5755
global_admins=$(<${manifest_path}/global-admins.csv)
@@ -79,7 +77,7 @@ write_team_member_list()
7977
done
8078
}
8179

82-
write_team_member_list "${collaborators_csv}" "${all_collaborators}"
80+
write_team_member_list "${collaborators_csv}" "${all_collaborators} ${all_maintainers}"
8381
write_team_member_list "${maintainers_csv}" "${all_maintainers}"
8482

8583
# Add all maintainers and collaborators to the contributors team member list
@@ -88,8 +86,19 @@ contributors_csv="${manifest_path}/team/team-members/contributors.csv"
8886
tail -n +2 "${maintainers_csv}" >> "${contributors_csv}"
8987
tail -n +2 "${collaborators_csv}" >> "${contributors_csv}"
9088

91-
contributors_data=$(tail -n +2 "${contributors_csv}")
92-
contributors_data=$(echo "${contributors_data}" | sort -f | uniq -i)
89+
# Keep all team member list files sorted
90+
sort_csv()
91+
{
92+
csv_file="$1"
93+
94+
csv_header=$(head -n 1 "${csv_file}")
95+
csv_data=$(tail -n +2 "${csv_file}")
96+
csv_data=$(echo "${csv_data}" | sort -f | uniq -i)
97+
98+
echo "${csv_header}" > "${csv_file}"
99+
echo "${csv_data}" >> "${csv_file}"
100+
}
93101

94-
echo "username,role" > "${contributors_csv}"
95-
echo "${contributors_data}" >> "${contributors_csv}"
102+
sort_csv "${contributors_csv}"
103+
sort_csv "${collaborators_csv}"
104+
sort_csv "${maintainers_csv}"

0 commit comments

Comments
 (0)