8000 Show a 3.0.0 prerelease: version parser rejects vX.Y.Z-alpha.N, and git_ref origin/v3 breaks after the branch move · Issue #106 · project-minigraf/minigraf-docs · GitHub
[go: up one dir, main page]

Skip to content

Show a 3.0.0 prerelease: version parser rejects vX.Y.Z-alpha.N, and git_ref origin/v3 breaks after the branch move #106

Done

Description

@adityamukho

The site can't represent a Minigraf prerelease.

  • src/version.rs Version::parse splits on . and requires exactly three numeric parts, so v3.0.0-alpha.1 fails with "is not a number". The version-time mapping ((2000+MAJOR)-01-01 + MINOR days + PATCH seconds) has no slot for a prerelease either.
  • Content is annotated @since v3.0.0. Under semver, 3.0.0-alpha.1 < 3.0.0, so if the alpha became its own version every v3 fragment would be hidden on it.
  • site.toml has tag = "v3.0.0", released = false, git_ref = "origin/v3". That ref breaks when core's v3 branch is renamed to main (release: move v3 to main and main to v2.x at the 3.0.0-alpha minigraf#937).

Options for the alpha:

  1. Keep the single unreleased v3.0.0 entry and point git_ref at the alpha tag (v3.0.0-alpha.1), labelling it "3.0.0 preview (alpha.1)". No parser change.
  2. Support prerelease versions: parse -alpha.N, order them before the release, and treat @since v3.0.0 as covering its prereleases.

Option 1 is the smaller change. Whichever is chosen must follow the core prerelease policy (project-minigraf/minigraf#928).

Also, the local checkout is 2 commits behind origin/main (housekeeping only).

Activity

  1. adityamukho commented on Nov 29, 2026

    @adityamukho
    ContributorAuthor

    Corrections (Codex review): ignore the 'local checkout is 2 commits behind' note; it was about my local clone and isn't a repo issue. v3.0.0-alpha.1 actually fails the component-count check first ('must be vMAJOR.MINOR.PATCH'), not the numeric check. Option 1 also needs a display change: config.rs:34 has no label field and site.rs:70 renders 'unreleased'. Published alpha docs should read the immutable alpha tag; only a separate development preview should follow origin/main. /latest/ must keep following the newest stable v2 release, including future v2 patches (main.rs:228 picks the last released entry).

  2. adityamukho commented on Nov 30, 2026

    @adityamukho
    ContributorAuthor

    Decided in project-minigraf/minigraf#928 (2026-11-30): the version is 3.0.0-alpha; later prereleases are -beta, -rc1, -rc2, … (a second alpha or beta would be -alpha2 / -beta2). The alpha is the first v3 release and triggers the branch move (project-minigraf/minigraf#937). So this issue takes option 2: prereleases become site versions, with a fixed place on the version-time axis.

    Proposed convention

    Today millis(vX.Y.Z) = ((days(2000+X-01-01) + Y) × 86,400 + Z) × 1000, so version times are whole seconds, and the second before vX.Y.Z belongs to the previous version (vX.Y.(Z−1), the maximum patch 86,399 of the previous minor, or the previous year). The 999 milliseconds in between are free. A prerelease goes there:

    millis(vX.Y.Z-<stage><N>) = millis(vX.Y.Z) − 1000 + base(stage) + N
      alpha → base 100   (v3.0.0-alpha = +100, -alpha2 = +102)
      beta  → base 400
      rc    → base 700   (rc1 = +701, rc2 = +702)
      N ≤ 99
    

    Every prerelease then sorts after the previous release and before its own release, in semver order. For v3.0.0-alpha that is 2002-12-31T23:59:59.100Z. The property test (version_time_follows_semver) should cover prereleases, including vX.Y.86399 < vX.(Y+1).0-alpha.

    What changes

    • Version::parse accepts -alpha[N], -beta[N], -rcN and rejects anything else. Version gets an optional prerelease field, and ordering puts a release after its prereleases (so derived Ord can't be used as is). Display round-trips, which also gives the URL path (/v3.0.0-alpha/).
    • site.toml: a released entry tag = "v3.0.0-alpha" reading the alpha tag (CHANGELOG and error reference from that immutable tag). Keep a separate unreleased v3.0.0 development preview, with git_ref = "origin/main" after the move.
    • /latest/ (main.rs:228) picks the newest released non-prerelease entry, so it keeps following v2.x until 3.0.0. Prerelease pages carry a "prerelease" label in the version picker and banner (site.rs:70, config.rs:34).
    • Annotations. With strict ordering, @since v3.0.0 would hide all v3 text from the alpha. Before the alpha, rewrite the existing @since v3.0.0 → @since v3.0.0-alpha and @until v3.0.0 → @until v3.0.0-alpha (after checking the content matches what's on v3 at the alpha). From then on, annotate new v3.0.0 work with the prerelease that first ships it, or v3.0.0 if it first ships in the final release.
    • Semver compares rc10 before rc2 (alphanumeric identifiers sort as text), but this mapping wouldn't. Reject rc numbers ≥ 10 rather than disagree with the registries.
  3. added a commit that references this issue on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0