diff options
| author | Pjotr <wrk@bosa.lan> | 2026-11-07 17:23:20 +0000 |
|---|---|---|
| committer | Pjotr <wrk@bosa.lan> | 2026-11-07 17:23:20 +0000 |
| commit | 555fe06b0ab72240f254206f0f0c4ddf76ec00c5 (patch) | |
| tree | 134ef18c7b7f0b433f8baa39c3d9590e4698a156 /src | |
| parent | 2307d5e2db5ce8efae19a647bd48b4311be34607 (diff) | |
| download | genenetwork4-555fe06b0ab72240f254206f0f0c4ddf76ec00c5.tar.gz | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib.rs | 32 |
1 files changed, 14 insertions, 18 deletions
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<Envelope<VersionInfo>> { 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"), + })) } |
