fix: Add typing to whitelisted methods#6144
Conversation
There was a problem hiding this comment.
Pull request overview
Adds type hints to select Frappe whitelisted API methods (ref #5973) to improve static type checking and clarity of expected inputs/outputs.
Changes:
- Added/updated type annotations for whitelisted methods in
monitoring.py,github.py, andemail.py. - Introduced a typed local variable (
out: list[dict]) in GitHub branch pagination logic. - Adjusted
_get_app_name_and_title_from_hooksreturn type to be non-optional and added an (intended) NoReturn hint afterfrappe.throw.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| press/api/monitoring.py | Adds a typed optional token parameter to the targets whitelisted endpoint. |
| press/api/github.py | Adds typing to several whitelisted endpoints and tightens a helper’s return type. |
| press/api/email.py | Adds typing to whitelisted email endpoints; refactors send_mime_mail parsing variable naming. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6144 +/- ##
===========================================
+ Coverage 49.69% 56.42% +6.72%
===========================================
Files 936 936
Lines 77648 77648
Branches 353 525 +172
===========================================
+ Hits 38588 43809 +5221
+ Misses 39036 33811 -5225
- Partials 24 28 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Agent-Logs-Url: https://github.com/frappe/press/sessions/611bba5c-139b-4c8e-8e31-156887bfe193 Co-authored-by: balamurali27 <25403045+balamurali27@users.noreply.github.com>
…Case Agent-Logs-Url: https://github.com/frappe/press/sessions/ea31b107-c001-4fe5-a9ce-3b3755e1b652 Co-authored-by: balamurali27 <25403045+balamurali27@users.noreply.github.com>
After fatal updates, cache can prevent user from retrying, when fatal site update field was populated earlier
|
🎉 This PR is included in version 0.20.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
ref: #5973