Skip to content

fix: Add typing to whitelisted methods#6144

Merged
balamurali27 merged 13 commits intodevelopfrom
type-fix-balu
Apr 27, 2026
Merged

fix: Add typing to whitelisted methods#6144
balamurali27 merged 13 commits intodevelopfrom
type-fix-balu

Conversation

@balamurali27
Copy link
Copy Markdown
Contributor

@balamurali27 balamurali27 commented Apr 16, 2026

ref: #5973

@balamurali27 balamurali27 requested a review from ssiyad as a code owner April 16, 2026 08:17
@balamurali27 balamurali27 changed the title type fix balu fix: Add typing to whitelisted methods Apr 16, 2026
@balamurali27 balamurali27 requested a review from Copilot April 16, 2026 08:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and email.py.
  • Introduced a typed local variable (out: list[dict]) in GitHub branch pagination logic.
  • Adjusted _get_app_name_and_title_from_hooks return type to be non-optional and added an (intended) NoReturn hint after frappe.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.

Comment thread press/api/email.py Outdated
Comment thread press/api/email.py
Comment thread press/api/github.py
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

❌ Patch coverage is 92.85714% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.42%. Comparing base (d320243) to head (48c6db5).
⚠️ Report is 66 commits behind head on develop.

Files with missing lines Patch % Lines
press/api/email.py 71.42% 2 Missing ⚠️
press/api/github.py 80.00% 1 Missing ⚠️
press/api/monitoring.py 0.00% 1 Missing ⚠️
press/utils/dns.py 0.00% 1 Missing ⚠️
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     
Flag Coverage Δ
dashboard 90.74% <ø> (+30.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…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>
@balamurali27 balamurali27 requested a review from tanmoysrt as a code owner April 20, 2026 07:41
@balamurali27 balamurali27 enabled auto-merge April 24, 2026 05:10
@balamurali27 balamurali27 merged commit 617cac2 into develop Apr 27, 2026
15 checks passed
@balamurali27 balamurali27 deleted the type-fix-balu branch April 27, 2026 04:34
@frappe-pr-bot
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 0.20.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants