Skip to content

fix(nightly): monotonic sub-day nightly versions#841

Merged
thinmintdev merged 1 commit into
mainfrom
fix/nightly-monotonic-version
Jun 15, 2026
Merged

fix(nightly): monotonic sub-day nightly versions#841
thinmintdev merged 1 commit into
mainfrom
fix/nightly-monotonic-version

Conversation

@thinmintdev

Copy link
Copy Markdown
Contributor

Problem

Nightly versions were date-only (YYYYMMDD). Two cuts on the same calendar day produced the same version string, e.g. 0.5.1-nightly.20260615. The updater's _version_tuple comparison saw no change and hal0 update --channel nightly silently skipped the newer build.

Fix

  • .github/workflows/nightly.yml: stamp changed from date -u +%Y%m%ddate -u +%Y%m%d%H%M%S, producing YYYYMMDDHHMMSS (e.g. 0.5.1-nightly.20260615143022). Every cut is now strictly monotonic.
  • src/hal0/release/channel.py: renamed date param to stamp in nightly_version/nightly_tag; updated all docstrings to document the new format and explain backward-compatibility with legacy date-only tags.

No logic changes needed

_version_tuple splits on . and int-parses each segment, stripping non-digits. (0,5,1,20260615143022) > (0,5,1,20260615) already holds. _NIGHTLY_RE and nightlies_to_prune both already handle any-length digit strings. Only stamps, docstrings, and tests changed.

Backward compatibility

Legacy YYYYMMDD tags order correctly below any YYYYMMDDHHMMSS tag with the same date prefix (8-digit integer < 14-digit integer). Pruning also sorts them correctly.

Tests added

  • test_nightly_version_uses_full_stamp_and_is_monotonic — verifies the new stamp passes through verbatim
  • test_nightlies_to_prune_orders_by_full_numeric_stamp — verifies legacy date-only tag sorts below timestamp tags and is pruned first
  • test_version_tuple_timestamp_nightly_beats_date_only_same_base — regression-locks _version_tuple ordering for timestamp vs. date-only nightlies

All 62 tests pass (tests/release/ + tests/updater/).

🤖 Generated with Claude Code

…onic

Nightly versions used YYYYMMDD; two cuts on the same day produced an
identical version string that the updater's _version_tuple comparison
couldn't distinguish, so `hal0 update --channel nightly` would silently
skip the new build.  Switch the nightly workflow stamp to YYYYMMDDHHMMSS
so every cut is strictly greater.

_version_tuple, _NIGHTLY_RE, and nightlies_to_prune required no logic
changes — they already handle variable-length numeric segments.  Rename
the `date` param to `stamp` in nightly_version/nightly_tag and update
docstrings throughout.  Regression tests added for both the channel
helpers and the _version_tuple ordering.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@thinmintdev thinmintdev merged commit bb4fba6 into main Jun 15, 2026
3 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.

1 participant