From af236d78d0858228a97f152541843b15275da906 Mon Sep 17 00:00:00 2001 From: Yong Chen Date: Mon, 4 May 2026 12:17:13 -0700 Subject: [PATCH 1/9] Python unit tests notification in GitHub Action and by email using Brevo. --- .github/workflows/testsPython.yml | 34 ++++++++++++++++++++++++++++-- agentic-ai-workflow.code-workspace | 7 ++++++ 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 agentic-ai-workflow.code-workspace diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython.yml index 452f71d..099d4b1 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -68,12 +68,42 @@ jobs: # on the test results. notifications: needs: python-unit-tests + if: always() runs-on: ubuntu-latest steps: + # Notifications in GitHub Actions - name: Notify on test results run: | if [ "${{ needs.python-unit-tests.result }}" == "success" ]; then - echo "success notifications go here" + echo "Tests passed ✅" else - echo "failure notifications go here" + echo "Tests failed ❌" fi + # Email notification using Brevo when tests pass, BREVO_API_KEY is set in repository secrets + - name: Send success email + if: ${{ needs.python-unit-tests.result == 'success' }} + run: | + curl -X POST https://api.brevo.com/v3/smtp/email \ + -H "accept: application/json" \ + -H "api-key: ${{ secrets.BREVO_API_KEY }}" \ + -H "content-type: application/json" \ + -d '{ + "sender": { "email": "yongchuangchen@gmail.com" }, + "to": [{ "email": "chenyongchuang@hotmail.com" }], + "subject": "Tests Passed ✅", + "htmlContent": "

All tests passed successfully.

" + }' + # Email notification using Brevo when tests fail, BREVO_API_KEY is set in repository secrets + - name: Send failure email + if: ${{ needs.python-unit-tests.result == 'failure' }} + run: | + curl -X POST https://api.brevo.com/v3/smtp/email \ + -H "accept: application/json" \ + -H "api-key: ${{ secrets.BREVO_API_KEY }}" \ + -H "content-type: application/json" \ + -d '{ + "sender": { "email": "yongchuangchen@gmail.com" }, + "to": [{ "email": "chenyongchuang@hotmail.com" }], + "subject": "Tests Failed ❌", + "htmlContent": "

Tests failed. Check logs in GitHub Actions.

" + }' diff --git a/agentic-ai-workflow.code-workspace b/agentic-ai-workflow.code-workspace new file mode 100644 index 0000000..ef9f5d2 --- /dev/null +++ b/agentic-ai-workflow.code-workspace @@ -0,0 +1,7 @@ +{ + "folders": [ + { + "path": "." + } + ] +} \ No newline at end of file From 320a6caed265163979b275c749fcb6ee7ba0c54c Mon Sep 17 00:00:00 2001 From: Yong Chen Date: Mon, 4 May 2026 12:36:23 -0700 Subject: [PATCH 2/9] Use a DMARC configured Sender in Brevo to make sure email notifications can be successfully delivered. --- .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 099d4b1..946e098 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -88,7 +88,7 @@ jobs: -H "api-key: ${{ secrets.BREVO_API_KEY }}" \ -H "content-type: application/json" \ -d '{ - "sender": { "email": "yongchuangchen@gmail.com" }, + "sender": { "email": "info@runningresults.net" }, "to": [{ "email": "chenyongchuang@hotmail.com" }], "subject": "Tests Passed ✅", "htmlContent": "

All tests passed successfully.

" @@ -102,7 +102,7 @@ jobs: -H "api-key: ${{ secrets.BREVO_API_KEY }}" \ -H "content-type: application/json" \ -d '{ - "sender": { "email": "yongchuangchen@gmail.com" }, + "sender": { "email": "info@runningresults.net" }, "to": [{ "email": "chenyongchuang@hotmail.com" }], "subject": "Tests Failed ❌", "htmlContent": "

Tests failed. Check logs in GitHub Actions.

" From 6b9cf5473e8a9a277c76cc63d7a1f9b275b4f664 Mon Sep 17 00:00:00 2001 From: Yong Chen Date: Mon, 4 May 2026 12:52:28 -0700 Subject: [PATCH 3/9] Change notification recipient's email to from Hotmail to Gmail. Notification emails received successfully. --- .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 946e098..37a8834 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -89,7 +89,7 @@ jobs: -H "content-type: application/json" \ -d '{ "sender": { "email": "info@runningresults.net" }, - "to": [{ "email": "chenyongchuang@hotmail.com" }], + "to": [{ "email": "yongchuangchen@gmail.com" }], "subject": "Tests Passed ✅", "htmlContent": "

All tests passed successfully.

" }' @@ -103,7 +103,7 @@ jobs: -H "content-type: application/json" \ -d '{ "sender": { "email": "info@runningresults.net" }, - "to": [{ "email": "chenyongchuang@hotmail.com" }], + "to": [{ "email": "yongchuangchen@gmail.com" }], "subject": "Tests Failed ❌", "htmlContent": "

