Skip to content

ci(release): the version guard never checked __init__.py#109

Merged
ColonistOne merged 1 commit into
mainfrom
fix/release-guard-checks-dunder-version
Jul 20, 2026
Merged

ci(release): the version guard never checked __init__.py#109
ColonistOne merged 1 commit into
mainfrom
fix/release-guard-checks-dunder-version

Conversation

@ColonistOne

Copy link
Copy Markdown
Collaborator

Found while cutting 1.28.0.

The build job asserts the tag matches pyproject.toml and stops there. src/colony_sdk/__init__.py carries the version users observe at runtime, and nothing validated it — so a bump to pyproject.toml alone publishes cleanly while colony_sdk.__version__ reports the previous release.

That failure is silent by construction. The artifact is correct, the package reports a lie, and it surfaces weeks later as a confusing bug report rather than a red build. 1.28.0 happened to have both files bumped together; the guard would not have complained if they had not been.

Verified by executing the guard, not by reading it

I extracted the run block from the YAML and ran it, because YAML → shell → Python quoting is exactly where this kind of change breaks:

scenario result
tag v1.28.0, both files 1.28.0 exit 0 — "Tag, pyproject.toml and __version__ all agree on 1.28.0"
tag v1.28.0, __version__ left at 1.27.0 exit 1 — names the offending file
that same half-bump under the old guard exit 0 — it would have published

One aside worth recording: my first local run was inconclusive because python is not on PATH in that environment, and the guard compared the tag against an empty string and "failed" for the wrong reason. A check that cannot distinguish versions differ from the interpreter is missing is a weak check — but on CI actions/setup-python guarantees python, and the extra hardening felt like scope creep in a one-step fix. Happy to add python3 fallback or a set -euo pipefail if you would rather.

The build job asserted the tag matched pyproject.toml and stopped there.
src/colony_sdk/__init__.py carries the version users actually observe at
runtime, and nothing validated it -- so bumping pyproject.toml alone would
publish cleanly while colony_sdk.__version__ reported the previous release.

That failure is silent by construction. The artifact is correct, the package
reports a lie, and it surfaces weeks later as a confusing bug report rather
than a red build. Noticed while cutting 1.28.0, where both files happened to
be bumped together -- the guard would not have complained if they had not been.

Verified both directions by extracting the run block from the YAML and
executing it, rather than reasoning about the YAML -> shell -> Python quoting:

  tag v1.28.0, both files 1.28.0     -> exit 0, "all agree on 1.28.0"
  tag v1.28.0, __version__ 1.27.0    -> exit 1, names the offending file
  same half-bump under the OLD guard -> exit 0, i.e. it would have published

The first local attempt was inconclusive because `python` is not on PATH in
that environment and the guard silently compared against an empty string --
which is its own small lesson about a check that cannot distinguish "versions
differ" from "the interpreter is missing". Re-run with python available.
@ColonistOne
ColonistOne merged commit 90f5577 into main Jul 20, 2026
6 checks passed
@ColonistOne
ColonistOne deleted the fix/release-guard-checks-dunder-version branch July 20, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant