From 89f7decbea296181568ccf0109dee53dc97cb2e9 Mon Sep 17 00:00:00 2001 From: Scott McCarty Date: Wed, 4 Nov 2026 15:57:51 -0500 Subject: [PATCH 1/2] fix: v0.3.4 bump-consumers says what it did The job printed nothing when it had nothing to bump and nothing when it could not open a pull request, so the two were indistinguishable from the outside. That is how RT#1553 survived two releases: the crunchtools-ci App had no `pull_requests: write`, every `gh pr create` was refused, and the job still read as green and quiet. It now always ends with a count -- repos pinning python-sdlc, bumped, already current, failed -- and says so on stderr if no repo pins it at all, which would mean the discovery itself had broken. The per-repo survey moved into its own function to keep main() under the complexity gate. The permission is now granted on the crunchtools installation, so this release doubles as the first live test of the pull-request path: trentina pins v0.3.3 and should receive a bump PR nobody opened by hand. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01R7Y1jg2DfucoFv7VrzzwVR --- CHANGELOG.md | 13 +++++++++ Containerfile | 2 +- IMAGE_TAG | 2 +- README.md | 2 +- pyproject.toml | 2 +- scripts/bump_consumers.py | 57 ++++++++++++++++++++++++++------------- 6 files changed, 56 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27e11ba..5bddb27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,19 @@ All notable changes to this project are documented here, following ## [Unreleased] +## [0.3.4] - 2026-11-04 + +### Fixed + +- **`bump-consumers` says what it did.** The job printed nothing when it had + nothing to bump and nothing when it could not open a pull request, so the two + looked identical from the outside. That is how RT#1553 survived two releases: + the `crunchtools-ci` App had no `pull_requests: write`, every `gh pr create` + was refused, and the job still read as green and quiet. It now always ends + with a count -- how many repos pin python-sdlc, how many were bumped, how + many were already there, how many failed -- and says so loudly if no repo + pins it at all. + ## [0.3.3] - 2026-11-04 ### Fixed diff --git a/Containerfile b/Containerfile index 7a27d2c..25a21ba 100644 --- a/Containerfile +++ b/Containerfile @@ -44,7 +44,7 @@ LABEL description="Every CrunchTools Python SDLC check in one image: ruff, mypy, LABEL org.opencontainers.image.source="https://github.com/crunchtools/python-sdlc" LABEL org.opencontainers.image.description="Every CrunchTools Python SDLC check in one image." LABEL org.opencontainers.image.licenses="AGPL-3.0-or-later" -LABEL version="0.3.3" +LABEL version="0.3.4" # What the image carries, readable without starting anything. `sdlc versions` # prints these and a consuming repo's CI pins them. diff --git a/IMAGE_TAG b/IMAGE_TAG index 1c09c74..42045ac 100644 --- a/IMAGE_TAG +++ b/IMAGE_TAG @@ -1 +1 @@ -0.3.3 +0.3.4 diff --git a/README.md b/README.md index f3498b7..ce5b1ba 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ default_install_hook_types: [pre-commit, pre-push] repos: - repo: https://github.com/crunchtools/python-sdlc - rev: v0.3.3 + rev: v0.3.4 hooks: - id: sdlc-commit - id: sdlc-push diff --git a/pyproject.toml b/pyproject.toml index 334bf4a..cbc42f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ [project] name = "python-sdlc" -version = "0.3.3" +version = "0.3.4" description = "One container image and one script for every CrunchTools Python SDLC check" requires-python = ">=3.14" license = "AGPL-3.0-or-later" diff --git a/scripts/bump_consumers.py b/scripts/bump_consumers.py index d0aeb4b..483b21f 100755 --- a/scripts/bump_consumers.py +++ b/scripts/bump_consumers.py @@ -111,6 +111,26 @@ def git(*a: str) -> None: return url +def survey(repos: list[str], version: str) -> tuple[list[str], list[str], list[str]]: + """Split repos into those pinning `version`, those behind it, and unreadable ones.""" + current, stale, failed = [], [], [] + for repo in repos: + try: + rev = pinned_rev(repo) + except RuntimeError as read_error: + print(f"{repo}: {read_error}", file=sys.stderr) + failed.append(repo) + continue + if rev is None: + continue + if rev == version: + current.append(repo) + continue + print(f"{repo}: {rev} -> {version}") + stale.append(repo) + return current, stale, failed + + def main() -> int: ap = argparse.ArgumentParser() ap.add_argument("version") @@ -122,27 +142,28 @@ def main() -> int: return 2 repos = args.only.split(",") if args.only else org_repos() - failed = [] - for repo in repos: - try: - rev = pinned_rev(repo) - except RuntimeError as read_error: - print(f"{repo}: {read_error}", file=sys.stderr) - failed.append(repo) - continue - if rev is None or rev == args.version: - continue - print(f"{repo}: {rev} -> {args.version}") - if args.dry_run: - continue + current, stale, failed = survey(repos, args.version) + opened = [] + for repo in [] if args.dry_run else stale: try: print(f" {bump(repo, args.version)}") - except subprocess.CalledProcessError as command_error: - print(f" FAILED: {command_error}: {command_error.stderr}", file=sys.stderr) - failed.append(repo) - except RuntimeError as bump_error: - print(f" FAILED: {bump_error}", file=sys.stderr) + opened.append(repo) + except (subprocess.CalledProcessError, RuntimeError) as bump_error: + detail = getattr(bump_error, "stderr", "") or "" + print(f" FAILED: {bump_error}: {detail}".rstrip(": "), file=sys.stderr) failed.append(repo) + + # Always say what happened. A run with nothing to do and a run that could + # not open a pull request both used to print nothing at all, which is how + # RT#1553 -- the App had no `pull_requests: write` -- survived two releases + # looking like a job that had half worked. + did = f"{len(stale)} would be bumped" if args.dry_run else f"{len(opened)} bumped" + print( + f"{len(current) + len(stale)} repo(s) pin python-sdlc: " + f"{did} to {args.version}, {len(current)} already there, {len(failed)} failed" + ) + if not current and not stale: + print("no repo pins python-sdlc; nothing was bumped", file=sys.stderr) if failed: print(f"rerun with --only {','.join(failed)}", file=sys.stderr) return 1 From 5c345f9254d0eea0d98baca187ca43e965a84d10 Mon Sep 17 00:00:00 2001 From: Scott McCarty Date: Wed, 4 Nov 2026 16:21:10 -0500 Subject: [PATCH 2/2] fix: answer Gatehouse on the bump-consumers summary Both findings were right. "No repo pins python-sdlc" is only knowable when every repo was actually read, so it is now suppressed when any lookup failed -- otherwise a fleet-wide rate limit would print a confident claim about pins nobody looked at. And the dry-run skip is an explicit `if not args.dry_run:` rather than iterating an empty list. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01R7Y1jg2DfucoFv7VrzzwVR --- scripts/bump_consumers.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/scripts/bump_consumers.py b/scripts/bump_consumers.py index 483b21f..6a6d261 100755 --- a/scripts/bump_consumers.py +++ b/scripts/bump_consumers.py @@ -144,14 +144,15 @@ def main() -> int: repos = args.only.split(",") if args.only else org_repos() current, stale, failed = survey(repos, args.version) opened = [] - for repo in [] if args.dry_run else stale: - try: - print(f" {bump(repo, args.version)}") - opened.append(repo) - except (subprocess.CalledProcessError, RuntimeError) as bump_error: - detail = getattr(bump_error, "stderr", "") or "" - print(f" FAILED: {bump_error}: {detail}".rstrip(": "), file=sys.stderr) - failed.append(repo) + if not args.dry_run: + for repo in stale: + try: + print(f" {bump(repo, args.version)}") + opened.append(repo) + except (subprocess.CalledProcessError, RuntimeError) as bump_error: + detail = getattr(bump_error, "stderr", "") or "" + print(f" FAILED: {bump_error}: {detail}".rstrip(": "), file=sys.stderr) + failed.append(repo) # Always say what happened. A run with nothing to do and a run that could # not open a pull request both used to print nothing at all, which is how @@ -162,7 +163,7 @@ def main() -> int: f"{len(current) + len(stale)} repo(s) pin python-sdlc: " f"{did} to {args.version}, {len(current)} already there, {len(failed)} failed" ) - if not current and not stale: + if not current and not stale and not failed: print("no repo pins python-sdlc; nothing was bumped", file=sys.stderr) if failed: print(f"rerun with --only {','.join(failed)}", file=sys.stderr)