whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Check that all uids are defined as people
Date Mon, 02 Jan 2017 21:35:14 GMT
This is an automated email from the ASF dual-hosted git repository.

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

The following commit(s) were added to refs/heads/master by this push:
       new  67c422d   Check that all uids are defined as people
67c422d is described below

commit 67c422d6ff1d8f8fc73574c7255ca699490fb8cc
Author: Sebb <sebb@apache.org>
AuthorDate: Mon Jan 2 21:34:48 2017 +0000

    Check that all uids are defined as people
---
 www/roster/public_committee_info.rb  |  7 +++++++
 www/roster/public_ldap_authgroups.rb | 11 +++++++++++
 www/roster/public_ldap_committees.rb | 11 +++++++++++
 www/roster/public_ldap_groups.rb     | 11 +++++++++++
 www/roster/public_ldap_services.rb   | 10 ++++++++++
 www/roster/public_member_info.rb     |  8 ++++++++
 www/roster/public_nonldap_groups.rb  | 10 ++++++++++
 7 files changed, 68 insertions(+)

diff --git a/www/roster/public_committee_info.rb b/www/roster/public_committee_info.rb
index b34a803..266b687 100644
--- a/www/roster/public_committee_info.rb
+++ b/www/roster/public_committee_info.rb
@@ -78,6 +78,9 @@ if changed? and @old_file
   # Note: for those in an earlier timezone the date could be a few hours earlier
   updated_day2 = (last_updated-3600*4).strftime("%Y-%m-%d") # day of previous update
 
+  # for validating UIDs
+  uids = ASF::Person.list().map(&:id)
+
   info[:committees].each { |pmc, entry|
     next if pmc == 'infrastructure' # no dates
     previouspmc = previous[pmc] # get the original details (if any)
@@ -107,6 +110,9 @@ if changed? and @old_file
       Wunderbar.info "New PMC detected: #{pmc}"
       # Could check that the joining dates are all the same?
     end
+    entry[:roster].each { |id,value|
+      Wunderbar.warn "#{pmc}: unknown uid #{id}" unless uids.include?(id)
+    }
   }
 
   previous.each { |pmc, entry|
@@ -114,4 +120,5 @@ if changed? and @old_file
       Wunderbar.info "Deleted PMC detected: #{pmc}"
     end
   }
+  
 end
diff --git a/www/roster/public_ldap_authgroups.rb b/www/roster/public_ldap_authgroups.rb
index 432ed43..c69a1d8 100644
--- a/www/roster/public_ldap_authgroups.rb
+++ b/www/roster/public_ldap_authgroups.rb
@@ -1,3 +1,4 @@
+# Reads LDAP ou=auth,ou=groups,dc=apache,dc=org
 # Creates JSON output with the following format:
 #
 # {
@@ -52,3 +53,13 @@ info = {
 }
 
 public_json_output(info)
+
+if changed? and @old_file
+  # for validating UIDs
+  uids = ASF::Person.list().map(&:id)
+  entries.each do |name, entry|
+    entry[:roster].each do |id|
+      Wunderbar.warn "#{name}: unknown uid #{id}" unless uids.include?(id)      
+    end
+  end
+end
diff --git a/www/roster/public_ldap_committees.rb b/www/roster/public_ldap_committees.rb
index 9d7931f..9e2d7f2 100644
--- a/www/roster/public_ldap_committees.rb
+++ b/www/roster/public_ldap_committees.rb
@@ -1,3 +1,4 @@
+# Reads LDAP ou=pmc,ou=committees,ou=groups,dc=apache,dc=org
 # Creates JSON output with the following format:
 #
 # {
@@ -47,3 +48,13 @@ info = {
 }
 
 public_json_output(info)
+
+if changed? and @old_file
+  # for validating UIDs
+  uids = ASF::Person.list().map(&:id)
+  entries.each do |name, entry|
+    entry[:roster].each do |id|
+      Wunderbar.warn "#{name}: unknown uid #{id}" unless uids.include?(id)      
+    end
+  end
+end
diff --git a/www/roster/public_ldap_groups.rb b/www/roster/public_ldap_groups.rb
index 3a4915a..c3b9629 100644
--- a/www/roster/public_ldap_groups.rb
+++ b/www/roster/public_ldap_groups.rb
@@ -1,3 +1,4 @@
+# Reads LDAP ou=groups,dc=apache,dc=org
 # Creates JSON output with the following format:
 #
 # {
@@ -47,3 +48,13 @@ info = {
 }
 
 public_json_output(info)
+
+if changed? and @old_file
+  # for validating UIDs
+  uids = ASF::Person.list().map(&:id)
+  entries.each do |name, entry|
+    entry[:roster].each do |id|
+      Wunderbar.warn "#{name}: unknown uid #{id}" unless uids.include?(id)      
+    end
+  end
+end
diff --git a/www/roster/public_ldap_services.rb b/www/roster/public_ldap_services.rb
index d0d1ab4..73a08c8 100644
--- a/www/roster/public_ldap_services.rb
+++ b/www/roster/public_ldap_services.rb
@@ -49,3 +49,13 @@ info = {
 }
 
 public_json_output(info)
+
+if changed? and @old_file
+  # for validating UIDs
+  uids = ASF::Person.list().map(&:id)
+  entries.each do |name, entry|
+    entry[:roster].each do |id|
+      Wunderbar.warn "#{name}: unknown uid #{id}" unless uids.include?(id)      
+    end
+  end
+end
diff --git a/www/roster/public_member_info.rb b/www/roster/public_member_info.rb
index 04a39f1..9118707 100644
--- a/www/roster/public_member_info.rb
+++ b/www/roster/public_member_info.rb
@@ -48,3 +48,11 @@ info[:members].sort!
 info[:ex_members] = Hash[info[:ex_members].sort]
 
 public_json_output(info)
+
+if changed? and @old_file
+  # for validating UIDs
+  uids = ASF::Person.list().map(&:id)
+  info[:members].each do |id|
+    Wunderbar.warn "member: unknown uid #{id}" unless uids.include?(id)      
+  end
+end
diff --git a/www/roster/public_nonldap_groups.rb b/www/roster/public_nonldap_groups.rb
index 2470483..864f7fd 100644
--- a/www/roster/public_nonldap_groups.rb
+++ b/www/roster/public_nonldap_groups.rb
@@ -57,3 +57,13 @@ public_json_output(
   # TODO decide how to present the data: separate key or attribute or file
   #pitgroups: pitgroups
 )
+
+if changed? and @old_file
+  # for validating UIDs
+  uids = ASF::Person.list().map(&:id)
+  groups.each do |name, entry|
+    entry[:roster].each do |id|
+      Wunderbar.warn "#{name}: unknown uid #{id}" unless uids.include?(id)      
+    end
+  end
+end

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message