Skip to content

fix(dist_bump): tolerate macro-based Release fields (carries #100) - #138

Merged
hanthor merged 4 commits into
mainfrom
fix/dist-bump-macro-release
Sep 18, 2026
Merged

hanthor merged 4 commits into
mainfrom
fix/dist-bump-macro-release

Conversation

@hanthor

@hanthor hanthor commented Sep 18, 2026

Copy link
Copy Markdown
Member

Carries @kylerankin's #100 onto today's main. That branch lives on a fork, so this is its two commits, a merge of main, and the one change the review asked for.

What #100 does: spec_release() takes the literal segment before the first unexpanded macro — the 5 in 5%{?gitdate:…}%{?dist}, the 1 in 1%{?pre_tag}%{?dist} — so those recipes support real dist bumps instead of crashing build-stage.yml with BumpError. A release that is only macros (%autorelease, %{baserelease}) has nothing literal to compare, so the bump is skipped with a line on stderr rather than guessed at. Preferred over the competing #118 (a hand-written macro expander) for the reasons on that PR.

The one change: spec_release() returns None rather than "" for the macro-only case, because tools/rebuild_plan.py (from #70, newer than #100) reads the same function and treats None as "no comparable release"; "" made expected_release() concatenate a suffix onto nothing and fail test_an_autorelease_recipe_falls_back_to_the_version. expected_release() now also short-circuits on None explicitly instead of relying on BumpError.

Verified: 316 tests pass on the merged tree; validate reports 340.

🤖 Generated with Claude Code

https://claude.ai/code/session_01W6BYLUD6KBzF8rBFXKjP7M


Generated by Claude Code

kylerankin and others added 4 commits September 13, 2026 21:54
tools/dist_bump.py raised BumpError on any Release: containing a macro,
which the CLI turned into an exit 1 that broke build-stage.yml for any
package with a dist_bump configured -- bootc, libical (%autorelease),
pipewire (%{baserelease}...), firefox (1%{?pre_tag}...) and the X11
libraries (5%{?gitdate:...}...).

spec_release now takes the literal release that precedes the first
unexpanded macro -- the stable segment a recorded baseline compares
against -- so firefox and the X11 libs support real dist bumps. A release
that is only macros has nothing literal to compare, so the bump is
skipped (empty suffix) instead of crashing.

Covered by tests/test_dist_bump.py: leading-segment extraction and the
pure-macro no-bump path replace the old refuse-to-parse test.

Signed-off-by: kylerankin <kylerankin@users.noreply.github.com>
… docs

- Cover bare %autorelease (and %autorelease -b3) in the purely-macro test;
  103/107 purely-macro specs use the bare form, not the braced one.
- Log the empty-release skip on stderr so build-stage.yml does not drop a
  rebuild silently (a silent "" ships an RPM that does not supersede).
- Drop the dead .strip(): a (\\S+) capture carries no whitespace.
- Re-target the docs at the extract-leading-literal behaviour and note the
  divergence from Hummingbird's bump_release().
tools/rebuild_plan.py (from #70) reads spec_release() too and treats None as
"no comparable release"; "" made it concatenate a suffix onto nothing and
fail test_an_autorelease_recipe_falls_back_to_the_version. The plan now
also short-circuits on None explicitly instead of relying on BumpError.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6BYLUD6KBzF8rBFXKjP7M
@hanthor
hanthor merged commit a8ab8e0 into main Sep 18, 2026
4 checks passed
@repires

repires commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

This PR's merge resolves issue #96. Note that only a maintainer editing the body makes the merge close it.

— hive: backend=agy

🐝 Hive Agent: contributor | SHA: unknown

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.

4 participants