Compare commits
1 Commits
v1.0.0
...
7ebdc9c722
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ebdc9c722 |
@@ -16,6 +16,14 @@ for 1.0.0 have something to be assembled from.
|
||||
|
||||
## Unreleased
|
||||
|
||||
## 1.0.1
|
||||
|
||||
- Fixed: the Updates page showed **"v1.0.0 (reports 1.0.0)"** — two spellings of
|
||||
one version, in a note whose whole purpose is to warn that a tag was cut
|
||||
before the version bump. `git describe` answers with the tag's name, and tags
|
||||
here carry a `v`. Found by cutting the first release, which is the only place
|
||||
it could have been.
|
||||
|
||||
## 1.0.0
|
||||
|
||||
The first release. Every version before it shipped as a running deployment
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
"""LLeMbas - a Middle-earth themed web UI for OpenAI-compatible LLM endpoints."""
|
||||
|
||||
__version__ = "1.0.0"
|
||||
__version__ = "1.0.1"
|
||||
|
||||
@@ -340,7 +340,7 @@ def resolve_target(root: Path, channel: str, branch: str) -> Target | None:
|
||||
return None
|
||||
return Target(
|
||||
ref=tag,
|
||||
label=tag.lstrip("v"),
|
||||
label=tag.removeprefix("v"),
|
||||
sha=commit.sha,
|
||||
subject=commit.subject,
|
||||
notes=_notes_for(root, tag),
|
||||
@@ -362,9 +362,16 @@ def _describe(root: Path) -> str:
|
||||
bare short sha when nothing has ever been tagged. That last case is why
|
||||
`--always` is there: without it this fails outright on a repository with no
|
||||
tags, which is every repository before its first release.
|
||||
|
||||
The leading `v` comes off, because git answers with the **tag's name** and
|
||||
tags here are `v1.0.0` while `__version__` is `1.0.0`. Without this the page
|
||||
read "v1.0.0 (reports 1.0.0)" -- a note whose whole purpose is to flag a tag
|
||||
cut before a version bump, firing on two spellings of the same version. The
|
||||
first release is what showed it. `resolve_target` has always stripped it for
|
||||
the same reason, and this docstring already promised the stripped form.
|
||||
"""
|
||||
code, output = _git(["describe", "--tags", "--always", "--dirty="], cwd=root)
|
||||
return output if code == 0 else ""
|
||||
return output.removeprefix("v") if code == 0 else ""
|
||||
|
||||
|
||||
def read(*, fetch: bool = False) -> State:
|
||||
@@ -418,8 +425,8 @@ def read(*, fetch: bool = False) -> State:
|
||||
# Exactly at a tag whose name disagrees with the version this process
|
||||
# reports. No subprocess: `running` and `__version__` are both already here.
|
||||
mismatch = ""
|
||||
if RELEASE_TAG.match(running) and running.lstrip("v") != __version__:
|
||||
mismatch = running.lstrip("v")
|
||||
if RELEASE_TAG.match(running) and running != __version__:
|
||||
mismatch = running
|
||||
|
||||
return State(
|
||||
**base,
|
||||
|
||||
@@ -509,3 +509,39 @@ def test_a_reinstall_does_not_move_the_channel_by_itself():
|
||||
assert 'CHANNEL="${LEMBAS_CHANNEL:-${_installed_channel:-stable}}"' in install
|
||||
# Parsed rather than sourced: that file holds the secret key.
|
||||
assert ". $PREFIX/lembas.env" not in install
|
||||
|
||||
|
||||
def test_the_running_version_is_not_two_spellings_of_itself(db, tagged):
|
||||
"""`git describe` answers with the **tag's name**, and tags here are
|
||||
`v1.0.0` while `__version__` is `1.0.0`. The page prints the described
|
||||
version and appends "(reports X)" when the two disagree -- a note whose
|
||||
whole purpose is to flag a tag cut *before* a version bump.
|
||||
|
||||
Unstripped, it fired on the first release: "v9.9.9 (reports 9.9.9)", which
|
||||
reads as a discrepancy and is two ways of writing one version. Found by
|
||||
cutting the release, which is the only place it could have been.
|
||||
"""
|
||||
root = updates.checkout_dir()
|
||||
running = updates._describe(root)
|
||||
|
||||
assert not running.startswith("v"), running
|
||||
assert running.startswith("9.9.9"), running
|
||||
|
||||
|
||||
def test_a_tag_that_really_disagrees_is_still_reported(db):
|
||||
"""The note has to keep working, or stripping the prefix has removed the
|
||||
check rather than fixed it. A tag cut before the version bump names a
|
||||
release nobody can identify afterwards."""
|
||||
import subprocess
|
||||
|
||||
root = updates.checkout_dir()
|
||||
subprocess.run(
|
||||
["git", "tag", "-a", "v99.0.0", "-m", "Wrong."],
|
||||
cwd=root, check=True, capture_output=True,
|
||||
)
|
||||
try:
|
||||
assert updates.read().version_mismatch == "99.0.0"
|
||||
finally:
|
||||
subprocess.run(
|
||||
["git", "tag", "-d", "v99.0.0"], cwd=root, check=False, capture_output=True
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user