Skip to content

fix: allow release changes in files a bump glob owns - #4

Merged
gonzalocasas merged 1 commit into
mainfrom
fix/release-check-glob-files
Sep 1, 2026
Merged

fix: allow release changes in files a bump glob owns#4
gonzalocasas merged 1 commit into
mainfrom
fix/release-check-glob-files

Conversation

@gonzalocasas

@gonzalocasas gonzalocasas commented Aug 28, 2026

Copy link
Copy Markdown
Member

release-check assumed every [[tool.bumpversion.files]] entry carried a filename, so a repository that points bump-my-version at a glob crashed with KeyError: 'filename' before any release metadata was validated. compas_eve hit this on its v2.4.0 release PR (compas-dev/compas_eve#32), which uses a glob for the Grasshopper component headers:

[[tool.bumpversion.files]]
glob = "src/compas_eve/ghpython/components/**/code.py"

What changed

  • configured_files returns literal names and globs instead of names alone. The changed-file check matches paths against the globs with PurePath.full_match, which handles the recursive ** the same way bump-my-version does.
  • full_match is Python 3.13, so the action asks setup-python for 3.13 rather than 3.12. The validate workflow already runs 3.13.
  • An entry with neither key is reported as a configuration error instead of a traceback.
  • The test fixture carries a glob entry, as a real configuration does, so the existing cases cover the crash too. One new case proves a glob-matched file is accepted.
  • README: the rule reads "files the version configuration owns, named either by filename or by glob", since "files listed by the version configuration" was the wording that implied literal names only.

Verification

  • On this branch: python -m unittest discover -s tests passes (3 tests). With check_release.py reverted to main's version, all 3 fail — so the suite genuinely covers the bug.
  • Run against compas_eve#32's real base/head/branch, the patched script exits 0 with is-release=true, version=2.4.0, tag=v2.4.0.

No overlap with #3, which touched only README.md and github-release/action.yml.

🤖 Generated with Claude Code

release-check assumed every [[tool.bumpversion.files]] entry carried a filename,
so a repository that points bump-my-version at a glob (compas_eve does, for its
Grasshopper component headers) crashed with KeyError: 'filename' before the
release could be validated at all.

Entries are now read as either a filename or a glob, and the changed-file check
matches paths against the globs with PurePath.full_match, which handles the
recursive ** the same way bump-my-version does. That needs Python 3.13, so the
action asks setup-python for it. An entry with neither key is reported as a
configuration error rather than a traceback.

The test fixture now carries a glob entry, as a real configuration does, so the
existing cases cover the crash too.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@gonzalocasas
gonzalocasas force-pushed the fix/release-check-glob-files branch from 89517db to cd3db8b Compare August 28, 2026 09:01
@gonzalocasas

Copy link
Copy Markdown
Member Author

@chenkasirer @Licini ping ;)

@chenkasirer chenkasirer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gonzalocasas
gonzalocasas merged commit 12ff286 into main Sep 1, 2026
2 checks passed
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.

2 participants