From 82521aa2b8715d0e324d1fde0b8fa07d84c9d13d Mon Sep 17 00:00:00 2001 From: Shawn Leslie Date: Sat, 25 Apr 2026 19:25:17 -0700 Subject: [PATCH 1/7] add github webhook on error --- .github/workflows/testsPython.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython.yml index 452f71d..e9d76d5 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -69,11 +69,15 @@ jobs: notifications: needs: python-unit-tests runs-on: ubuntu-latest + if: failure() # Only run if tests failed steps: - - name: Notify on test results - run: | - if [ "${{ needs.python-unit-tests.result }}" == "success" ]; then - echo "success notifications go here" - else - echo "failure notifications go here" - fi + - name: Create issue on test failure + uses: actions/github-script@v7 + with: + script: | + github.rest.issues.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title: `🔴 Test Failure - ${new Date().toLocaleDateString()}`, + body: `Python unit tests failed on ${context.ref}\n\nWorkflow: ${context.workflow}\nRun: ${context.runId}` + }) From acb59ac5d19182bf41b487ff23517ba9c09b2982 Mon Sep 17 00:00:00 2001 From: Shawn Leslie Date: Sat, 25 Apr 2026 19:35:25 -0700 Subject: [PATCH 2/7] add permissions --- .github/workflows/testsPython.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython.yml index e9d76d5..4cd4c1e 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -35,6 +35,11 @@ on: env: python-version: "3.13" +permissions: + contents: read + issues: write + pull-requests: write + jobs: # Job #1: Run Python unit tests # @@ -66,7 +71,7 @@ jobs: # This job will run after the Python unit tests and # is scaffolded to facilitate sending notifications based # on the test results. - notifications: + notifications: needs: python-unit-tests runs-on: ubuntu-latest if: failure() # Only run if tests failed @@ -80,4 +85,4 @@ jobs: repo: context.repo.repo, title: `🔴 Test Failure - ${new Date().toLocaleDateString()}`, body: `Python unit tests failed on ${context.ref}\n\nWorkflow: ${context.workflow}\nRun: ${context.runId}` - }) + }) \ No newline at end of file From 7bacf246f14b6f253c10144d7fb31df86406a0a4 Mon Sep 17 00:00:00 2001 From: Shawn Leslie Date: Sat, 25 Apr 2026 19:54:12 -0700 Subject: [PATCH 3/7] add correct indents --- .github/workflows/testsPython.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython.yml index 4cd4c1e..ec63811 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -41,7 +41,7 @@ permissions: pull-requests: write jobs: - # Job #1: Run Python unit tests +# Job #1: Run Python unit tests # # This job will run on an Ubuntu runner and execute the Python # tests by using a custom action located in ./.github/actions/tests/python. @@ -71,7 +71,7 @@ jobs: # This job will run after the Python unit tests and # is scaffolded to facilitate sending notifications based # on the test results. - notifications: + notifications: needs: python-unit-tests runs-on: ubuntu-latest if: failure() # Only run if tests failed From b79527689bd24df1322d14198f85f003f2b9003d Mon Sep 17 00:00:00 2001 From: Shawn Leslie Date: Sat, 25 Apr 2026 20:17:22 -0700 Subject: [PATCH 4/7] try using PR comment --- .github/workflows/testsPython.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython.yml index ec63811..66ab1f3 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -76,13 +76,25 @@ jobs: runs-on: ubuntu-latest if: failure() # Only run if tests failed steps: - - name: Create issue on test failure + - name: Comment on PR with failure details uses: actions/github-script@v7 with: script: | - github.rest.issues.create({ + const prNumber = context.payload.pull_request.number; + + await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, - title: `🔴 Test Failure - ${new Date().toLocaleDateString()}`, - body: `Python unit tests failed on ${context.ref}\n\nWorkflow: ${context.workflow}\nRun: ${context.runId}` - }) \ No newline at end of file + issue_number: prNumber, + body: `🔴 **Unit Tests Failed** + + Something broke in this PR. + + **Details:** + - Workflow: ${context.workflow} + - Branch: ${context.ref} + - Run ID: ${context.runId} + + 🔎 View logs: + https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}` + }); \ No newline at end of file From 069dca6268a86d1df35d901e80d438e35bbbd1ed Mon Sep 17 00:00:00 2001 From: Shawn Leslie Date: Sat, 25 Apr 2026 20:30:48 -0700 Subject: [PATCH 5/7] test: PR notification flow --- .github/workflows/testsPython.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython.yml index 66ab1f3..8a18a49 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -86,7 +86,7 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, issue_number: prNumber, - body: `🔴 **Unit Tests Failed** + body: `🔴 **Unit Tests Failed!** Something broke in this PR. From 8b3ba7fe82718bcb628ff986d34c63551f1b2c2f Mon Sep 17 00:00:00 2001 From: Shawn Leslie Date: Sat, 25 Apr 2026 20:38:20 -0700 Subject: [PATCH 6/7] test: PR notification flow --- .github/workflows/testsPython.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython.yml index 8a18a49..4b59c38 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -86,7 +86,7 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, issue_number: prNumber, - body: `🔴 **Unit Tests Failed!** + body: `🔴 **Unit Tests Failed!!!!!** Something broke in this PR. From 99dc1fc358ab63b14635fff4e52fa149f0305562 Mon Sep 17 00:00:00 2001 From: Shawn Leslie Date: Sat, 25 Apr 2026 20:50:40 -0700 Subject: [PATCH 7/7] test: PR notification flow --- app/agent.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/agent.py b/app/agent.py index 04feb23..d3f668b 100644 --- a/app/agent.py +++ b/app/agent.py @@ -18,6 +18,8 @@ def main(prompts: Optional[Tuple[str, ...]] = None) -> None: print("Stackademy User Registration Demo") print("=" * 50) + assert False + i = 0 user_prompt = prompts[i] if prompts else input("Welcome to Stackademy! How can I assist you today? ")