Repository navigation
fix(sysext): clean up other-suite images in vacuum and disable - #515
Merged
Merged
Conversation
A transfer that selects its suite with %w (os-release VERSION_ID) matches only the images of the running suite. Cleanup of the other suite's images (#512) and suite-switch detection (#511) need to match the images of every suite. config keeps, for each target pattern that contains %w, an any-suite variant in TargetSection.AnySuitePatterns: every other specifier expanded as before, %w replaced by version.SuiteWildcard. It is nil when no target pattern contains %w; "%%w" stays a literal "%w". version.SuiteWildcard is a NUL byte. A Linux file name cannot hold one, so no pattern that config text spells out can mean it; config builds no any-suite variant when the text or an expanded value already holds a NUL. Only the new version.ParseAnySuitePattern gives it a meaning; ParsePattern and every existing pattern (a literal "@w" included) parse as before. The wildcard matches 1 or more of [0-9a-z.~-], and @v in an any-suite pattern excludes '_', so "foo_@v_%w_%a.raw" never matches an image of a component "foo_bar". Pattern.Suite and version.ExtractSuiteParsed report the suite a file name matched.
A transfer that selects its suite with %w (os-release VERSION_ID) saw only the running suite's images. After a suite switch (bootc switch, trixie 13 to forky 14) the vacuum kept every image of the old suite for ever, and `features disable --now` left them on disk (#512). The vacuum keeps the running suite's rule unchanged (InstancesMax, linked, merged, ProtectVersion=, ProtectVersions). An image that an any-suite pattern (TargetSection.AnySuitePatterns) matches and no current pattern matches is an other-suite image: for each other suite the vacuum keeps the newest version, so a switch back can link it without a download, and removes the older ones. It never removes the other-suite image the sysext link points to (by base name; right after a switch the link still points there), an image the merged state records, or a legacy CurrentSymlink target. It reads them before it deletes anything and fails closed on a read error. Only regular files count. RemoveAllVersionsAt also removes every other-suite image that is a regular file, so a disabled feature leaves no image of any suite. VacuumWithReport and PlanVacuumWithReport return the other-suite lists; VacuumWith and PlanVacuumWith keep their signatures. A real update prints each other-suite removal; a dry run reports them in UpdateResult.RemovedOtherSuiteImages and in its message. A transfer without %w gets no new behavior and the same output. Fixes #512
9 of 12 tasks
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Review fixes for the other-suite cleanup (#512): - The disable guard recognizes every suite that the removal matches. RemoveAllVersionsAt removes the images of every suite, but the guard (GetActiveVersionWith) saw only the running suite's patterns, so a merged image of another suite was removed without --force. The new sysext.ActiveOtherSuiteWith checks the same signals with the any-suite patterns: a legacy CurrentSymlink target, an origin path, a versioned name in the extensions list and /run/extensions. DisableFeature{Now} calls it after GetActiveVersionWith; an image it finds needs --force ("<component> (image <file> of another suite)"), and a read error is "merge state unknown". The refusal comes before any write, unmerge or delete. - Older merged metadata (systemd < 258) has no origin and lists only the extension name (foo). The vacuum then protected foo.raw, which is no staged image, and could delete the other-suite image that is merged. When a hierarchy's metadata names the component but no image file of the transfer, the vacuum now keeps every other-suite image and reports VacuumReport.OtherSuiteMergedUnknown; updates print it. The running suite's rule does not change. - The CurrentSymlink read of the other-suite vacuum skips only an absent path or a path that is not a symlink; any other Lstat or Readlink error fails the vacuum before it deletes anything. Each finding has a record in .memory/corrections/ (core ADR-0081) that names its guard test. Refs #512
The other-suite vacuum decided per hierarchy whether the merged state names the image of the transfer's extension. A bare `foo` entry (systemd older than 258 writes only extension names) left foo's image unknown, but any other entry that matched the pattern resolved it: with `foo_bar_9.0_14_x86-64` in the list (it matches foo_@v_14_x86-64.raw as version bar_9.0), the vacuum could delete a merged foo_1.0_13_x86-64.raw. The decision is now per extension identity: the image of the extension t.Component is unknown when an origin key or a bare extensions entry names it and origin gives that same key no path whose base name is an image of the transfer. Another entry never resolves it. While it is unknown, the vacuum keeps every other-suite image (OtherSuiteMergedUnknown). The running suite's rule and the protected names do not change. The disable guard has no such mix: GetActiveVersionWith and ActiveOtherSuiteWith only report an image as active, so any matching entry refuses without --force; TestDisableFeatureNow_RefusesMixedMergedMetadata pins that. Refs #512
Contributor
Author
Cross-review record
Guards (each fails with its fix reverted; 1
Checks: Merge order: merge this PR before #516, which carries an identical copy of commit |
|
|
Merged
3 tasks done
bketelsen
pushed a commit
to frostyard/core
that referenced
this pull request
Nov 14, 2026
…ess step (#246) * fix(pr-triage): count only the newest run of each check in the readiness step filter=latest gives the latest check run per check suite, and each workflow run is its own check suite. A run that a newer workflow run of the same check cancelled stayed in the list, so the readiness step saw a cancelled check and removed ready-for-human although every check was green (frostyard/updex#515 at bb9c272). The step now keeps only the newest run (highest id) of each check name and app. A cancelled, failed or unfinished newest run still counts as not green. * chore(memory): record the newest-check-run correction (ADR-0081) * docs(specs): name the app fallback and the safe-integer id in pr-triage rule D --------- Co-authored-by: frostyard-machines <[email protected]>
This was referenced Nov 14, 2026
Merged
Merged
Merged
Merged
This was referenced Nov 14, 2026
Merged
Merged
Merged
Merged
Merged
Merged
…leanup # Conflicts: # config/transfer.go # config/transfer_test.go # docs/specs/config-reference.md # updex/install.go
Contributor
Author
Cross-review record: merge of main
Checks: |
bketelsen
approved these changes
Nov 14, 2026
This was referenced Nov 14, 2026
bketelsen
pushed a commit
to frostyard/frostyard-org
that referenced
this pull request
Nov 15, 2026
* docs: follow Updex v2.3.1 in the Updex guide The v2.3.1 README (frostyard/updex#510) no longer has the sections the guide deep-linked. Point those links to docs/specs/cli-reference.md and docs/specs/config-reference.md at v2.3.1, and add short lines for the suite-switch unit, the other-suite cleanup, and the empty-specifier error (frostyard/updex#515, #516, #518, #519). check-site.mjs now pins the v2.3.1 sources and refuses a README deep link. * docs: state what the other-suite cleanup keeps in the Updex guide The vacuum keeps the newest image of each other suite, the linked image and a merged image, and keeps every other-suite image on systemd older than 258 while the feature is merged (updex v2.3.1 cli-reference, "What the vacuum keeps"). check-site.mjs asserts both conditions; the record is .memory/corrections/2026-11-14-pr-126-other-suite-vacuum-claim.json. --------- Co-authored-by: frostyard-machines <[email protected]>
4 tasks done
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.
Summary
Fixes #512.
When the images of 2 suites sit in 1 transfer target (
<name>_<ver>_13_<arch>.rawand<name>_<ver>_14_<arch>.raw, selected by%w; core Plan 0009 Phase 6), the vacuum andfeatures disablesaw only the current suite's files, so the other suite's files stayed on disk without limit.88752b3):configkeeps, for each target pattern with%w, a variant in which%wisversion.SuiteWildcard(a NUL byte, which no file name and no config text can hold) and every other specifier expands as before (TargetSection.AnySuitePatterns, nil without%w).version.ParseAnySuitePatternturns each wildcard into a group[0-9a-z.~-]+(no_), all wildcards of 1 name must match the same value, and@vloses_there, sofoo_@v_%w_%a.rawcannot match an image of a componentfoo_bar.ParsePatternand every existing pattern (a literal@wtoo) are unchanged.sysext/manager.goplanVacuum): the current suite keeps today's rule exactly (InstancesMax, linked, merged,ProtectVersion=,ProtectVersions). Other-suite files keep only the newest image of each other suite, so a switch back can relink without a download. The link target (by file name, also when it is an other-suite file, as right after a switch), the merged images and the legacyCurrentSymlinktarget are never removed. Everything is read before anything is deleted; a read error deletes nothing.RemoveAllVersionsAt, called byfeatures disable --now): removes the images of every suite; symlinks are still skipped.features disablerefuses without--forcewhen an image of another suite is active (sysext.ActiveOtherSuiteWith:CurrentSymlink, theoriginpath, a versioned name inextensions,/run/extensions; a read error means merge state unknown), before any write, unmerge or delete. The vacuum decides the merged image per extension: when the metadata names the component but its ownoriginentry gives no image path (metadata that names only the extension), it keeps every other-suite image (VacuumReport.OtherSuiteMergedUnknown). AnLstat/Readlinkerror onCurrentSymlinkstops the vacuum before any delete.%wgets no new behavior; a host with only its own suite's files gets the same result as before (TestVacuumWithOwnSuiteOnlyUnchanged).The retention rule is recorded in AGENTS.md ("Feature install and retention"),
docs/design/overview.md,docs/specs/config-reference.mdanddocs/specs/cli-reference.md.Checks
make fmtmake ci— green locally (coverage 90.8%;.coverage-baselineraised to 90.8)make ciRisk tier
Rationale: the PR touches L1 paths of
.github/risk-paths.json:sysext/**(sysext/manager.go,sysext/other_suite_test.go): the vacuum and the remove delete files as root. Safe: the current-suite rule is unchanged; other-suite deletion keeps the newest image per suite, the link target, the merged images and theCurrentSymlinktarget, and keeps every other-suite image when the merged image cannot be identified; the plan is read in full before any delete and fails without deleting on a read error.config/transfer.go: adds the any-suite variant;MatchPatternsexpansion is byte-identical.updex/{install,features}.go(not risk paths): pass and report the new removals, and add the disable guard for merged other-suite images; no new link path.Docs housekeeping
docs/design/overview.md,docs/specs/*, AGENTS.md updatedVerification
node scripts/check-docs.mjsgreen (inmake ci)TestVacuumWithOtherSuiteImages,TestDisableFeatureNow_RemovesEverySuite,TestRemoveAllVersionsAtRemovesEverySuite.TestVacuumWithOwnSuiteOnlyUnchangedpasses on both sides by design..memory/corrections/2026-11-13-pr-515-*.jsonrecord:TestDisableFeatureNow_RefusesMergedOtherSuiteImage,TestVacuumWithComponentOnlyMetadataKeepsOtherSuites,TestVacuumWithOtherSuiteFailsClosedOnCurrentSymlink/inspection_failure,TestVacuumWithMixedMetadataKeepsOtherSuites(4 cases).88752b3; main is merged into this branch (e2f3ae4), so the diff against main no longer holds that commit's changes.features update --suite-switchfrom fix(updex): fail loud on an empty specifier and link the running suite at boot #516 is a 3rd user of the any-suite patterns (docs/specs/config-reference.md).