Tests failed. Check logs in GitHub Actions.

" }' From d9b38c5f23c0c8f0a5c73de96cb48f4151733189 Mon Sep 17 00:00:00 2001 From: Yong Chen Date: Mon, 4 May 2026 13:08:57 -0700 Subject: [PATCH 4/9] Notifications in Job Summary panel of the workflow run --- .github/workflows/testsPython.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython.yml index 37a8834..f5b3744 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -71,13 +71,15 @@ jobs: if: always() runs-on: ubuntu-latest steps: - # Notifications in GitHub Actions + # Notifications in Job Summary panel of the workflow run - name: Notify on test results run: | if [ "${{ needs.python-unit-tests.result }}" == "success" ]; then - echo "Tests passed ✅" + echo "## Tests Passed ✅" >> $GITHUB_STEP_SUMMARY + echo "All unit tests succeeded." >> $GITHUB_STEP_SUMMARY else - echo "Tests failed ❌" + echo "## Tests Failed ❌" >> $GITHUB_STEP_SUMMARY + echo "Check logs for details." >> $GITHUB_STEP_SUMMARY fi # Email notification using Brevo when tests pass, BREVO_API_KEY is set in repository secrets - name: Send success email From 9b9a02200cdcdf577e9d139d4b867791ebf464ad Mon Sep 17 00:00:00 2001 From: Yong Chen Date: Mon, 18 May 2026 23:17:06 -0700 Subject: [PATCH 5/9] fix: add real DB credentials --- .env.example | 1 + .vscode/settings.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 568a4d2..aed7d13 100644 --- a/.env.example +++ b/.env.example @@ -12,3 +12,4 @@ MYSQL_DATABASE=smarter_test_db MYSQL_CHARSET=utf8mb4 PYTHONPATH=./venv:./ CODECOV_TOKEN=ADD-YOUR-CODECOV_TOKEN-HERE +REPO_NAME=ADD-YOUR-REPO_NAME-HERE diff --git a/.vscode/settings.json b/.vscode/settings.json index 3a4d3c9..67ab810 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,5 +2,6 @@ "cornflakes.linter.executablePath": "venv/bin/flake8", "[python]": { "editor.defaultFormatter": "ms-python.black-formatter" - } + }, + "makefile.configureOnOpen": false } From b18e8dd4474fffcd0ee0123591cb160da188af6e Mon Sep 17 00:00:00 2001 From: Yong Chen Date: Mon, 18 May 2026 23:24:06 -0700 Subject: [PATCH 6/9] fix: add real DB credentials --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index aed7d13..66293da 100644 --- a/.env.example +++ b/.env.example @@ -12,4 +12,4 @@ MYSQL_DATABASE=smarter_test_db MYSQL_CHARSET=utf8mb4 PYTHONPATH=./venv:./ CODECOV_TOKEN=ADD-YOUR-CODECOV_TOKEN-HERE -REPO_NAME=ADD-YOUR-REPO_NAME-HERE +REPO_NAME=ADD-YOUR-REPO_NAME-HERE \ No newline at end of file From 60985f491438124bd3358a48de54ddd607f30489 Mon Sep 17 00:00:00 2001 From: Yong Chen Date: Mon, 18 May 2026 23:28:31 -0700 Subject: [PATCH 7/9] fix: add real DB credentials --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 66293da..aed7d13 100644 --- a/.env.example +++ b/.env.example @@ -12,4 +12,4 @@ MYSQL_DATABASE=smarter_test_db MYSQL_CHARSET=utf8mb4 PYTHONPATH=./venv:./ CODECOV_TOKEN=ADD-YOUR-CODECOV_TOKEN-HERE -REPO_NAME=ADD-YOUR-REPO_NAME-HERE \ No newline at end of file +REPO_NAME=ADD-YOUR-REPO_NAME-HERE From eb5a64ce49238c87ab1c850a1dde7f69ad36d89b Mon Sep 17 00:00:00 2001 From: Yong Chen Date: Mon, 18 May 2026 23:40:15 -0700 Subject: [PATCH 8/9] update: README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 28065c8..64d4862 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ make docker-push # push your Docker container to DockerHub. A DockerHub accou make docker-prune # prune (permanently delete) all existing data in Docker: containers, images, cache. ``` +Docker debugging tips + ## Requirements - [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). _pre-installed on Linux and macOS_ From 5472d18df25a03b8232abdc84bcfef3ca925d5ef Mon Sep 17 00:00:00 2001 From: Yong Chen Date: Mon, 18 May 2026 23:43:21 -0700 Subject: [PATCH 9/9] update: README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 64d4862..7d54af7 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ make docker-push # push your Docker container to DockerHub. A DockerHub accou make docker-prune # prune (permanently delete) all existing data in Docker: containers, images, cache. ``` -Docker debugging tips +update: README ## Requirements