From 82521aa2b8715d0e324d1fde0b8fa07d84c9d13d Mon Sep 17 00:00:00 2001 From: Shawn Leslie Date: Sat, 25 Apr 2026 19:25:17 -0700 Subject: [PATCH 01/11] 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 02/11] 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 03/11] 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 04/11] 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 05/11] 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 06/11] 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 07/11] 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? ") From 915bee064d63d2058f8fa672577b7ae97b213f7a Mon Sep 17 00:00:00 2001 From: Shawn Leslie Date: Sun, 26 Apr 2026 17:13:51 -0700 Subject: [PATCH 08/11] Revert "Merge pull request #3 from leslieshawn/test-notifications3" This reverts commit 9a6330862b6fd35b2a32f1468f7607cc3fe9f16a, reversing changes made to c3ed3178f553e4cb83eee049eb46532c63bb1b73. --- app/agent.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/agent.py b/app/agent.py index d3f668b..04feb23 100644 --- a/app/agent.py +++ b/app/agent.py @@ -18,8 +18,6 @@ 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? ") From 536199748f026918dd0997e9461fe20168d6acfd Mon Sep 17 00:00:00 2001 From: Shawn Leslie Date: Sun, 26 Apr 2026 17:14:22 -0700 Subject: [PATCH 09/11] Revert "Merge pull request #2 from leslieshawn/test-notifications2" This reverts commit c3ed3178f553e4cb83eee049eb46532c63bb1b73, reversing changes made to b79527689bd24df1322d14198f85f003f2b9003d. --- .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 4b59c38..66ab1f3 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 423220750b5b7bf930319656d70451b02d279c39 Mon Sep 17 00:00:00 2001 From: Shawn Leslie Date: Sun, 26 Apr 2026 17:23:24 -0700 Subject: [PATCH 10/11] revert: restore Python tests workflow to known good state --- .github/workflows/testsPython.yml | 37 +++++++------------------------ 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython.yml index 66ab1f3..452f71d 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -35,13 +35,8 @@ on: env: python-version: "3.13" -permissions: - contents: read - issues: write - 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. @@ -74,27 +69,11 @@ jobs: notifications: needs: python-unit-tests runs-on: ubuntu-latest - if: failure() # Only run if tests failed steps: - - name: Comment on PR with failure details - uses: actions/github-script@v7 - with: - script: | - const prNumber = context.payload.pull_request.number; - - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - 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 + - 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 From 846e2e8d62826ab7cca0b4785c0842dd43ed4833 Mon Sep 17 00:00:00 2001 From: Shawn Leslie Date: Sun, 26 Apr 2026 18:05:01 -0700 Subject: [PATCH 11/11] fix: update Python tests workflow to add Pull Request notices --- .github/workflows/testsPython.yml | 37 ++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython.yml index 452f71d..4b59c38 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -35,8 +35,13 @@ on: env: python-version: "3.13" +permissions: + contents: read + issues: write + 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. @@ -69,11 +74,27 @@ 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: Comment on PR with failure details + uses: actions/github-script@v7 + with: + script: | + const prNumber = context.payload.pull_request.number; + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + 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