From 224e697aafbae57f671b1777aa60a7aa2aadad75 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 31 Oct 2026 08:52:40 +0000 Subject: [PATCH] chore(template-sync): sync to v1.14.2 --- .github/scripts/README.md | 4 +++ .github/scripts/test_moderate_labels.py | 34 +++++++++++++++++++++++++ .github/template-sync-state.json | 2 +- .github/workflows/moderate-setup.yml | 2 +- 4 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 .github/scripts/test_moderate_labels.py diff --git a/.github/scripts/README.md b/.github/scripts/README.md index 6e9a0b1..30bf032 100644 --- a/.github/scripts/README.md +++ b/.github/scripts/README.md @@ -87,6 +87,10 @@ that label the test fails until you look up the new image's `python3` (actions/runner-images) and update `RUNNER_IMAGE_PYTHON`, `RUNNER_PYTHON` and `ruff.toml` together. +- `test_moderate_labels.py` — checks that every `create "" "" + ""` line in `../workflows/moderate-setup.yml` has a description + of at most 100 characters (GitHub answers HTTP 422 to a longer one, and only + the manually dispatched workflow would ever show it); `scripts-tests` runs it. - `verify_release_tag.sh` — the `release` job's check that an already published release's tag points at the commit the run built (fails closed; retries only transient lookup errors, six attempts over about two diff --git a/.github/scripts/test_moderate_labels.py b/.github/scripts/test_moderate_labels.py new file mode 100644 index 0000000..2acf2ec --- /dev/null +++ b/.github/scripts/test_moderate_labels.py @@ -0,0 +1,34 @@ +"""Guard: every label `moderate-setup.yml` creates has a description GitHub accepts. + +`gh label create` fails with HTTP 422 when a description is longer than 100 +characters, and only the manually dispatched workflow ever runs it, so the +limit is checked here. +""" + +from __future__ import annotations + +import re +import unittest +from pathlib import Path + +WORKFLOW = Path(__file__).resolve().parent.parent / "workflows" / "moderate-setup.yml" +MAX_DESCRIPTION = 100 # GitHub's label description limit, in characters +CREATE_LINE = re.compile(r'^\s*create\s+"([^"]+)"\s+"([^"]+)"\s+"([^"]*)"\s*$', re.MULTILINE) + + +class ModerateLabelsTest(unittest.TestCase): + def test_label_descriptions_fit_githubs_limit(self) -> None: + text = WORKFLOW.read_text(encoding="utf-8") + labels = CREATE_LINE.findall(text) + self.assertTrue(labels, "no create lines parsed from moderate-setup.yml") + for name, _color, description in labels: + with self.subTest(label=name): + self.assertLessEqual( + len(description), + MAX_DESCRIPTION, + f"{name!r} description is {len(description)} characters", + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/.github/template-sync-state.json b/.github/template-sync-state.json index f874e20..d007efe 100644 --- a/.github/template-sync-state.json +++ b/.github/template-sync-state.json @@ -1,4 +1,4 @@ { "template_repo": "craftainer/template-base", - "synced_tag": "v1.14.0" + "synced_tag": "v1.14.2" } diff --git a/.github/workflows/moderate-setup.yml b/.github/workflows/moderate-setup.yml index 89851b5..57d73f7 100644 --- a/.github/workflows/moderate-setup.yml +++ b/.github/workflows/moderate-setup.yml @@ -36,5 +36,5 @@ jobs: create "enhancement:plan-ready" "c5def5" "Feature triage pushed a plan doc, awaiting a maintainer's enhancement:confirm label" create "enhancement:confirm" "c5def5" "Maintainer action: confirm the plan and start the build (removed when the build run starts)" create "enhancement:built" "c5def5" "Build PR opened, awaiting human review/merge" - create "claude:ok" "0e8a16" "Maintainer opt-in: run the moderation pipeline for this issue despite the reporter not being a collaborator" + create "claude:ok" "0e8a16" "Maintainer opt-in: moderate this issue although the reporter is not a collaborator" create "needs-human" "b60205" "The moderation pipeline got stuck and needs a maintainer"