public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ v1 2/3] github: Make result posting robust against action failures
Date: Wed, 15 Apr 2026 14:22:08 -0400	[thread overview]
Message-ID: <20260415182210.514686-2-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20260415182210.514686-1-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

Use always() conditions with file-existence checks so steps 1-4
results are posted even if the btsnoop-analyzer action fails
partway through. The error comment now only fires on actual action
failure (e.g. btmon build error), not LLM errors which are handled
gracefully by the analyzer.
---
 .github/workflows/btsnoop-analyzer.yml | 34 +++++++++++++++++---------
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/btsnoop-analyzer.yml b/.github/workflows/btsnoop-analyzer.yml
index 3bbd963004cb..9ecda193ceff 100644
--- a/.github/workflows/btsnoop-analyzer.yml
+++ b/.github/workflows/btsnoop-analyzer.yml
@@ -100,12 +100,14 @@ jobs:
           GH_MODELS_TOKEN: ${{ secrets.GH_MODELS_TOKEN }}
 
       - name: Post detection comment
-        if: steps.parse.outputs.found == 'true' && success()
+        if: always() && steps.parse.outputs.found == 'true' && steps.analysis.outcome != 'skipped'
         uses: actions/github-script@v7
         with:
           script: |
             const fs = require('fs');
-            const detect = fs.readFileSync('${{ steps.analysis.outputs.detect }}', 'utf8');
+            const path = '${{ steps.analysis.outputs.detect }}';
+            if (!fs.existsSync(path)) return;
+            const detect = fs.readFileSync(path, 'utf8');
             await github.rest.issues.createComment({
               owner: context.repo.owner,
               repo: context.repo.repo,
@@ -114,12 +116,14 @@ jobs:
             });
 
       - name: Post filter comment
-        if: steps.parse.outputs.found == 'true' && success()
+        if: always() && steps.parse.outputs.found == 'true' && steps.analysis.outcome != 'skipped'
         uses: actions/github-script@v7
         with:
           script: |
             const fs = require('fs');
-            const filter = fs.readFileSync('${{ steps.analysis.outputs.filter }}', 'utf8');
+            const path = '${{ steps.analysis.outputs.filter }}';
+            if (!fs.existsSync(path)) return;
+            const filter = fs.readFileSync(path, 'utf8');
             await github.rest.issues.createComment({
               owner: context.repo.owner,
               repo: context.repo.repo,
@@ -128,12 +132,14 @@ jobs:
             });
 
       - name: Post annotation comment
-        if: steps.parse.outputs.found == 'true' && success()
+        if: always() && steps.parse.outputs.found == 'true' && steps.analysis.outcome != 'skipped'
         uses: actions/github-script@v7
         with:
           script: |
             const fs = require('fs');
-            const annotate = fs.readFileSync('${{ steps.analysis.outputs.annotate }}', 'utf8');
+            const path = '${{ steps.analysis.outputs.annotate }}';
+            if (!fs.existsSync(path)) return;
+            const annotate = fs.readFileSync(path, 'utf8');
             await github.rest.issues.createComment({
               owner: context.repo.owner,
               repo: context.repo.repo,
@@ -142,12 +148,14 @@ jobs:
             });
 
       - name: Post diagnostics comment
-        if: steps.parse.outputs.found == 'true' && success()
+        if: always() && steps.parse.outputs.found == 'true' && steps.analysis.outcome != 'skipped'
         uses: actions/github-script@v7
         with:
           script: |
             const fs = require('fs');
-            const diagnose = fs.readFileSync('${{ steps.analysis.outputs.diagnose }}', 'utf8');
+            const path = '${{ steps.analysis.outputs.diagnose }}';
+            if (!fs.existsSync(path)) return;
+            const diagnose = fs.readFileSync(path, 'utf8');
             await github.rest.issues.createComment({
               owner: context.repo.owner,
               repo: context.repo.repo,
@@ -156,12 +164,14 @@ jobs:
             });
 
       - name: Post analysis comment
-        if: steps.parse.outputs.found == 'true' && success()
+        if: always() && steps.parse.outputs.found == 'true' && steps.analysis.outcome != 'skipped'
         uses: actions/github-script@v7
         with:
           script: |
             const fs = require('fs');
-            const analysis = fs.readFileSync('${{ steps.analysis.outputs.analyze }}', 'utf8');
+            const path = '${{ steps.analysis.outputs.analyze }}';
+            if (!fs.existsSync(path)) return;
+            const analysis = fs.readFileSync(path, 'utf8');
 
             const footer = `\n\n---\n<sub>Analyzed by [btsnoop-analyzer](https://github.com/Vudentz/btsnoop-analyzer) using btmon from [BlueZ](https://github.com/bluez/bluez). MAC addresses ${
               '${{ steps.parse.outputs.anonymize }}' === 'true'
@@ -177,7 +187,7 @@ jobs:
             });
 
       - name: Post error comment
-        if: steps.parse.outputs.found == 'true' && failure()
+        if: always() && steps.parse.outputs.found == 'true' && steps.analysis.outcome == 'failure'
         uses: actions/github-script@v7
         with:
           script: |
@@ -190,7 +200,7 @@ jobs:
             The automated analysis encountered an error. This could be due to:
             - Unsupported trace file format
             - Trace file too large to process
-            - LLM API rate limiting or downtime
+            - btmon build failure
 
             A maintainer will review your trace manually.
 
-- 
2.53.0


  reply	other threads:[~2026-04-15 18:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-15 18:22 [PATCH BlueZ v1 1/3] github: Add YAML issue template and btsnoop-analyzer workflow Luiz Augusto von Dentz
2026-04-15 18:22 ` Luiz Augusto von Dentz [this message]
2026-04-15 18:22 ` [PATCH BlueZ v1 3/3] github: Add btsnoop-analyzer slash command workflow Luiz Augusto von Dentz
2026-04-16 17:30 ` [PATCH BlueZ v1 1/3] github: Add YAML issue template and btsnoop-analyzer workflow patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260415182210.514686-2-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox