You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2017/08/11 14:59:12 UTC
[whimsy] branch master updated: Add check of name usage
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 34e3103 Add check of name usage
34e3103 is described below
commit 34e3103c491d87d0c6655a4b9d53bbdd84c221ad
Author: Sebb <se...@apache.org>
AuthorDate: Fri Aug 11 15:59:09 2017 +0100
Add check of name usage
---
tools/check_consistency.rb | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/tools/check_consistency.rb b/tools/check_consistency.rb
index 11053cf..1b33a25 100644
--- a/tools/check_consistency.rb
+++ b/tools/check_consistency.rb
@@ -9,9 +9,13 @@ ASF::LDAP.bind if fix
groups = ASF::Group.preload # for performance
committees = ASF::Committee.preload # for performance
projects = ASF::Project.preload
-
+summary=Hash.new { |h, k| h[k] = { } }
+projects.keys.sort_by {|a| a.name}.each do |entry|
+ summary[entry.name]['p']=1
+end
puts "project.members ~ group.members"
groups.keys.sort_by {|a| a.name}.each do |entry|
+ summary[entry.name]['g']=1
project = ASF::Project[entry.name]
if project
p = []
@@ -36,6 +40,7 @@ end
puts ""
puts "project.owners ~ committee.members"
committees.keys.sort_by {|a| a.name}.each do |entry|
+ summary[entry.name]['c']=1
project = ASF::Project[entry.name]
if project
p = []
@@ -60,7 +65,13 @@ end
puts ""
puts "current podlings(asf-auth) ~ project(members, owners)"
pods = Hash[ASF::Podling.list.map {|podling| [podling.name, podling.status]}]
+# flag current podlings to show what records they have
+pods.each do |name,status|
+ summary[name]['pod'] = status if status == 'current'
+end
+# Scan the local defines and report differences
ASF::Authorization.new('asf').each do |grp, mem|
+ summary[grp]['pod'] = pods[grp] + ' (has local definition)'
if pods[grp] == 'current'
mem.sort!.uniq!
project = ASF::Project[grp]
@@ -82,3 +93,11 @@ ASF::Authorization.new('asf').each do |grp, mem|
end
end
end
+# Show where names are defined
+puts "\nSummary of name definitions (proj,grp,cttee,status)"
+def show(v,k)
+ v[k] == 1 ? k : '-'
+end
+summary.sort.map do |k,v|
+ puts "#{k.ljust(30)} #{show(v,'p')} #{show(v,'g')} #{show(v,'c')} #{v['pod'] rescue ''}"
+end
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].