fix: support Gitea 28.0.0 mail templates
Release / Validate Templates (push) Canceled after 0s
Release / Package & Release (push) Canceled after 0s

This commit is contained in:
KenanZhu committed 2026-10-02 19:44:20 +08:00
1 parent ffb674669b
commit 92d2ba9889
18 files changed
+135 -42

No files matched your search

+11 -6
View File
@@ -7,12 +7,13 @@ This document tracks the compatibility between **Gitea Mail Templates** releases
<!-- TRACKER:QUICK-REF-MAX OFFSET=3 -->
| Template Release | Min Gitea | Max Tested Gitea | Status |
|-----------------|-----------|-----------------|--------|
| **v1.27.3** | **1.25.0** | **1.27.3** | ✅ Active |
| **v28.0.0** | **28.0.0** | **28.0.0** | ✅ Active |
| **v1.27.3** | **1.25.0** | **1.27.3** | ✅ Superseded; release emails fail on Gitea 28.0.0 (`FileSize` removed) |
| **v1.27.2** | **1.25.0** | **1.27.3** | ⚠️ Push notices fail in Bloom, Ember, and Heritage on Gitea 1.27.1+ |
| **v1.0.1** | **1.25.0** | **1.27.0** | ✅ Superseded; push notices need newer release on 1.27.1+ |
| **v1.0.0** | **1.25.0** | **1.26.4** | ✅ Superseded |
> **Latest verified:** Release v1.27.3 passes the Gitea 1.27.3 source audit and push-render test. The older v1.27.2 archive contains three broken push-notification templates. <!-- TRACKER:LATEST-VERIFIED -->
> **Latest verified:** Release v28.0.0 passes the Gitea 28.0.0 mail-template, mailer-context, function, and translation-key source audit plus all-theme rendering tests. This release requires Gitea 28.0.0; use v1.27.3 for Gitea 1.25.0–1.27.3. <!-- TRACKER:LATEST-VERIFIED -->
## Versioning
@@ -20,6 +21,7 @@ The release tag identifies the downloadable template package. The supported Gite
| Gitea version | Template release |
|---------------|------------------|
| 28.0.0 | **v28.0.0**; older releases use the removed `FileSize` function in release emails |
| 1.27.3 | **v1.27.3**; v1.27.2 has a push-notification issue in three themes |
| 1.27.2 | **v1.27.3**; v1.27.2 has the same issue |
| 1.27.1 | **v1.27.3**; v1.27.2 has the same issue |
@@ -27,6 +29,7 @@ The release tag identifies the downloadable template package. The supported Gite
- The [tracker workflow](.github/workflows/gitea-tracker.yml) opens a PR when a new Gitea release appears, marking it ⏳ Pending Verification.
- After verification, update the top **Template Release** row. Keep fixes on `main` marked **unreleased** until a new tag is published; the [release workflow](.github/workflows/release.yml) packages the archive on tag push.
- The older `v1.0.1` tag predates the Gitea 1.27.1 push notification data fix and should not be used for Gitea 1.27.1 or newer.
- Gitea 28.0.0 replaces the mail-template `FileSize` function with `FormatByteSize`. The two functions are not interchangeable across these Gitea versions; use the matching template release.
## Check Your Gitea Version
@@ -41,6 +44,7 @@ gitea --version
<!-- TRACKER:VERSION-INSERT OFFSET=2 -->
| Gitea | Release Date | Mail Template Changes | Breaking? |
|-------|-------------|----------------------|-----------|
| **28.0.0** | 2026-09-29 | `FileSize` removed and `FormatByteSize` added; mail templates now have `mail/`-prefixed internal names and shared head/footer partials; workflow emails gain status-icon fields. Our custom template paths and referenced data fields remain valid. | **Yes** (release attachment formatting) |
| **1.27.3** | 2026-08-29 | No upstream mail template, mailer, or locale changes; an existing push-notification defect in three themes is fixed in template release v1.27.3 | No upstream break |
| **1.27.2** | 2026-08-14 | None — security + bug fixes | No |
| **1.27.1** | 2026-07-27 | Push commit data paths changed: .ID → .UserCommit.GitCommit.ID (#38467); older custom templates can fail on push notifications | Yes (old .ID paths) |
@@ -69,7 +73,7 @@ All 11 template types use only Gitea built-in variables and functions. Verified
| `QueryEscape` | ≤ 1.21 | URL query encoding |
| `PathEscapeSegments` | ≤ 1.21 | Per-segment path encoding |
| `ShortSha` | ≤ 1.21 | Truncated commit hash |
| `FileSize` | ≤ 1.21 | Human-readable file size |
| `FormatByteSize` | 28.0.0 | Human-readable IEC file size; replaces `FileSize` |
| `HTMLFormat` | ≤ 1.21 | Render string as safe HTML |
| `Iif` | ≤ 1.21 | Inline conditional |
| `dict` | ≤ 1.21 | Build maps from key-value pairs |
@@ -100,13 +104,14 @@ All 11 template types use only Gitea built-in variables and functions. Verified
### Translation Keys
All templates use Gitea's official `mail.*` translation namespace. Keys are stable across Gitea 1.25+.
All templates use Gitea's official `mail.*` translation namespace. Every referenced key was checked against Gitea 28.0.0's English locale file.
## How Compatibility Is Verified
1. **Automated lint** — CI renders all templates via `go run . preview all` on every push
1. **Automated lint** — CI renders all templates via `go run . preview all` on every push; the preview function map mirrors Gitea 28.0.0
2. **Source audit** — Template data contexts are cross-referenced against Gitea's `services/mailer/` package
3. **Release checklist** — Each release confirms the max-tested Gitea version in this file
3. **Regression tests** — Go tests render push notifications and release attachments in all 10 themes
4. **Release checklist** — Each release confirms the max-tested Gitea version in this file
## Automated Tracking