You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bn...@apache.org on 2026/04/08 18:17:07 UTC

(trafficserver-ci) branch main updated: Handle RAT 0.13 and 0.17 output (#423)

This is an automated email from the ASF dual-hosted git repository.

bneradt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/trafficserver-ci.git


The following commit(s) were added to refs/heads/main by this push:
     new 83a823f  Handle RAT 0.13 and 0.17 output (#423)
83a823f is described below

commit 83a823fbc25aabfc838397b44ac8a514e732731e
Author: Brian Neradt <br...@gmail.com>
AuthorDate: Wed Apr 8 13:17:02 2026 -0500

    Handle RAT 0.13 and 0.17 output (#423)
    
    This updates the RAT job checks to accept the old 0.13 summary
    format and the new 0.17 summary format. The selection is based on
    whether the checked-out Traffic Server tree includes ci/apache-rat-0.17.jar.
    
    This also passes the RAT output path into the helper explicitly so the
    validation logic is clearer while ATS rolls forward to RAT 0.17.
---
 jenkins/bin/rat.sh          | 17 ++++++++++++++---
 jenkins/github/rat.pipeline | 16 ++++++++++++++--
 2 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/jenkins/bin/rat.sh b/jenkins/bin/rat.sh
index 636787d..c1b745e 100755
--- a/jenkins/bin/rat.sh
+++ b/jenkins/bin/rat.sh
@@ -24,11 +24,22 @@ WORKSPACE="${WORKSPACE:-..}"
 cd "${WORKSPACE}/src"
 export PATH=/opt/bin:$PATH
 
+check_rat_output() {
+  local rat_output=$1
+
+  if [ -f ci/apache-rat-0.17.jar ]; then
+    grep -Eq '^INFO:[[:space:]]+Unapproved:[[:space:]]+0$' "${rat_output}" || return 1
+    grep -Eq '^INFO:[[:space:]]+Unknown:[[:space:]]+0$' "${rat_output}" || return 1
+  else
+    grep '^0 Unknown Licenses' "${rat_output}" >/dev/null || return 1
+  fi
+}
+
 if [ -d cmake ]
 then
 
   cmake -B builder
-  cmake --build builder --target rat
+  cmake --build builder --target rat | tee RAT.txt
 
 else
 
@@ -39,9 +50,9 @@ else
   rm -f lib/ts/stamp-h1
 
   ${ATS_MAKE} rat | tee RAT.txt
-  grep '^0 Unknown Licenses' RAT.txt >/dev/null || exit 1
-
 fi
+
+check_rat_output RAT.txt || exit 1
 #mv RAT.txt /CA/RAT/rat-${ATS_BRANCH}.txt.new
 #mv /CA/RAT/rat-${ATS_BRANCH}.txt.new /CA/RAT/rat-${ATS_BRANCH}.txt
 
diff --git a/jenkins/github/rat.pipeline b/jenkins/github/rat.pipeline
index 6168087..a8329f8 100644
--- a/jenkins/github/rat.pipeline
+++ b/jenkins/github/rat.pipeline
@@ -62,6 +62,18 @@ pipeline {
                         set -e
 
                         export PATH=/opt/bin:$PATH
+                        check_rat_output() {
+                            rat_output=$1
+
+                            if [ -f ci/apache-rat-0.17.jar ]
+                            then
+                                grep -Eq '^INFO:[[:space:]]+Unapproved:[[:space:]]+0$' "${rat_output}" || return 1
+                                grep -Eq '^INFO:[[:space:]]+Unknown:[[:space:]]+0$' "${rat_output}" || return 1
+                            else
+                                grep '^0 Unknown Licenses' "${rat_output}" > /dev/null || return 1
+                            fi
+                        }
+
                         if [ -d cmake ]
                         then
                             cmake -B build
@@ -75,8 +87,8 @@ pipeline {
                             make rat | tee RAT.txt
                         fi
 
-                        # Mark as failed if there are any unknown licenses
-                        grep '^0 Unknown Licenses' RAT.txt > /dev/null || exit -1
+                        # Mark as failed if RAT reports unapproved or unknown files.
+                        check_rat_output RAT.txt || exit -1
 
                         exit 0
                     '''