From 555fe06b0ab72240f254206f0f0c4ddf76ec00c5 Mon Sep 17 00:00:00 2001 From: Pjotr Date: Sat, 7 Nov 2026 17:23:20 +0000 Subject: version: no notes array, so the envelope's empty case stays meaningful *tests/envelope.rs* uses /version as its example of a response whose `notes` is an empty array; adding a note there broke that check for no gain -- the fields document themselves, and tests/version.rs asserts their shape. * src/lib.rs (version): drop the with_note, with a comment saying why. --- src/lib.rs | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index 42bc748..8fdda89 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -158,22 +158,18 @@ struct VersionInfo { #[gnauth(disabled)] async fn version(ctx: Ctx) -> Json> { let git = env!("GN4_GIT_HASH"); - Json( - ctx.envelope(VersionInfo { - name: "GeneNetwork4", - short_name: "GN4AI", - version: 4.0, - release: 1, - date: env!("GN4_COMMIT_DATE"), - git, - dirty: git.ends_with("-dirty"), - source_digest: env!("GN4_SOURCE_DIGEST"), - branch: env!("GN4_GIT_BRANCH"), - }) - .with_note( - "`git` is stamped when this binary was built; `-dirty` means the build had \ - uncommitted changes, and `source_digest` identifies the compiled sources even then. \ - A stamp is never advanced by committing without rebuilding.", - ), - ) + // No `notes` here: the fields say what they are (see VersionInfo's + // doc comments), and /version is the cheapest endpoint for the + // envelope test's "notes is an empty array" case. + Json(ctx.envelope(VersionInfo { + name: "GeneNetwork4", + short_name: "GN4AI", + version: 4.0, + release: 1, + date: env!("GN4_COMMIT_DATE"), + git, + dirty: git.ends_with("-dirty"), + source_digest: env!("GN4_SOURCE_DIGEST"), + branch: env!("GN4_GIT_BRANCH"), + })) } -- cgit 1.4.1