Skip to content

DAP20 Capstone - Issue creation and Close, Slack and Email notification for testsPython#45

Open
emsbc wants to merge 6 commits intoFullStackWithLawrence:mainfrom
emsbc:main
Open

DAP20 Capstone - Issue creation and Close, Slack and Email notification for testsPython#45
emsbc wants to merge 6 commits intoFullStackWithLawrence:mainfrom
emsbc:main

Conversation

@emsbc
Copy link
Copy Markdown

@emsbc emsbc commented Apr 28, 2026

Pull Request Template

Type of Change

  • New feature
  • Bug fix
  • Documentation
  • Chore

Changes

.github/workflows/testsPython.yml

  • Added workflow_dispatch input to parameterise failure notification recipient(s) — accepts comma-separated email addresses
  • Fixed scaffold bug: added if: always() to the notifications job — without this GitHub skips the job when upstream tests fail, defeating the purpose
  • Added permissions: issues: write to allow the job to create and close GitHub Issues
  • Added job-level env block mapping secrets to environment variables — GitHub Actions does not allow secrets context in step-level if expressions
  • Replaced placeholder echo statements with five notification steps:
    • Job summary — writes a ✅/❌ markdown table to the GitHub Actions Summary tab on every run
    • Slack — posts a failure message via incoming webhook (skipped gracefully if SLACK_WEBHOOK_URL secret is absent)
    • Email — sends a failure email via Gmail SMTP; recipient resolved from workflow_dispatch input with fallback to NOTIFY_EMAIL secret
    • GitHub Issue — opens a bug-labelled issue on failure
    • Auto-close issue — closes any open CI failure issue with a comment when tests pass again

app/settings.py

  • Fixed MYSQL_PORT to use or instead of a default argument so that an empty string passed from GitHub Actions secrets falls back to 3306 correctly

Makefile

  • Fixed ACTIVATE_VENV for Windows/Git Bash: added source prefix and changed backslashes to forward slashes

mise.toml (new file)

  • Pins Python to 3.13 and auto-creates .venv on mise install
  • Defines tasks mirroring all Makefile targets (init, init-dev, test, coverage, lint, pre-commit, tear-down, analyze, release)

doc/CI_NOTIFICATIONS_TESTING_GUIDE.md (new file)

  • Step-by-step guide covering Gmail App Password setup, Slack workspace and webhook creation, all required GitHub secrets, branch creation, and five testing scenarios with git commands and verification checklists

Testing

See doc/CI_NOTIFICATIONS_TESTING_GUIDE.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant