Skip to content

feat(status): report running and linked sysext versions and warn about pending activations - #460

Merged
bketelsen merged 9 commits into
mainfrom
feat/running-linked-status
Oct 24, 2026
Merged

bketelsen merged 9 commits into
mainfrom
feat/running-linked-status

Conversation

@frostyard-machines

@frostyard-machines frostyard-machines commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Stacked on #458 (Phase 1). This branch contains #458's commit plus one commit, feat(status): …. Review only the commits after #458's: feat(status): … and the review follow-up 2846e71 (deactivations in the refresh warning, and a rule for SDK callers to show PendingActivations). Merge #458 first, then rebase this PR. It targets main, because the Tests workflow runs only for PRs into main.

Phase 3 of plan 0001, which implements ADR-0016, "Status and logs" (the features check/list columns and the refresh warning). I stacked it because Phase 5 builds its "why not linked" output on these columns, and the UpdateFeatures changes overlap with #458.

  • RUNNING and LINKED. For each transfer, features check and features list report the version that is merged now (running_version, from the .systemd-sysext hierarchy metadata, ADR-0015) and the version that the link names (linked_version, the version the next boot merges).
    • Fields:
      • CheckResult gains running_version, linked_version and pending_reboot. current_version is unchanged.
      • FeatureInfo gains transfer_status (omitzero).
    • Text:
      • check columns are FEATURE COMPONENT CURRENT RUNNING LINKED NEWEST UPDATE. list adds RUNNING LINKED.
      • A footer reports PENDING REBOOT: … when LINKED differs from RUNNING.
      • A merged version of unknown is not counted as pending, because it cannot be compared.
    • New helper sysext.MergedVersionIn reads only the hierarchy metadata. It ignores a legacy CurrentSymlink and /run/extensions, because those mean "about to merge", not "merged now".
    • A read failure for one transfer goes to that row's error, or to a warning in list. It never breaks the listing.
  • Refresh warning. features update without --no-refresh, features enable --now and features disable --now list the other linked-but-not-merged sysexts that the refresh activates too. The list goes to a reporter warning before the refresh, and to PendingActivations in the result.
    • "Own" transfers are matched by link name. For update, they are all enabled features' transfers, so the list is mostly disabled features with a pending link.
    • disable --now reads the state before the unmerge.
    • A dry run says "would also activate".
    • A component-scoped run still checks the whole host, because the refresh ignores the scope.

Checks

  • make fmt
  • make ci: ==> CI gate passed locally on the stacked branch. Coverage is 87.9%, and .coverage-baseline is bumped.
  • CLI/e2e green
  • Focused tests:
    • updex/status_test.go: 7 link and merge states through both Features and CheckFeatures; several transfers; a disabled feature; an unreadable merged state; a manifest failure that keeps the status; the refresh warning for update, enable --now and disable --now, including nothing pending, an own link, --no-refresh, a dry run and a component-scoped run.
    • cmd/updex/features_status_test.go: text columns and footer, and the JSON shape.
    • tests/e2e: the JSON shape with the real binary. It covers keys only, because the binary cannot be pointed at temp hierarchies.

Risk classification

  • Tier 4: Critical

