Bump version and relocate notify API, add tests#102
Conversation
Bump package version to 3.0.5 and refactor notify utilities into app/api/notify (renamed files and updated imports). Update API routes to import the relocated resend router. Replace/modify Postman collection (tests/Postman.json) with renamed endpoints, method/body adjustments and added requests. Add new tests/test_github.py with unit tests for /github and related admin endpoints using TestClient and mocked DB connections.
Introduce a Goldlabel-branded HTML email template and apply it to resend emails. Adds app/utils/email_templates with goldlabel.py (goldlabel_email) and __init__.py export, and updates app/api/notify/resend.py to wrap outgoing HTML with the goldlabel_email template before sending, ensuring consistent branded emails.
There was a problem hiding this comment.
Pull request overview
This PR bumps the app version to 3.0.5, relocates the Resend/notify implementation under app/api/notify, adds a Goldlabel-branded HTML email wrapper, refreshes the Postman collection, and introduces GitHub API endpoint tests.
Changes:
- Update routing/imports to use the relocated
app/api/notifyResend router. - Add Goldlabel email template utilities and wrap outgoing Resend HTML with branding.
- Add
tests/test_github.pyand updatetests/Postman.jsonwith renamed/new requests.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_github.py | Adds unit tests for /github and GitHub admin endpoints using TestClient + mocked DB. |
| tests/Postman.json | Updates/renames endpoints and adds GitHub requests to the collection. |
| app/utils/email_templates/goldlabel.py | Introduces a Goldlabel-branded HTML email wrapper template. |
| app/utils/email_templates/init.py | Exposes goldlabel_email from the templates package. |
| app/api/routes.py | Updates Resend router import path after notify relocation. |
| app/api/notify/send_email.py | Adds Resend email sending utility under the new notify package. |
| app/api/notify/resend.py | Updates imports and wraps sent HTML via goldlabel_email(...). |
| app/api/notify/init.py | Adds notify package initializer and exports a router symbol. |
| app/init.py | Bumps package version to 3.0.5. |
Comments suppressed due to low confidence (1)
tests/Postman.json:719
- In the Postman collection, the "Create Tables" request points to
/github/createtable, but the API route is/api/github/createtable(see app/api/github/sql/create_tables.py). As-is, this request will 404; update the URL/path in the collection to include the/apiprefix.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def test_github_get_returns_all_tables(monkeypatch): | ||
| # One COUNT fetchone per table, one fetchall of rows per table. |
There was a problem hiding this comment.
These tests are written as pytest-style functions using the monkeypatch fixture, but the repo’s CI runs python -m unittest discover -s tests, which won’t execute them. Either convert these to unittest.TestCase tests (no pytest fixtures), or update the CI test command to run pytest so these tests actually run in PR validation.
| @@ -0,0 +1,149 @@ | |||
| from unittest.mock import MagicMock, patch | |||
There was a problem hiding this comment.
MagicMock/patch are imported but not used in this test module. Removing unused imports helps keep the test code clean and avoids failures if a linter is introduced later.
| from unittest.mock import MagicMock, patch |
Bump package version to 3.0.5 and refactor notify utilities into app/api/notify (renamed files and updated imports). Update API routes to import the relocated resend router. Replace/modify Postman collection (tests/Postman.json) with renamed endpoints, method/body adjustments and added requests. Add new tests/test_github.py with unit tests for /github and related admin endpoints using TestClient and mocked DB connections.