Skip to content

feat(providers): make the mail send deadline public - #58

Merged
joaovitoriasilva merged 1 commit into
mainfrom
feat/issue_57
Nov 7, 2026
Merged

joaovitoriasilva merged 1 commit into
mainfrom
feat/issue_57

Conversation

@joaovitoriasilva

@joaovitoriasilva joaovitoriasilva commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Makes the per-message SMTP send deadline public as jasil.providers.MAIL_SEND_DEADLINE_SECONDS (90 seconds), so a host can size a lease or timeout around a send without importing a private backend name or copying 90.

  • jasil/backends/mail_smtp.py and the max_runtime_seconds warning in jasil/container.py read the constant from jasil.providers.
  • jasil.container.SMTP_SEND_DEADLINE_SECONDS (listed as not covered in docs/api-stability.md) is removed.
  • The docstring and docs say DNS lookups are not counted against the deadline, so a lease needs a margin, and that the value may change in a minor release.

Related issue

Closes #57

Type of change

  • Bug fix
  • New feature (exception during freeze; link prior discussion/acknowledgment)
  • Documentation
  • Refactor / code quality
  • Translation
  • Other (describe below)

Checklist

  • This PR is focused on a single concern
  • An issue was opened and acknowledged before writing this code (if not a small fix)
  • If this PR introduces a new feature during freeze, it was discussed and explicitly acknowledged first
  • The PR is under ~300 lines changed, excluding lock files, migrations, and generated code
  • Tests have been added or updated where applicable
  • Documentation has been updated where applicable
  • Commit messages follow Conventional Commits format

Notes for the reviewer

The container tests now check the warning boundary against the constant (== deadline warns, deadline + 1 does not) rather than fixed numbers.

Checks run: ruff, ruff format, lint-imports, mypy, pytest (3642 passed, 139 skipped, 97.79% coverage), check_module_coverage.py, check_docs_api.py.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a public constant for the 90-second limit on an individual SMTP send. DNS lookups are excluded, and the value may change in a minor release.
  • Documentation
    • Clarified how the send limit affects mail-worker timing and how to account for it when setting leases or timeouts.
    • Updated the documented public API to use the new constant; the former SMTP deadline constant is no longer available.

Hosts that size a lease or timeout around a send need the same bound
SmtpMail enforces. MAIL_SEND_DEADLINE_SECONDS now lives in
jasil.providers; the SMTP backend and the composition root's
max_runtime_seconds warning read it from there.

Closes #57

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The SMTP send deadline is now exposed as jasil.providers.MAIL_SEND_DEADLINE_SECONDS. The mail backend, container runtime check, tests, and documentation use the public constant instead of local or container-specific deadline names.

Changes: Mail send deadline

Layer / File(s) Summary
Publish and document the deadline
jasil/providers.py, CHANGELOG.md, docs/api-stability.md, docs/durable-jobs.md, docs/providers-and-backends.md
Defines the 90-second MAIL_SEND_DEADLINE_SECONDS constant and documents its per-send scope, DNS lookup exclusion, and use when setting timeouts or leases.
Use the public deadline
jasil/backends/mail_smtp.py, jasil/container.py, tests/test_mail.py, tests/test_container.py
The mail watchdog, delivery deadline, and container runtime check use the public constant. Tests use it for deadline boundaries and watchdog behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Possibly related PRs

Suggested labels: enhancement, documentation

Merge Risk: Minimal · up to 0f28d

This change exposes the existing 90-second mail send deadline as a public constant and updates the backend, container warning and docs to use it. No new regression was identified, so it is ready to merge. Hosts sizing leases should still add a margin for DNS lookups and be aware of the documented Windows slow-read limitation.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: making the mail send deadline public.
Linked Issues check Passed [57] jasil.providers defines the 90-second public deadline and documents the DNS exclusion. The SMTP backend and container warning use the constant. docs/api-stability.md lists it. Mail tests use …
Out of Scope Changes check Passed [57] The backend and container changes, tests, documentation, and changelog support the public deadline. Removal of the old uncovered constants supports the move to the public name.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Linked Issues check

Explanation

[57] jasil.providers defines the 90-second public deadline and documents the DNS exclusion. The SMTP backend and container warning use the constant. docs/api-stability.md lists it. Mail tests use the constant, and container tests cover the warning boundary.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 5 files. (4 skipped: 4 unsupported.)

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 15db07ff-2b50-40d4-b18f-5b0e2fdd441c
Commits

Reviewing files that changed from the base of the PR and between ce98038 and 0f28d5f.

Files selected for processing: 9

  • CHANGELOG.md
  • docs/api-stability.md
  • docs/durable-jobs.md
  • docs/providers-and-backends.md
  • jasil/backends/mail_smtp.py
  • jasil/container.py
  • jasil/providers.py
  • tests/test_container.py
  • tests/test_mail.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@joaovitoriasilva
joaovitoriasilva merged commit 984ae35 into main Nov 7, 2026
21 checks passed
@joaovitoriasilva
joaovitoriasilva deleted the feat/issue_57 branch November 7, 2026 09:20
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.

[FEATURE]: Make the mail send deadline public

1 participant