Skip to content

fix(version): look up the monthly tag without the v prefix - #5

Merged
mmmarinho merged 1 commit into
mainfrom
fix/version-tag-lookup
Sep 22, 2026
Merged

mmmarinho merged 1 commit into
mainfrom
fix/version-tag-lookup

Conversation

@mmmarinho

Copy link
Copy Markdown
Contributor

What this does

Fixes the rolling-version computation so the libmarinholab-sas-core .deb (and the CMake package version) actually track main instead of staying pinned at 26.09.00.

Problem

tools/version.sh looks up the monthly version tag as v${YY.MM} (e.g. v26.09), but the project's tags are bare (26.09):

  • The only tag in the repo is 26.09 (annotated → d488bb68), no v prefix.
  • The bare name is also the convention sas_py relies on: its setuptools-git-versioning uses dev_template = "{tag}.{ccount}", which is why PyPI shows 26.9.4/26.9.5 from tag 26.09.

Because refs/tags/v26.09 never exists, NN was always 0 → version.sh always returned 26.09.00, so:

  • tools/bump-changelog.sh never bumped debian/changelog (idempotent no-op),
  • the .deb version stayed 26.09.00 while the branch content moved,
  • cmake/GetVersion.cmake (which runs tools/version.sh) reported the same stale version.

With 5 commits after 26.09 on main, the version should have been 26.09.05.

Fix

tools/version.sh now looks up the monthly tag as YY.MM first, vYY.MM as a fallback — accepting either naming, preferring the project's actual (bare) convention. No tag renaming (renaming to v26.09 would break sas_py's PyPI versioning, which expects the bare tag).

find_version_tag() {
    local t
    for t in "${YYMM}" "v${YYMM}"; do
        if git rev-parse --verify "refs/tags/${t}" >/dev/null 2>&1; then
            printf '%s\n' "${t}"
            return 0
        fi
    done
    return 1
}

Single-file change (tools/version.sh); all consumers — bump-changelog.sh, cmake/GetVersion.cmake, docker/build.sh — funnel through it, so they all benefit with no changes of their own.

Verification

  • bash tools/version.sh on a clone of main (5 commits after 26.09): 26.09.05 (previously 26.09.00).
  • No monthly tag present → 26.09.00 (unchanged safe behavior).
  • Only v26.09 present → 26.09.05 (fallback works).
  • tools/bump-changelog.sh consumes the same version.sh output, so debian/changelog will now be stamped 26.09.05 before dpkg-buildpackage (the dch step is exercised in the sas_cpp docker env / SmartArmStack/smart_arm_stack_ROS2 PR fix(version): look up the monthly tag without the v prefix #5, where devscripts is installed).

Effect


This pull request was created by an AI agent (OpenHands) on behalf of the repository owner.

tools/version.sh only recognized a 'v'-prefixed monthly tag (v26.09),
but the project tags are bare (26.09), matching the convention sas_py's
setuptools-git-versioning builds PyPI versions from. As a result the
rolling component was always 00 and the .deb/CMake version stayed
26.09.00 while main kept moving.

Look up the monthly tag as 'YY.MM' first and fall back to 'vYY.MM'.
Verified: with 5 commits after 26.09 the script now reports 26.09.05
(previously 26.09.00); missing tag still reports 26.09.00; a v-prefixed
tag alone still works via the fallback.

Co-authored-by: openhands <openhands@all-hands.dev>

@mmmarinho mmmarinho left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

👍

@mmmarinho
mmmarinho merged commit 1414847 into main Sep 22, 2026
9 checks passed
@mmmarinho
mmmarinho deleted the fix/version-tag-lookup branch September 22, 2026 04:51
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