chore: derive RELEASE_VERSION from compile-time env #52
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "chore/derive-release-version-from-env"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stacked on top of #51.
Summary
RELEASE_VERSIONconstant inapi/sdk.rswithconcat!("v", env!("CARGO_PKG_VERSION"), "+", env!("PORTAL_RS_BUILD")).release_versionreturned by/sdk/domainnow matches--versionoutput and tracks the release tag automatically.release_versionfield with the runtime constant before comparing — every other field of the response is still pinned by the fixture.release_versionto a current-convention example (v2.1.8+rs.1) so it documents the new shape; the test override means the literal value no longer affects pass/fail.Why
With #51,
--versionoutput and the workspaceCargo.tomlversion are both build-time-driven. LeavingRELEASE_VERSIONas a hand-edited constant kept two sources of truth for the same fact and forced a separate code bump PR for every release (the historicalchore: bump release version to v2.1.8-rs.devNpattern). Deriving it from the same build-time inputs eliminates the bump PR and a class of "forgot to update the constant" bugs.Test plan
cargo build --releasesucceeds.cargo test --release -p portal-relay— 86 passed, 3 ignored (kernel-WG, expected).PORTAL_RS_BUILD=rs.1 cargo test sdk_domain_response_matches_fixture— pass.--version→portal-relay 2.1.8+rs.dev.PORTAL_RS_BUILD=rs.1build:--version→portal-relay 2.1.8+rs.1.v2.1.8+rs.1tag push →/sdk/domainreturnsrelease_version: "v2.1.8+rs.1"(verify in deployed image).604f91d970tofeba6ffb57vto match wire format