docs: clarify per-version Gitea compatibility
This commit is contained in:
1 parent
14dc37046d
commit
5c0589f6f6
7 files changed
+90
-77
No files matched your search
@@ -17,22 +17,19 @@ RELEASE_URL = "https://gitea.kenanzhu.com/KenanZhu/GiteaMailTemplates/releases/l
|
||||
FIXTURES = {
|
||||
"COMPATIBILITY.md": """# Gitea Compatibility
|
||||
<!-- DOC-TAGS: {"TRACKER":["LATEST-VERIFIED","VERSION-MAP","HISTORY"]} -->
|
||||
| Template Release | Min Gitea | Max Tested Gitea | Status |
|
||||
|---|---|---|---|
|
||||
| **v28.0.0** | **28.0.0** | **28.0.0** | [PASS] Active |
|
||||
<!-- TRACKER:LATEST-VERIFIED -->
|
||||
> **Latest verified:** Release v28.0.0 passes tests.
|
||||
<!-- /TRACKER:LATEST-VERIFIED -->
|
||||
<!-- TRACKER:VERSION-MAP -->
|
||||
| Gitea version | Template release |
|
||||
|---|---|
|
||||
| 28.1.0 | [PENDING] Compatibility verification; no tested template release yet |
|
||||
| 28.0.0 | **v28.0.0** |
|
||||
| Gitea version | Recommended template release | Status | Notes |
|
||||
|---|---|---|---|
|
||||
| 28.1.0 | — | [PENDING] | Compatibility verification pending |
|
||||
| 28.0.0 | **v28.0.0** | [PASS] | Tested |
|
||||
<!-- /TRACKER:VERSION-MAP -->
|
||||
<!-- TRACKER:HISTORY -->
|
||||
| Gitea | Release Date | Mail Template Changes | Breaking? |
|
||||
| Gitea | Release Date | Mail Template Changes | Impact |
|
||||
|---|---|---|---|
|
||||
| **28.1.0** | 2026-10-06 | [PENDING] Mail-template compatibility verification | TBD |
|
||||
| **28.1.0** | 2026-10-06 | [PENDING] Review of mail-template changes | TBD |
|
||||
| **28.0.0** | 2026-09-29 | FormatByteSize | Yes |
|
||||
| **≤ 1.24.x** | — | Old directory | [UNSUPPORTED] |
|
||||
<!-- /TRACKER:HISTORY -->
|
||||
@@ -107,9 +104,9 @@ class TrackerTests(unittest.TestCase):
|
||||
changed = TRACKER.apply_release(self.root, "28.2.0", "2026-11-01")
|
||||
self.assertEqual({self.root / name for name in self.paths}, set(changed))
|
||||
compatibility = self.read("COMPATIBILITY.md")
|
||||
self.assertIn("| 28.2.0 | [PENDING] Compatibility verification", compatibility)
|
||||
self.assertIn("| 28.2.0 | — | [PENDING] | Compatibility verification pending |", compatibility)
|
||||
self.assertIn("| **28.2.0** | 2026-11-01 | [PENDING]", compatibility)
|
||||
self.assertIn("| **v28.0.0** | **28.0.0** | **28.0.0** | [PASS] Active |", compatibility)
|
||||
self.assertIn("| 28.0.0 | **v28.0.0** | [PASS] | Tested |", compatibility)
|
||||
self.assertIn("Latest verified:** Release v28.0.0", compatibility)
|
||||
self.assertIn("Gitea-28.2.0%20%5BPENDING%5D%20%7C%2028.0.0%20tested-yellow", self.read("README.md"))
|
||||
self.assertIn("Gitea 28.2.0:** [PENDING]", self.read("README.md"))
|
||||
@@ -125,6 +122,12 @@ class TrackerTests(unittest.TestCase):
|
||||
self.assertIn(("TRACKER", "HISTORY"), {(block.subject, block.content) for block in blocks})
|
||||
self.assertIn(("RELEASE", "HEADER"), {(block.subject, block.content) for block in blocks})
|
||||
TRACKER.latest_tested(documents, blocks)
|
||||
matrix = next(block for block in blocks if (block.subject, block.content) == ("TRACKER", "VERSION-MAP"))
|
||||
history = next(block for block in blocks if (block.subject, block.content) == ("TRACKER", "HISTORY"))
|
||||
self.assertEqual(
|
||||
TRACKER.table(TRACKER.body(documents[matrix.path], matrix), "VERSION-MAP"),
|
||||
TRACKER.table(TRACKER.body(documents[history.path], history), "HISTORY"),
|
||||
)
|
||||
|
||||
def test_existing_version_is_idempotent(self):
|
||||
self.assertEqual([], TRACKER.apply_release(self.root, "28.1.0", "2026-10-06"))
|
||||
@@ -132,10 +135,10 @@ class TrackerTests(unittest.TestCase):
|
||||
|
||||
def test_partial_update_is_repaired(self):
|
||||
compatibility = self.root / "COMPATIBILITY.md"
|
||||
partial = self.read("COMPATIBILITY.md").replace("| 28.1.0 | [PENDING] Compatibility verification; no tested template release yet |\n", "")
|
||||
partial = self.read("COMPATIBILITY.md").replace("| 28.1.0 | — | [PENDING] | Compatibility verification pending |\n", "")
|
||||
compatibility.write_text(partial, encoding="utf-8")
|
||||
self.assertEqual([compatibility], TRACKER.apply_release(self.root, "28.1.0", "2026-10-06"))
|
||||
self.assertIn("| 28.1.0 | [PENDING] Compatibility verification", self.read("COMPATIBILITY.md"))
|
||||
self.assertIn("| 28.1.0 | — | [PENDING] | Compatibility verification pending |", self.read("COMPATIBILITY.md"))
|
||||
|
||||
def test_older_version_does_not_rewrite_history(self):
|
||||
self.assertEqual([], TRACKER.apply_release(self.root, "28.0.0", "2026-09-29"))
|
||||
|
||||
@@ -24,8 +24,8 @@ BADGE_RE = re.compile(r"Gitea-(\d+\.\d+\.\d+)(?:%20(?:pending|%5BPENDING%5D))?%2
|
||||
RELEASE_VERSION_RE = re.compile(r"\bv\d+\.\d+\.\d+\b")
|
||||
RELEASE_LINK_RE = re.compile(r"\[v\d+\.\d+\.\d+\]\(https://[^)]+/releases/latest\)")
|
||||
TABLES = {
|
||||
"VERSION-MAP": "| Gitea version | Template release |",
|
||||
"HISTORY": "| Gitea | Release Date | Mail Template Changes | Breaking? |",
|
||||
"VERSION-MAP": "| Gitea version | Recommended template release | Status | Notes |",
|
||||
"HISTORY": "| Gitea | Release Date | Mail Template Changes | Impact |",
|
||||
}
|
||||
SKIP_DIRECTORIES = frozenset((".git", "node_modules", "vendor", "dist"))
|
||||
|
||||
@@ -163,13 +163,13 @@ def latest_tested(documents_by_path, blocks):
|
||||
|
||||
def update_version_map(content, version, release_date, tested):
|
||||
if version not in table(content, "VERSION-MAP"):
|
||||
content.insert(2, f"| {version} | [PENDING] Compatibility verification; no tested template release yet |\n")
|
||||
content.insert(2, f"| {version} | — | [PENDING] | Compatibility verification pending |\n")
|
||||
return content
|
||||
|
||||
|
||||
def update_history(content, version, release_date, tested):
|
||||
if version not in table(content, "HISTORY"):
|
||||
content.insert(2, f"| **{version}** | {release_date} | [PENDING] Mail-template compatibility verification | TBD |\n")
|
||||
content.insert(2, f"| **{version}** | {release_date} | [PENDING] Review of mail-template changes | TBD |\n")
|
||||
return content
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user