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..6a6d261 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,29 @@ 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 - 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) - failed.append(repo) + current, stale, failed = survey(repos, args.version) + opened = [] + 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 + # 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 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) return 1