Skip to content

Commit bf2042f

Browse files
shenxianpengclaude
andcommitted
chore(deps): bump commit-check to 2.17.0 for the warn status
The warn rendering merged in #276 needs commit-check to report "status": "warn", which it does from 2.17.0. The pin stayed at 2.16.0, which never emits it, so the feature was unreachable in every run. Add a test that asserts both the installed package and the requirements.txt pin are at least 2.17.0, so the pin cannot silently lag a feature that depends on the engine again. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018xYa7m3qup5wyN5MaXFgf6
1 parent 41eb8cd commit bf2042f

2 files changed

Lines changed: 41 additions & 1 deletion

File tree

‎main_test.py‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
"""Unit tests for main.py."""
22

3+
import importlib.metadata
34
import io
45
import json
56
import os
7+
import re
68
import sys
79
import tempfile
810
import unittest
@@ -592,6 +594,44 @@ def fake_other_checks(args):
592594
self.assertIn("--branch", captured_args)
593595

594596

597+
class TestCommitCheckVersionPin(unittest.TestCase):
598+
"""The warn rendering is inert against an engine that never emits it.
599+
600+
commit-check reports ``"status": "warn"`` from 2.17.0; the action pinned
601+
2.16.0 for a release after shipping the rendering, so nobody could ever
602+
see it. Both the installed package and the pin have to keep up.
603+
"""
604+
605+
MINIMUM = (2, 17, 0)
606+
607+
@staticmethod
608+
def _parse(version: str) -> tuple[int, ...]:
609+
match = re.match(r"(\d+)\.(\d+)\.(\d+)", version)
610+
assert match, f"unparsable commit-check version: {version!r}"
611+
return tuple(int(part) for part in match.groups())
612+
613+
def test_installed_commit_check_can_report_warnings(self):
614+
try:
615+
version = importlib.metadata.version("commit-check")
616+
except importlib.metadata.PackageNotFoundError:
617+
self.skipTest("commit-check is not installed")
618+
self.assertGreaterEqual(
619+
self._parse(version),
620+
self.MINIMUM,
621+
f"installed commit-check {version} predates the warn status",
622+
)
623+
624+
def test_requirements_pin_can_report_warnings(self):
625+
here = os.path.dirname(os.path.abspath(main.__file__))
626+
with open(os.path.join(here, "requirements.txt"), encoding="utf-8") as f:
627+
pins = dict(
628+
line.strip().split("==", 1)
629+
for line in f
630+
if "==" in line and not line.startswith("#")
631+
)
632+
self.assertGreaterEqual(self._parse(pins["commit-check"]), self.MINIMUM)
633+
634+
595635
class TestRenderStepLog(unittest.TestCase):
596636
def _run(self, results):
597637
buffer = io.StringIO()

‎requirements.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Install commit-check CLI
22
# For details please see: https://github.com/commit-check/commit-check
3-
commit-check==2.16.0
3+
commit-check==2.17.0
44
# Interact with the GitHub API.
55
PyGithub==2.10.0

0 commit comments

Comments
 (0)