Rationale:

  • This PR touches sysext/**, but only with a new read-only helper. No write path changes.
  • Trust boundary: none crossed. It reads the link and the merged metadata, which updex already reads.
  • Abuse cases: the metadata reads use the existing bounded reader (readLimitedFile).
  • Failure modes: a read error becomes a per-row error. The warning never blocks a refresh.
  • Rollback: revert. The JSON additions are additive, and existing fields are unchanged.

Docs housekeeping

  • README.md, docs/design/overview.md and docs/specs/sdk-api.md updated
  • Conformance aliases untouched

Verification

  • node scripts/check-docs.mjs green

Not verified on a real host. Plan 0001's "Done when" for this phase, a host with a pending revision that shows RUNNING ≠ LINKED, needs one.

…sfers together, add the operation lock

Phase 1 of plan 0001 (ADR-0016).
…activations

Phase 3 of plan 0001 (ADR-0016).
@github-actions github-actions Bot added documentation Improvements or additions to documentation go Pull requests that update go code labels Oct 23, 2026
@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.47236% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
updex/status.go 90.00% 3 Missing and 5 partials ⚠️
updex/features.go 93.33% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@frostyard-machines frostyard-machines left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Murbella (snosi owner): host and image review of the last commit (feat(status): …), comment only. I do not approve.

Verdict: no blocking finding. RUNNING comes only from the hierarchy metadata, and LINKED from the link, so PENDING REBOOT means exactly "the next boot changes this sysext". Read errors stay per row. No write path changes. The refresh warning covers the 3 commands ADR-0016 names.

Non-blocking:

  1. Deactivations are not listed. activationPending needs a non-empty link, so a sysext that is merged but has no link (for example after features disable without --now) does not appear. A refresh unmerges it under its running workload (docker, incus, k3s). That is the same risk as an activation. List "merged, not linked" too, or say in the docs that the list shows activations only.
  2. SDK and GUI callers. The warning goes to the reporter. A GUI that calls EnableFeature with --now semantics shows nothing unless it reads PendingActivations. Say in docs/specs/sdk-api.md that a caller must show this list before it refreshes.
  3. snosi follow-up (mine, not for this PR). snosi-update-status and the motd can show pending_reboot from updex features check --json next to the staged image state. I will do that in Phase 7.

Needs a real host (plan "Done when"): a host with a pending revision shows RUNNING ≠ LINKED, and RUNNING = the new revision after a reboot. Only a real systemd-sysext writes the origin file that this reads. Host test plan: see my comment on #462.

Review follow-up (Murbella): a sysext that is merged but not linked is
unmerged by the refresh; list it, and tell SDK callers to show the list.
frostyard-machines added a commit that referenced this pull request Oct 23, 2026
…ature-wide hold and rollback across an image update
@bketelsen
bketelsen requested a review from bsherman October 23, 2026 16:30
@bsherman

Copy link
Copy Markdown
Contributor

Concern: the refresh warning misses other host sysexts when using -C / ClientConfig.Definitions.

In updex/status.go, pendingActivations expands its read domain only when component != "" && c.config.Definitions == "". With an explicit definitions directory it inspects only the custom definitions, although the subsequent systemd-sysext refresh still affects the whole host.

I reproduced this against commit 2846e710a67fc4bd8a6b614b2d9c0c01e2e5679a with a focused test using the existing pending fixture: keep alpha in the custom definitions directory, move beta definitions into a normal sysupdate.d root, and leave beta running 1.0.0 with 2.0.0 linked. UpdateFeatures refreshes, but PendingActivations is empty instead of listing beta. This silently activates another workload despite the new warning mechanism.

Please include normal host definitions when collecting refresh warnings, unioned with custom definitions as needed and deduplicated by link name. Keep the actual update scope limited to the custom directory. Add regression coverage for this case.

Separately, this head includes #458 and still inherits the rollback defect reported there.

…re failures

Review follow-up (bsherman, blocking): a regular file at the link path
is hard-linked to a backup before any link moves and renamed back when a
later transfer fails; other non-symlink entries are refused up front;
restore failures are joined into the returned error.
Review follow-up (bsherman): with ClientConfig.Definitions set, the
refresh warning also reads the host's normal definitions.
… into feat/running-linked-status

# Conflicts:
#	.coverage-baseline
#	updex/features.go
frostyard-machines added a commit that referenced this pull request Oct 23, 2026
linkAllOrNone now carries #458's regular-file backup and joined restore
errors, so rollback gets the same protection.
@frostyard-machines

Copy link
Copy Markdown
Contributor Author

Fixed in 7553429 (Lucilla). #458's fix is merged in 7643010.

  • pendingActivations now always reads the host's normal definitions (config.LoadAllTransfersIn over the client's definition roots) and unions them with the caller's domain (the -C directory, or one component), deduplicated by link name. Own transfers stay excluded. The update scope does not change. If the host read fails, it warns and uses the scoped domain.
  • Tests: your reproduction (alpha in -C, beta in a normal sysupdate.d root with 1.0.0 running and 2.0.0 linked, after which UpdateFeatures lists beta and still refreshes); the same with EnableFeature --now; a transfer in both domains is listed once; own transfers in the -C directory are not listed.

bsherman
bsherman previously approved these changes Oct 23, 2026

@bsherman bsherman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Review follow-up (bsherman): when the transfer whose link failed cannot
be restored, its result and the returned error carry the restore failure
and say that the link may point at the new version.
frostyard-machines added a commit that referenced this pull request Oct 23, 2026
…ck branch

linkAllOrNone records a restore failure of the failing transfer itself.
…tatus

# Conflicts:
#	.coverage-baseline
#	docs/specs/sdk-api.md
#	sysext/manager_test.go
#	updex/features.go
@bketelsen
bketelsen enabled auto-merge October 24, 2026 02:06
@bketelsen
bketelsen added this pull request to the merge queue Oct 24, 2026
Merged via the queue into main with commit ecacab1 Oct 24, 2026
18 checks passed
@bketelsen
bketelsen deleted the feat/running-linked-status branch October 24, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants