Allow sites to select immutable Relay mail template versions
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start with community_base.mail.service.send() and the existing EmailDelivery.template_version handling, then read the mail and kernel hook docs and docs/plan/phase-6.md. Trace the idempotency, resend, worker, and Relay paths, and add the resolver without site imports or a migration. Done means the listed acceptance criteria and package quality gates pass, CI comparisons are reported, and v0.5.35 and its release wheel are verified.
Written by the indexing model from the issue text.
Description
Allow sites to select immutable Relay mail template versions
Status: in progress
Plan card: C6.2b in docs/plan/phase-6.md
Depends on: C1.2b
Blocks: AI-Shipping-Labs/website#2009
Goal
Let each consuming site select the published Relay template version for a mail purpose while every
EmailDelivery remains pinned and immutable. AI Shipping Labs needs reviewed version 2 templates
after removing its local renderers. DataTalksClub and unconfigured consumers must remain on version
1.
Scope
- Add
COMMUNITY_BASE["MAIL_TEMPLATE_VERSION_RESOLVER"], accepting a callable or dotted path with
contract(purpose: str) -> int; no override resolves to1. - Resolve the version once in
community_base.mail.service.send()before any delivery or job is
created. Persist it in the existingEmailDelivery.template_version; the worker and Relay
backend continue using that stored value. - Accept only a strictly positive integer. Reject booleans, zero, negative integers, strings,
None, and other types withMailError("invalid mail template version")and no writes. - Keep
template_versionin the immutable idempotency comparison. An exact replay returns the
original delivery. If the resolver changes for the same idempotency key, raiseMailConflict
without mutating or requeueing the pinned delivery. A new audited resend resolves the current
version for its new idempotency key. - Keep the package free of site imports.
AI-Shipping-Labs/website#2009will configure the dotted
hookemail_app.relay_versions.template_version_for, selecting version 2. DTC config remains
unchanged and therefore selects version 1. - Add no model field or migration. Do not add a row-mutation command or resolve the version again
in the worker. - Update the mail/kernel hook docs and architecture list. Bump package version and changelog for
immutable releasev0.5.35. - No AWS access, production data, containers, or real sends. No unrelated package work.
Acceptance Criteria
- With no resolver configured,
send()persiststemplate_version=1and the Relay request
sends version 1 exactly as before. - A callable or dotted-path resolver receives the exact purpose and its positive integer result
is persisted and sent to Relay. - Invalid results, including booleans, fail with
MailError("invalid mail template version")
before anyEmailDeliveryorJobIntentis created or enqueued. - Exact replay with the same resolved version returns the original delivery and creates no
second job or send. - Resolver drift for the same idempotency key raises
MailConflictand leaves the original
delivery version, job, and dispatch unchanged. -
resend()resolves the current version into its new logical delivery. - No migration is generated and package boundary tests confirm there is no site import.
- Package mail tests and all quality gates pass with all extras installed and the collected
test count recorded. - Package CI reports DTC baseline versus linked and AISL baseline versus linked separately,
with no new linked failure; a pre-existing baseline failure is reported rather than called green. - Package
mainis green before immutablev0.5.35and its release wheel are created; AISL
does not pin the package before the tag exists.
Verification
uv sync --all-extrasuv run pytest tests/mailuv run pytestuv run ruff check .uv run ruff format --check .uv run python testproject/manage.py checkuv run python testproject/manage.py makemigrations --check --dry-run- Fresh SQLite
uv run python testproject/manage.py migrate uv run pytest tests/test_boundaries.pypython3 scripts/plan.py check- After direct
HEAD:mainpush: package CI plus both P16 consumer comparison jobs. git ls-remote --tags origin v0.5.35and GitHub release wheel verification.
Workflow Override
The owner authorized direct HEAD:main delivery with no pull request for this dependency. Package
implementation, tester review, product acceptance, CI observation, immutable-tag rules, and both
consumer checks still apply.
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 1h 5m
- Merged PRs (30d)
- 3
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DataTalksClub/community-base
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
DataTalksClub/community-base#285 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
DataTalksClub/community-base#417 ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
DataTalksClub/community-base#415 ·
-
Difficulty 5/5 Over a week Newbie friendliness 12/100
DataTalksClub/community-base#414 · 7 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
DataTalksClub/community-base#410 · 1 comment ·
All issues in DataTalksClub/community-base
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
btclib-org/btclib#3062 ·
Maintainers usually reply within 1 day
-
area:evals area:infra enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
jse-avl/support-bot#4 · 1 comment ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
qte77/agentic-job-offer-to-application-kit#487 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
btclib-org/btclib-wallet#801 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 94/100