Repository navigation
fix(features): apply RequisiteFeatures= as an AND gate in every feature path - #469
Merged
Merged
Conversation
…re path A transfer is acted on only when it is active (sysupdate.d(5)): Features= empty or one listed feature enabled, and every RequisiteFeatures= entry enabled. update, check, enable --now and rollback act on active transfers only and report the others; disable --now keeps a transfer that another enabled feature still activates; rollback holds are computed over the acted-on set. ADR-0017. Fixes #455
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…ed rollback A second rollback planned only the active transfers and replaced the record, so it dropped an earlier rejection of a transfer that had become inactive. When that transfer became active again, update could link the rejected version. Keep those entries without moving the link.
Contributor
Author
Cross-family AI review (advisory, not an approval)
Checks: uncached Tier 3: explicit maintainer review of the reliability impact is still required (docs/risk-tiers.md). |
Merged
3 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 #455.
RequisiteFeatures=was parsed but not enforced: every feature command selected transfers withconfig.GetTransfersForFeature(feature inFeatures=orRequisiteFeatures=). updex now applies the systemdsysupdate.d(5)activation rule in every feature path (ADR-0017):config.CheckTransferActivationis the single implementation of the rule (FilterTransfersByFeaturesnow uses it).GetTransfersForFeaturestays as the association lookup only.updex/activation.gosplitFeatureTransferssplits a feature's associated transfers into active and inactive over the loaded domain's enabled set, with the feature forced enabled (update, check, enable, rollback, the hold read inFeatures) or disabled (disable).features update/check: act only on active transfers. Inactive ones are not downloaded, linked or vacuumed, and are reported (inactivein JSON, oneinactive:line in text).features enable --now(and dry run): installs only transfers that are active with the feature enabled; reports the ones still waiting (FeatureActionResult.Inactive). Enablinglodge --nowinstallsFeatures=maild RequisiteFeatures=lodgewhenmaildis already enabled.features disable --now(and dry run): a transfer that another enabled feature in itsFeatures=still activates is kept (FeatureActionResult.Kept): no unlink, no removal, not in the merged-state--forcecheck. Only the transfers the disable makes inactive are removed. With nothing left to remove, it runs no unmerge, no refresh and no refresh-gate preflight; only the drop-in is written.collectRollbackHolds,rollbackHoldReasonanddeleteFinishedRollbackRecordsget the acted-on (active) set, so a record that applies only to a transfer a feature does not act on no longer holds that feature.rollbackFeaturesOf(which records are read) stays the association: it reads more records, never fewer.RollbackFeaturerolls back and records only active transfers, and fails withfeature '<name>' has no active transfers to roll back: …when there is none.CatalogRemove: unchanged.RenderTransferreplacesFeatures=withFeatures=<name>, so a catalog transfer is never kept.Docs:
docs/specs/config-reference.mdanddocs/design/overview.mdnow agree (andsdk-api.md,README.md,AGENTS.md). New ADR-0017.Compatibility
inactive(update, check, enable),kept(disable).update/enable --now;disable --nowno longer removes a transfer that another enabled feature activates.updatedoes not remove them (as systemd-sysupdate, removal is a separate action);disable --nowof a feature it names removes it.Checks
make fmtmake ci(passed locally at this head; coverage 90.0%, baseline raised 89.7 → 90.0)go test -race ./updex/ ./config/ ./cmd/updex/New tests (
updex/requisite_test.go,config/transfer_test.go,cmd/updex/features_requisite_test.go): the 3 activation cases for update and check; unknown and masked requisite; dry run; enable --now waits / installs the waiting transfer / no enabledFeatures=entry; disable --now keeps a transfer that another enabled feature activates (real and dry run, merged image, no unmerge/refresh); nothing-to-remove runs no preflight; disable removes what it makes inactive; mixed keep + remove; rollback hold of a transfer not acted on does not hold; hold of an acted-on transfer still holds; rollback rolls back only active transfers; no active transfers fails. No existing test changed.Risk classification
Rationale: it changes which images updex downloads, links and removes (
disable --nowis a destructive operation run as root) and which features a rollback record holds. No file undersysext/,systemd/,download/or.github/workflows/changes, so not Tier 4.Trust boundaries and failure modes
.transfer/.featuredefinitions (root-owned search roots) and the enabled state from drop-ins. No new input.disable --nowremoves the associated transfers that are inactive without the feature; before, it removed every associated transfer. The kept set needs another feature that is enabled and not masked in the loaded domain.--componentor-C, a requisite feature outside the loaded definitions is not enabled, so the transfer stays inactive (fail closed: fewer downloads; for disable, nothing is kept by a feature outside the domain).rollback --clear. It does not hold the owner while a newer version of that component exists.Rollback and recovery
Revert the PR. No file format, record format or unit changes. An image that this version did not download is downloaded by the old version at the next update; a transfer this version kept is removed by the old version's
disable --now.Review
Tier 3: explicit maintainer review of the reliability impact is requested. The cross-family AI review (see the comment) is advisory.
Docs housekeeping
README.md,docs/design/overview.md,docs/specs/*updated;AGENTS.mdupdatedTEMPLATE.md, indexed indocs/README.mdVerification
node scripts/check-docs.mjsgreen (part ofmake ci)Note on #465
Not closed here. PR #468 (merged) fixed items 1, 2, 3, 4 and 6 (the
--clearwording and theup to daterow). Item 5 (a failed unit stays failed until the next success) is input for #459. The joined errors without a separator are rendered by fang through clix; that fix belongs in clix. #465 can be closed by a maintainer when #459 and clix track the rest.