Skip to content

feat(canopy): typed schema::VerificationArgs for restore-verification#90

Merged
passcod merged 1 commit into
mainfrom
feat/canopy-typed-verification
Jul 2, 2026
Merged

feat(canopy): typed schema::VerificationArgs for restore-verification#90
passcod merged 1 commit into
mainfrom
feat/canopy-typed-verification

Conversation

@passcod

@passcod passcod commented Jul 2, 2026

Copy link
Copy Markdown
Member

🤖 Follow-up to #88. bestool-canopy 0.4.5 (bestool#628) generates typed
request structs from canopy's OpenAPI at build time, so the
restore-verification body no longer has to be a hand-built
serde_json::Value.

Change

  • Build the generated bestool_canopy::schema::VerificationArgs and send
    that — the field set is now checked against canopy's spec at compile
    time (rename typetype_, outcome/observed_at as strings, etc.).
  • health_details stays a free-form serde_json::Value (it's untyped in
    the spec by design), carrying { sizes, fixes, restore_duration_sec }.
    Sent as None when nothing was gathered, rather than an empty object.
  • outcome maps to canopy's lowercase wire form (success/failure);
    observed_at is RFC3339.
  • Dropped the wrapper's now-dead hand-written restore_verification
    method; the sender is generalised to
    restore_verification_typed(impl Serialize), still POSTing via the
    generic request escape hatch.

Build note

bestool-canopy's build.rs fetches canopy's OpenAPI at build time from
its public endpoint (15s timeout) — so CI regenerates against the
live spec and the types track canopy as it evolves; the committed
snapshot is only a fallback for offline / sealed builds. This pulls
typify / ureq into the build-dependency tree; needed log/semver
to move up a little, no source impact.

Behaviour is otherwise identical to #88 — same endpoint, same fields,
same health_details shape — just typed at the construction site.

…tion

bestool-canopy 0.4.5 (bestool#628) generates typed request structs from
canopy's OpenAPI at build time. Replace the hand-built serde_json::Value
verification body with the generated schema::VerificationArgs: the field
set is now checked against canopy's spec at compile time.

health_details stays a free-form serde_json::Value (untyped in the spec
by design) carrying { sizes, fixes, restore_duration_sec }; it's sent as
None when nothing was gathered rather than an empty object. observed_at
and outcome are strings per the generated type (outcome mapped to
canopy's lowercase wire form).

Drops the wrapper's dead hand-written restore_verification method and
generalises the sender to restore_verification_typed(impl Serialize),
POSTing via the generic request escape hatch.

Note: bestool-canopy's build.rs fetches canopy's live OpenAPI at build
time and falls back to its committed snapshot when unreachable (e.g.
CI), so this adds typify/ureq build-deps to the tree.
@passcod passcod merged commit ac3de80 into main Jul 2, 2026
24 checks passed
@passcod passcod deleted the feat/canopy-typed-verification branch July 2, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant