luxe update and /update, editable question answers, and a version bump owed once per release
- luxe update and /update update Luxe with the command for however it was installed (cargo or Homebrew), run one program at a time with the terminal attached, then check that the luxe on PATH is the new version. Luxe never downloads or replaces its own binary. The start screen says "Update available · /update". - A question's typed answer edits at its caret: arrows, word jumps, Home, End and Delete work, and up and down move through a wrapped answer before leaving it. - The version check owes a bump once per release: the version on main is the next release, and only a released one (a v-tag) has to move. - Dependency updates arrive through the sync, so Dependabot and the weekly jobs no longer run here.
This commit is contained in:
0
scripts/ci-changes.py
Normal file → Executable file
0
scripts/ci-changes.py
Normal file → Executable file
@@ -1,11 +1,11 @@
|
||||
# Functions allowed over clippy's too_many_lines threshold. See scripts/fn-length-check.py.
|
||||
# <lines[,lines…]> <path> <fn> # reason
|
||||
399 crates/luxe-tui/src/commands/built_in.rs built_in # the command catalog: one `Command` literal per entry, no logic to pull out, so a new command raises this by its own entry
|
||||
406 crates/luxe-tui/src/commands/built_in.rs built_in # the command catalog: one `Command` literal per entry, no logic to pull out, so a new command raises this by its own entry
|
||||
369 crates/luxe-tui/src/app/messages.rs reduce_inner # the `Msg` reducer, one arm per message and nearly all of them one call; the fat arms already live in `app::messages::*`
|
||||
353 crates/luxe-tui/src/app/commands.rs dispatch_action # maps each `UiAction` to the one call that handles it; arms are a line or two and a handler that grows moves out
|
||||
257 crates/luxe-tui/src/app/events.rs reduce # the `Event` reducer, one arm per engine event; the long arms delegate to `app::events::*`
|
||||
223 crates/luxe-core/src/engine/run.rs run # the engine action loop, a dispatch over `Action` where each arm is one handler call; the arms that did real work are methods
|
||||
203 crates/luxe-tui/src/app/commands/slash.rs run_slash # maps each slash command to the handler that runs it; the arms that grew are in `commands::*`
|
||||
204 crates/luxe-tui/src/app/commands/slash.rs run_slash # maps each slash command to the handler that runs it; the arms that grew are in `commands::*`
|
||||
128 crates/luxe-core/src/engine/turn.rs run_turn # the turn state machine: its `break`s and early returns share the loop state, and every step that could stand alone (compact, stream, commit, tools, wrap-up) already does
|
||||
127 crates/luxe-tui/src/main_loop/click.rs clicked_target # one arm per mouse target, each a view guard and one message or a call into a named handler
|
||||
125 crates/luxe-cli/src/cli/rpc/translate.rs to_engine_action # the RPC vocabulary mapped onto `Action`, one thin arm per variant
|
||||
|
||||
@@ -3,8 +3,11 @@
|
||||
|
||||
Compares the workspace version against a base ref, normally the pull request's target:
|
||||
|
||||
- a change to what reaches crates.io (anything under `crates/`, `Cargo.toml`, `Cargo.lock`) has to
|
||||
raise the version, and by exactly one semver step, so a typo cannot skip a release;
|
||||
- a change to what reaches crates.io (anything under `crates/`, `Cargo.toml`, `Cargo.lock`) on top
|
||||
of a released version has to raise it, and by exactly one semver step, so a typo cannot skip a
|
||||
release. A version is released once a `v<version>` tag marks it. Until then it already names the
|
||||
release this change will ship in, so no bump is owed; it may still move, but only to another
|
||||
single step past the last release, as when a breaking change turns a pending patch into a minor;
|
||||
- the version never goes down, shipped change or not;
|
||||
- every internal path dependency names the workspace version, because cargo publishes that number
|
||||
and a stale `0.1.0` still resolves locally against a `0.1.1` beside it;
|
||||
@@ -116,8 +119,8 @@ def problems(base_ref: str) -> list[str]:
|
||||
found = []
|
||||
if precedence(head) < precedence(base):
|
||||
found.append(f"the version went down: {base} -> {head}")
|
||||
elif ships(changed) and not is_one_step(base, head):
|
||||
found.append(bump_message(base, head))
|
||||
elif ships(changed) and (problem := shipped_problem(base, head, released())):
|
||||
found.append(problem)
|
||||
manifests = {str(p.relative_to(ROOT)): p.read_text() for p in ROOT.glob("crates/*/Cargo.toml")}
|
||||
found += [f"internal dependency not pinned to {head}: {pin}" for pin in stale_pins(manifests, head)]
|
||||
changelog = ROOT / "CHANGELOG.md"
|
||||
@@ -126,6 +129,30 @@ def problems(base_ref: str) -> list[str]:
|
||||
return found
|
||||
|
||||
|
||||
def released() -> list[str]:
|
||||
"""Every version a `v<version>` tag marks."""
|
||||
tags = git("tag", "--list", "v*").split()
|
||||
return [tag[1:] for tag in tags if SEMVER.match(tag[1:])]
|
||||
|
||||
|
||||
def shipped_problem(base: str, head: str, released: list[str]) -> str | None:
|
||||
"""What is wrong with `head` for a change that ships on top of `base`, or `None`.
|
||||
|
||||
A released base owes one step. An unreleased one already names the coming release, so it may
|
||||
stay, or move to another single step past the last release before it.
|
||||
"""
|
||||
if base in released:
|
||||
return None if is_one_step(base, head) else bump_message(base, head)
|
||||
if head == base:
|
||||
return None
|
||||
earlier = [version for version in released if precedence(version) < precedence(base)]
|
||||
last = max(earlier, key=precedence, default=None)
|
||||
if is_one_step(last or base, head):
|
||||
return None
|
||||
since = f"the last release, {last}" if last else f"{base}, which is not released yet"
|
||||
return f"{head} is not one semver step past {since}"
|
||||
|
||||
|
||||
def bump_message(base: str, head: str) -> str:
|
||||
"""Says what a shipped change needed, naming the three versions it could have taken."""
|
||||
major, minor, patch, _ = parse(base)
|
||||
|
||||
@@ -146,11 +146,17 @@ class AgainstARepository(unittest.TestCase):
|
||||
self.run_git("add", "-A")
|
||||
self.run_git("-c", "user.name=t", "-c", "user.email=t@example.invalid", "commit", "-qm", message)
|
||||
|
||||
def test_a_shipped_change_without_a_bump_fails(self):
|
||||
def test_a_shipped_change_on_a_released_version_without_a_bump_fails(self):
|
||||
self.run_git("tag", "v0.1.0", "main")
|
||||
self.write("crates/a/src/lib.rs", "pub fn new() {}\n")
|
||||
self.commit("change")
|
||||
self.assertIn("leaves the version at 0.1.0", " ".join(vc.problems("main")))
|
||||
|
||||
def test_a_shipped_change_on_an_unreleased_version_needs_no_bump(self):
|
||||
self.write("crates/a/src/lib.rs", "pub fn new() {}\n")
|
||||
self.commit("change")
|
||||
self.assertEqual(vc.problems("main"), [])
|
||||
|
||||
def test_a_shipped_change_with_a_bump_passes(self):
|
||||
self.write("crates/a/src/lib.rs", "pub fn new() {}\n")
|
||||
self.write_version("0.1.1")
|
||||
@@ -163,5 +169,30 @@ class AgainstARepository(unittest.TestCase):
|
||||
self.assertEqual(vc.problems("main"), [])
|
||||
|
||||
|
||||
class ShippedProblem(unittest.TestCase):
|
||||
"""The bump a shipped change owes, given which versions have been released."""
|
||||
|
||||
def test_a_released_base_owes_one_step(self):
|
||||
self.assertIsNone(vc.shipped_problem("0.1.0", "0.1.1", ["0.1.0"]))
|
||||
self.assertIn("leaves the version", vc.shipped_problem("0.1.0", "0.1.0", ["0.1.0"]))
|
||||
self.assertIn("not one semver step", vc.shipped_problem("0.1.0", "0.1.2", ["0.1.0"]))
|
||||
|
||||
def test_an_unreleased_base_already_names_the_release(self):
|
||||
self.assertIsNone(vc.shipped_problem("0.1.1", "0.1.1", ["0.1.0"]))
|
||||
self.assertIsNone(vc.shipped_problem("0.1.0", "0.1.0", []), "before any release")
|
||||
|
||||
def test_an_unreleased_base_moves_only_one_step_past_the_last_release(self):
|
||||
self.assertIsNone(vc.shipped_problem("0.1.1", "0.2.0", ["0.1.0"]), "patch became minor")
|
||||
self.assertIn("last release, 0.1.0", vc.shipped_problem("0.1.1", "0.1.2", ["0.1.0"]))
|
||||
|
||||
def test_with_no_release_the_base_is_the_reference(self):
|
||||
self.assertIsNone(vc.shipped_problem("0.1.0", "0.2.0", []))
|
||||
self.assertIn("not released yet", vc.shipped_problem("0.1.0", "0.3.0", []))
|
||||
|
||||
def test_a_later_release_on_another_line_is_not_the_reference(self):
|
||||
# A 1.0.0 tagged elsewhere does not make 0.2.0 a skip from the 0.1.x line
|
||||
self.assertIsNone(vc.shipped_problem("0.1.1", "0.2.0", ["0.1.0", "1.0.0"]))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user