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: Try to include more snapshot context
Date Tue, 04 May 2021 11:20:43 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 d2a8ecd  Try to include more snapshot context
d2a8ecd is described below

commit d2a8ecddec28a39c0e45f8ff16cc5b659375799a
Author: Sebb <sebb@apache.org>
AuthorDate: Tue May 4 12:20:36 2021 +0100

    Try to include more snapshot context
---
 tools/download_check.rb | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/tools/download_check.rb b/tools/download_check.rb
index b87e8ec..d5cf562 100755
--- a/tools/download_check.rb
+++ b/tools/download_check.rb
@@ -377,9 +377,18 @@ def _checkDownloadPage(path, tlp, version)
   end
 
   # Some pages are mainly a single line (e.g. Hop)
-  # This make matching the appropriate match context tricky
-  body.scan(%r{[^<>]+?(nightly|snapshot)[^<>]+?}i) do |m|
-    E "Found reference to NIGHTLY or SNAPSHOT builds: #{m.first.strip}"
+  # This make matching the appropriate match context tricky without traversing the DOM
+  body.scan(%r{(^.*?([^<>]+?(nightly|snapshot)[^<>]+?)).*$}i) do |m|
+    m.each do |n|
+        if n.size < 160
+            if n =~ %r{-docs-} # snapshot docs (Flink)?
+                W "Found reference to NIGHTLY or SNAPSHOT builds: #{n}"
+            else
+                E "Found reference to NIGHTLY or SNAPSHOT builds: #{n}"
+            end
+            break
+        end
+    end
   end
 
   if body.include? 'dist.apache.org'

Mime
View raw message