Conversation
SOVD collapses prepare and execute terminal states into status=completed
and keeps the real phase on the vendor extension x-medkit-phase. Plugins
that split the install pipeline (uptane_ota and similar) emit
{ status: 'completed', 'x-medkit-phase': 'prepared' } after prepare -
the install still needs to be triggered. The old actionButtonsForStatus
only branched on status, so prepared updates flashed as fully terminal
and showed only Delete; the Execute button never rendered and users
had no UI path to finish the install.
Add the phase field to the UpdateStatus type and pass the full status
into actionButtonsForStatus. When phase === 'prepared' return
['execute', 'delete']; any other completed update is truly terminal
and keeps the previous ["delete"] behaviour. Existing tests still
pass; add three cases covering phase-missing, phase=prepared, and
phase=executed.
There was a problem hiding this comment.
Pull request overview
Adjusts UpdateCard behavior to handle split-pipeline OTA plugins where status: "completed" can still require an Execute step when the gateway reports x-medkit-phase: "prepared".
Changes:
- Extend
UpdateStatuswith optionalx-medkit-phasevendor extension. - Update
actionButtonsForStatusto branch onx-medkit-phasewhenstatus.status === "completed". - Add Vitest cases covering missing phase,
prepared, andexecuted.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/lib/types.ts |
Adds optional x-medkit-phase to UpdateStatus with explanatory TSDoc. |
src/components/UpdateCard.tsx |
Updates action-button selection to show Execute after completed + prepared. |
src/components/UpdateCard.test.tsx |
Adds regression tests for legacy/no-phase and phase-specific completed states. |
mfaferek93
reviewed
Apr 22, 2026
- Export UpdatePhase union (none/preparing/prepared/executing/executed/ failed/deleting) matching the gateway `update_phase_to_string` enum and use it on UpdateStatus['x-medkit-phase'] instead of `string`. This gives compile-time checking for phase comparisons and typos. - Add a default branch to actionButtonsForStatus so a non-conforming status string from a plugin falls back to `['delete']` instead of returning undefined and crashing the .map(...) render path. - Cover the added edge cases in tests: unknown phase on completed (falls back to Delete-only) and phase on failed (ignored; retry actions still surface).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Summary
Teach `UpdateCard` that `status=completed` is not always terminal: when the gateway's `x-medkit-phase` vendor extension reports `prepared`, the prepare step finished but execute still needs to run, so the card must offer Execute / Delete rather than only Delete.
Behavior for plugins that run the pipeline in one shot (no phase field) is unchanged.
Issue
Type
Testing
Manual check: register an update, click Prepare, wait for `status=completed` + `x-medkit-phase=prepared` on `GET /updates/{id}/status`; the card now shows Execute and Delete. After Execute resolves with `x-medkit-phase=executed`, only Delete remains.
Checklist