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: Add incubator disclaimer checks
Date Tue, 12 May 2020 12:52:47 GMT
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 b388ac2  Add incubator disclaimer checks
b388ac2 is described below

commit b388ac2b415bfa7403172ae25f9116b2fea345ef
Author: Sebb <sebb@apache.org>
AuthorDate: Tue May 12 13:52:35 2020 +0100

    Add incubator disclaimer checks
---
 tools/download_check.rb | 40 ++++++++++++++++++++++++++++++++++------
 1 file changed, 34 insertions(+), 6 deletions(-)

diff --git a/tools/download_check.rb b/tools/download_check.rb
index 8d42e99..e67c0bb 100755
--- a/tools/download_check.rb
+++ b/tools/download_check.rb
@@ -8,6 +8,8 @@ Note: the GUI interface is currently at www/members/download_check.cgi
 
 =end
 
+$LOAD_PATH.unshift '/srv/whimsy/lib'
+require 'whimsy/asf'
 require 'wunderbar'
 require 'net/http'
 require 'nokogiri'
@@ -245,6 +247,7 @@ VERIFY_TEXT = [
  'www.apache.org/info/verification.html',
  'verify your mirrored downloads',
  'verify your downloads',
+ 'verify the downloaded files',
  'All downloads should be verified',
  'verification instructions',
  ' encouraged to verify ',
@@ -260,6 +263,20 @@ ALIASES = {
     'gpg signature' => 'asc',
     'openpgp signature' => 'asc',
 }
+
+# Need to be able to check if download is for a PMC or podling
+# parameter is the website URL
+# Also want to convert site to TLP
+URL2TLP = Hash.new # URL host to TLP conversion
+URL2TLP['jspwiki-wiki'] = 'jspwiki' # https://jspwiki-wiki.apache.org/Wiki.jsp?page=Downloads
+PMCS = Set.new # is this a TLP?
+ASF::Committee.pmcs.map do |p| 
+    site = p.site[%r{//(.+?)\.apache\.org},1]
+    name = p.name
+    URL2TLP[site] = name unless site == name
+    PMCS << name
+end
+
 # Convert text reference to extension
 # e.g. SHA256 => sha256; [SIG] => asc
 def text2ext(txt)
@@ -283,10 +300,11 @@ def checkDownloadPage(path, tlp, version)
 end
 
 def _checkDownloadPage(path, tlp, version)
+  isTLP = PMCS.include? tlp
   if version != ''
-    I "Checking #{path} [#{tlp}] for version #{version} only ..."
+    I "Checking #{path} [#{tlp}] TLP #{isTLP} for version #{version} only ..."
   else
-    I "Checking #{path} [#{tlp}] ..."
+    I "Checking #{path} [#{tlp}] TLP #{isTLP} ..."
   end
 
   # check the main body
@@ -302,6 +320,18 @@ def _checkDownloadPage(path, tlp, version)
   
   return unless body
 
+  hasDisclaimer = body.include? 'Incubation is required of all newly accepted'
+
+  if isTLP
+     W "#{tlp} has Incubator disclaimer" if hasDisclaimer
+  else
+     if hasDisclaimer
+       I "#{tlp} has Incubator disclaimer"
+     else
+       E "#{tlp} does not have Incubator disclaimer"
+     end
+  end
+
   if body.include? 'dist.apache.org'
     E 'Page must not link to dist.apache.org'
   else
@@ -551,11 +581,9 @@ def _checkDownloadPage(path, tlp, version)
 
 end
 
-def getTLP(url)
+def getTLP(url) # convert URL to TLP/podling
   if url =~ %r{^https?://([^.]+)(\.incubator|\.us|\.eu)?\.apache\.org/}
-     tlp = $1
-     tlp = 'httpcomponents' if tlp == 'hc'
-     tlp = 'jspwiki' if tlp == 'jspwiki-wiki' # https://jspwiki-wiki.apache.org/Wiki.jsp?page=Downloads
+     tlp = URL2TLP[$1] || $1
   elsif url =~ %r{^https?://([^.]+)\.openoffice\.org/}
      tlp = 'openoffice'
   else


Mime
View raw message