This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 300b6c0  Add summary counts
300b6c0 is described below

commit 300b6c0dd0aa117e1d6a41f415a8fb491397e18b
Author: Sebb <s...@apache.org>
AuthorDate: Fri Sep 10 16:52:35 2021 +0100

    Add summary counts
---
 www/roster/public_ldap_roles.rb | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/www/roster/public_ldap_roles.rb b/www/roster/public_ldap_roles.rb
index bcf51c5..4083802 100644
--- a/www/roster/public_ldap_roles.rb
+++ b/www/roster/public_ldap_roles.rb
@@ -2,6 +2,12 @@
 #
 # {
 #   "lastTimestamp": "20160119171152Z", // most recent modifyTimestamp
+#   "rolegroup_count": 1,
+#     "roster_counts": {
+#        "committers": 1234,
+#        ...
+#      },
+#   },
 #   "rolegroups": {
 #     "committers": {
 #       "modifyTimestamp": "20111204095436Z",
@@ -28,6 +34,7 @@ if groups.empty?
 end
 
 lastStamp = ''
+roster_counts = Hash.new(0)
 groups.keys.sort_by(&:name).each do |entry|
   next if entry.name == 'apldap' # infra team would prefer this not be 
publicized
 
@@ -42,11 +49,14 @@ groups.keys.sort_by(&:name).each do |entry|
     roster_count: m.size,
     roster: m
   }
+  roster_counts[entry.name] = m.size
 end
 
 info = {
   # Is there a use case for the last createTimestamp ?
   lastTimestamp: lastStamp,
+  rolegroup_count: entries.size,
+  roster_counts: roster_counts,
   rolegroups: entries,
 }
 

Reply via email to