incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject svn commit: r1855463 - /incubator/public/trunk/clutch2status.py
Date Thu, 14 Mar 2019 00:28:32 GMT
Author: wave
Date: Thu Mar 14 00:28:32 2019
New Revision: 1855463

URL: http://svn.apache.org/viewvc?rev=1855463&view=rev
Log:
closer to ready for testing. Better organization and html produced by ad files should be compact
and super helpful.

Modified:
    incubator/public/trunk/clutch2status.py

Modified: incubator/public/trunk/clutch2status.py
URL: http://svn.apache.org/viewvc/incubator/public/trunk/clutch2status.py?rev=1855463&r1=1855462&r2=1855463&view=diff
==============================================================================
--- incubator/public/trunk/clutch2status.py (original)
+++ incubator/public/trunk/clutch2status.py Thu Mar 14 00:28:32 2019
@@ -7,42 +7,64 @@ import datetime
 various output data files.
 '''
 
-NO_RELEASES = "- {0} has KEYS and either no or invalid releases"
+NO_RELEASES = "{0} has Signing Keys with either no or invalid releases"
 
 messages = {
-    '00':('/helper/bootstrap','podling','Duplicate entry in podlings.xml'),
-    '01':('/helper/bootstrap','authorization','No project LDAP'),
-    '02':('/helper/bootstrap','podling','Project metadata missing in content/podlings.xml'),
-    '05':('/helper/bootstrap','reporting','Reporting group is either missing or a multiple'),
-    '06':('/helper/bootstrap','reporting','Reporting group is missing'),
-    '07':('/helper/bootstrap','statusfile','Status file is missing'),
-    '08':('/helper/bootstrap','startdate','Start date is not a valid date'),
-    '14':('/helper/bootstrap','email',	'Expected mailing list (incubator-{0}-{1}) is missing'),
-    '15':('/helper/bootstrap','devlist',"Project does not have 'dev' mailing list"),
-    '16':('/helper/bootstrap','commitslist',"Project does not have 'commits' mailing list"),
-    '17':('/helper/resources','coderepository','No source code repository'),
-    '10':('/helper/resources','tracker','Project is missing its link to an Issue Tracker'),
-    '11':('/helper/resources','website','Website is missing'),
-    '12':('/helper/release','dist',	'Release distribution area is not setup'),
-    '13':('/helper/release','keys',	'Release signing PGP KEYS file is missing'),
-    '41':('/helper/release','first',	'PGP KEYS file available without a distribution'),
-    '42':('/helper/release','name',	'Distribution is missing incubator/incubating in file
name {0}'),
-    '43':('/helper/release','hash',	'Signed distribution without a hash'),
-    '44':('/helper/release','signature','Unsigned distributions'),
-    '45':('/helper/release','archive',  '{0} is a large number of releases. Only current
releases on current branches should be on dist.'),
-    '31':('/helper/website','asf',   	'ASF Foundation link is missing'),
-    '32':('/helper/website','events',	'ASF Events link is missing'),
-    '33':('/helper/website','license',	'Apache License link is missing'),
-    '34':('/helper/website','thanks',	'Apache Thanks link is missing'),
-    '35':('/helper/website','security','Apache Security link is missing'),
-    '36':('/helper/website','sponsorship','Apache Sponsorship link is missing'),
-    '37':('/helper/website','trademark', 'Trademarks are missing'),
-    '38':('/helper/website','copyright', 'Copyright is missing'),
-    '39':('/helper/website','disclaimer','Disclaimer is missing'),
-    '03':('/helper/exit','graduated',	'Graduated, but some graduation steps are incomplete'),
-    '04':('/helper/exit','retired',	'Retired, but some retirement steps are incomplete')
+    '00':('/helper/bootstrap','podling','Duplicate entry in podlings.xml',True),
+    '01':('/helper/bootstrap','authorization','No project LDAP',True),
+    '02':('/helper/bootstrap','podling','Project metadata missing in content/podlings.xml',True),
+    '05':('/helper/bootstrap','reporting','Reporting group is either missing or a multiple',True),
+    '06':('/helper/bootstrap','reporting','Reporting group is missing',True),
+    '07':('/helper/bootstrap','statusfile','Status file is missing',True),
+    '08':('/helper/bootstrap','startdate','Start date is not a valid date',True),
+    '14':('/helper/bootstrap','email',	'Expected mailing list (incubator-{0}-{1}) is missing',False),
+    '15':('/helper/bootstrap','devlist',"Project does not have 'dev' mailing list",True),
+    '16':('/helper/bootstrap','commitslist',"Project does not have 'commits' mailing list",False),
+    '17':('/helper/resources','coderepository','No source code repository',False),
+    '10':('/helper/resources','tracker','Project is missing its link to an Issue Tracker',False),
+    '18':('/helper/resources','wiki','Project is missing its link to a Wiki',False),
+    '11':('/helper/resources','website','Website is missing',False),
+    '12':('/helper/release','dist',	'Release distribution area is not setup',False),
+    '13':('/helper/release','keys',	'Release signing PGP KEYS file is missing',False),
+    '41':('/helper/release','first',	'PGP KEYS file available without a distribution',False),
+    '42':('/helper/release','name',	'Distribution is missing incubator/incubating in file
name {0}',False),
+    '43':('/helper/release','hash',	'Signed distribution without a hash',True),
+    '44':('/helper/release','signature','Unsigned distributions',True),
+    '45':('/helper/release','archive',  '{0} is a large number of releases. Only current
releases on current branches should be on dist.',False),
+    '46':('/helper/release','keys',     'Apache Releases cannot be validated without a KEYS
file.',True),
+    '31':('/helper/website','asf',   	'ASF Foundation link is missing',False),
+    '32':('/helper/website','events',	'ASF Events link is missing',False),
+    '33':('/helper/website','license',	'Apache License link is missing',False),
+    '34':('/helper/website','thanks',	'Apache Thanks link is missing',False),
+    '35':('/helper/website','security','Apache Security link is missing',False),
+    '36':('/helper/website','sponsorship','Apache Sponsorship link is missing',False),
+    '37':('/helper/website','trademark', 'Trademarks are missing',False),
+    '38':('/helper/website','copyright', 'Copyright is missing',False),
+    '39':('/helper/website','disclaimer','Disclaimer is missing',False)
+    #'03':('/helper/exit','graduated',	'Graduated, but some graduation steps are incomplete'),
+    #'04':('/helper/exit','retired',	'Retired, but some retirement steps are incomplete')
 }
 
+def humanbytes(B):
+   'Return the given bytes as a human friendly KB, MB, GB, or TB string'
+   B = float(B)
+   KB = float(1024)
+   MB = float(KB ** 2) # 1,048,576
+   GB = float(KB ** 3) # 1,073,741,824
+   TB = float(KB ** 4) # 1,099,511,627,776
+
+   if B < KB:
+      return '{0} {1}'.format(B,'Bytes')
+   elif KB <= B < MB:
+      return '{0:.2f} KB'.format(B/KB)
+   elif MB <= B < GB:
+      return '{0:.2f} MB'.format(B/MB)
+   elif GB <= B < TB:
+      return '{0:.2f} GB'.format(B/GB)
+   elif TB <= B:
+      return '{0:.2f} TB'.format(B/TB)
+
+
 inputFile = open('clutch.pkl', 'rb')
 projects = pickle.load(inputFile)
 inputFile.close()
@@ -60,8 +82,9 @@ for k in projects:
     print("",file=f)
     if projects[k]['sponsor'] != "Incubator":
         print(projects[k]['sponsor'],file=f)
+    print("",file=f)
     print(" ".join(projects[k]['description'].split()),file=f)
-
+    print("",file=f)
     print("- Resources: "+projects[k]['resource'],file=f)
     print("- Started: "+projects[k]['startDate']+"; Last Status Update: "+projects[k]['statusLastUpdated'],file=f)
     if projects[k]['reportingMonthly']:
@@ -74,20 +97,26 @@ for k in projects:
     else:
         print("- PPMC members: "+str(projects[k]['numberPMCMembers']),file=f)
     mentors = "- Mentors: "
-    for m in projects[k]['mentors']:
-        mentors += m+", "
+    for m in projects[k]['mentorsApacheId']:
+        mentors += "{0} ({1}), ".format(m[0],m[1])
     print(mentors[:-2],file=f)
+    print("",file=f)
 
     if len(projects[k]['news']) > 0:
         print("== News",file=f)
+        print("",file=f)
         for news in projects[k]['news']:
             print("- {0}".format(news),file=f)
+        print("",file=f)
 
     if len(projects[k]['urlWww']) > 0:
         print("== Project Website",file=f)
-        print("- {0}".format(projects[k]['urlWww']),file=f)
+        print("",file=f)
+        print("{0}".format(projects[k]['urlWww']),file=f)
+        print("",file=f)
 
     print("== Mailing Lists",file=f)
+    print("",file=f)
     if len(projects[k]['hasMailListDev']) > 0:
         print("- Developer mailing list: {0}".format(projects[k]['hasMailListDev']),file=f)
     else:
@@ -96,19 +125,31 @@ for k in projects:
         print("- Commits mailing list: {0}".format(projects[k]['hasMailListCommits']),file=f)
     else:
         print("- No commits mailing list",file=f)
+    print("",file=f)
 
     if len(projects[k]['urlTracker']) > 0:
         print("== Issue Tracker",file=f)
-        print("- {0}".format(projects[k]['urlTracker']),file=f)
+        print("",file=f)
+        print("{0}".format(projects[k]['urlTracker']),file=f)
+        print("",file=f)
+
+    if len(projects[k]['urlWiki']) > 0:
+        print("== Wiki",file=f)
+        print("",file=f)
+        print("{0}".format(projects[k]['urlWiki']),file=f)
+        print("",file=f)
 
     print("== Repositories",file=f)
+    print("",file=f)
     lsvn = len(projects[k]['urlSvn'])
     if lsvn > 0:
-        print("- Subversion: "+projects[k]['urlSvn'],file=f)
+        print("{0}[Subversion]".format(projects[k]['urlSvn']),file=f)
+        print("",file=f)
     i = len(projects[k]['urlGit'])
     j = len(projects[k]['gitbox'])
     if i > 0 and j == 0:
-        print("- Git: "+projects[k]['urlGit'],file=f)
+        print("{0}[Git]".format(projects[k]['urlGit']),file=f)
+        print("",file=f)
     elif j > 0:
         jj = 0
         for l in projects[k]['gitbox']:
@@ -120,46 +161,61 @@ for k in projects:
             last_update = str(l[1]['last_update_txt'])
             gitdate = datetime.datetime.fromtimestamp(l[1]['last_update_int']).strftime('%m/%d/%Y')
             repos = l[0]
-            print("=== {0}: {1}; Commits: {2}; Updated: {3}".format(jj,desc,commits,gitdate),file=f)
-            print("- Gitbox: {0}{1}{2}".format("https://gitbox.apache.org/repos/asf?p=",repos,".git;a=tree;hb=HEAD"),file=f)
-            print("- Github: {0}{1}/".format("https://github.com/apache/",repos),file=f)
+            print("=== {0}: {1}".format(jj,repos),file=f)
+            print("",file=f)
+            print("{0}{1}{2}[Gitbox] {3}{4}/[Github] {5}".format(
+                  "https://gitbox.apache.org/repos/asf?p=",repos,".git;a=tree;hb=HEAD",
+                  "https://github.com/apache/",repos,desc),file=f)
+            print("- Commits: {0}".format(commits),file=f)
+            print("- Updated: {0}".format(gitdate),file=f)
+            print("",file=f)
 
     print("== Current Releases",file=f)
+    print("",file=f)
     hasKeys = False
     url1 = projects[k]['urlKeys']
     if len(url1) > 0:
         hasKeys = True
-        print("- Keys: "+url1,file=f)
+        print("{0}[Signing Keys]".format(url1),file=f)
         url1 = "/".join(url1.split("/")[:-1])+"/"
     else:
-        print("- *No PGP KEYS*",file=f)
+        print("*No PGP Signing Keys*",file=f)
     url2 = projects[k]['urlDist']
-    jj = 0 
+    jj = 0
+    fsize = 0
     if len(url2) > 0 and hasKeys:
-        l = len(projects[k]['distributions']) 
-        j = len(projects[k]['distribHash']) 
-        if l > 0 and j == l:
-            for l in projects[k]['distributions']:
-                kk = projects[k]['distribHash'][jj]
-                r = ".".join(l.split(".")[:-1])
-                rr = "".join(r.split("/")[-1:])
-                jj += 1
-                print("=== {0}: {1}".format(jj,rr),file=f)
-                print("- Download:  {0}{1}".format(url2,r),file=f)
-                print("- Signature: {0}{1}".format(url1,l),file=f)
-                print("- Hash:      {0}{1}".format(url1,kk),file=f)
-        elif l > 0 and j != l:
-            print("- Number of release hashes ({0}) and signatures ({0}) are mismatched".format(j,k),file=f)
-        else:
-            print(NO_RELEASES.format(projects[k]['fullName']),file=f)
+        j = 1
+        for r in projects[k]['releases']:
+            print("",file=f)
+            print("=== {0}: {1}".format(j,r),file=f)
+            print("",file=f)
+            print("{0}[Download] {1}[Signature] {2}[Hash] {3}".format(
+                  projects[k]['releases'][r]['download'],
+                  projects[k]['releases'][r]['signature'],
+                  projects[k]['releases'][r]['hash'],r),file=f)
+            print("- Filesize: {0}".format(humanbytes(float(projects[k]['releases'][r]['size']))),file=f)
+            print("- Released: {0} by {1} in {2}".format(
+                  projects[k]['releases'][r]['dtm'],
+                  projects[k]['releases'][r]['user'],
+                  projects[k]['releases'][r]['revision']),file=f)
+            j += 1
+            fsize += int(projects[k]['releases'][r]['size'])
+        print("",file=f)
+        print("Total size of all downloads = {0}".format(humanbytes(float(fsize))),file=f)
     elif hasKeys:
         print(NO_RELEASES.format(projects[k]['fullName']),file=f)
+    print("",file=f)
 
     if len(projects[k]['fixMeList']) > 0:
         print("== Errata",file=f)
+        print("",file=f)
         print("Please investigate the following potential issues",file=f)
-    for l in projects[k]['fixMeList']:
-        err = l[0:2]
-        msg = messages[err]
-        print("- "+msg[0]+".html#"+msg[1]+"("+l[3:]+")",file=f)
+        print("",file=f)
+        for l in projects[k]['fixMeList']:
+           msg = messages[l[0]]
+           if msg[3]:
+              print("- link:"+msg[0]+".html#"+msg[1]+"[*"+l[1]+"*]",file=f)
+           else:
+              print("- link:"+msg[0]+".html#"+msg[1]+"["+l[1]+"]",file=f)
+    print("",file=f)
     f.close();



---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message