Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion IMAGE_TAG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.3
0.3.4
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
64 changes: 43 additions & 21 deletions scripts/bump_consumers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand Down
Loading