]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
mailbot: Skip upstream commit warnings for stable-only patches
authorSasha Levin <sashal@kernel.org>
Mon, 14 Jul 2025 16:26:13 +0000 (12:26 -0400)
committerSasha Levin <sashal@kernel.org>
Mon, 14 Jul 2025 16:27:44 +0000 (12:27 -0400)
When a commit message contains "stable-only" or "stable only", it indicates
that the patch is specifically created for stable branches and doesn't have
a corresponding upstream commit. In these cases, the mailbot should not warn
about being unable to find the commit upstream.

Suggested-by: Borislav Petkov <bp@alien8.de>
Pinky-sworn-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
scripts/mailbot.sh

index 6c1b34e14f8f4d8f5d5f389518ddfed26a966358..26a3046c06c1d1515dfeb455b7855cfa7792b8fe 100755 (executable)
@@ -1215,6 +1215,13 @@ generate_response() {
     local revert_results="${10}"
     local response_file=$(generate_response_filename "$mbox_file")
 
+    # Check if this is a stable-only commit
+    local email_body=$(formail -I "" < "$mbox_file")
+    local is_stable_only=0
+    if echo "$email_body" | grep -i "stable.only" >/dev/null 2>&1; then
+        is_stable_only=1
+    fi
+
     {
         # Get the From, Subject, Message-ID, and Date from original email for threading
         formail -X From: -X Subject: < "$mbox_file"
@@ -1256,16 +1263,18 @@ generate_response() {
             summary+=("❌ Build failures detected")
         fi
 
-        # Check for missing or unverified commit
-        if [ -z "$found_sha1" ] || [ "$found_sha1" = "0000000000000000000000000000000000000000" ]; then
-            has_issues=1
-            summary+=("⚠️ Could not find matching upstream commit")
-        elif [ -n "$claimed_sha1" ] && [ "$claimed_sha1" != "$found_sha1" ]; then
-            has_issues=1
-            summary+=("⚠️ Provided upstream commit SHA1 does not match found commit")
-        elif [ -z "$claimed_sha1" ] && [ -n "$found_sha1" ]; then
-            has_issues=1
-            summary+=("⚠️ Found matching upstream commit but patch is missing proper reference to it")
+        # Check for missing or unverified commit (skip for stable-only commits)
+        if [ $is_stable_only -eq 0 ]; then
+            if [ -z "$found_sha1" ] || [ "$found_sha1" = "0000000000000000000000000000000000000000" ]; then
+                has_issues=1
+                summary+=("⚠️ Could not find matching upstream commit")
+            elif [ -n "$claimed_sha1" ] && [ "$claimed_sha1" != "$found_sha1" ]; then
+                has_issues=1
+                summary+=("⚠️ Provided upstream commit SHA1 does not match found commit")
+            elif [ -z "$claimed_sha1" ] && [ -n "$found_sha1" ]; then
+                has_issues=1
+                summary+=("⚠️ Found matching upstream commit but patch is missing proper reference to it")
+            fi
         fi
 
         # Check for fixes
@@ -1312,7 +1321,9 @@ generate_response() {
         fi
 
         # Report on SHA1 verification and commit status
-        if [ -n "$claimed_sha1" ]; then
+        if [ $is_stable_only -eq 1 ]; then
+            echo "Note: This is a stable-only commit."
+        elif [ -n "$claimed_sha1" ]; then
             if [ "$claimed_sha1" = "$found_sha1" ]; then
                 echo "The upstream commit SHA1 provided is correct: $claimed_sha1"
                 if [ -n "$author_mismatch" ]; then