Repository navigation
The unit fields a layer manifest may carry, and the rule for any other - #24
Merged
Merged
Conversation
…y other bt-layer now records the components a layer carries as fab units, in two fields that are not in REQUIRED_KEYS: units, every component the layer carries as name@version, and build_units, the ones this build applied. A child layer subtracts what its parent recorded, so the record has to survive a trip through keel pull, which writes a manifest back out of what it read. Nothing here had to change: parse keeps a key it does not know, validate looks only for the required ones, and Manifest.text writes them all back in the order they were read. That is a property the layer format depends on now, so docs/layers.md states it and TestOptionalFields holds it: the two fields validate and are readable, a manifest without them still validates, text gives back the file byte for byte, a key nobody here knows is kept, and a key that is not a key is still refused.
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.
bt-layernow records the components a layer carries as fab units (Keel-Linux/buildtasks#8), in two fields that are not inREQUIRED_KEYS:unitsname@versionsorted by name, ornone; cumulative, the parent's merged with this build'sbuild_unitsdefaultfor a rootfs, else the difference, ornoneA child layer subtracts what its parent recorded, so the record has to survive a trip through
keel pull, which writes a manifest back out of what it read. A unit dropped there is a layer whose provenance record no longer says what it is made of.Nothing in the code had to change:
parsekeeps a key it does not know,validatelooks only for the required ones, andManifest.textwrites them all back in the order they were read. That is now a property the layer format depends on, so this documents it and tests hold it.Test plan
TestOptionalFields: the two fields validate and are readable; a manifest without them still validates;text()gives the file back byte for byte; an unknown key is kept infieldsand intext(); a key that is not a key is still refused.python3 -m pytest: 555 passed, 59 subtests.coverage report: 100 percent, gate 95.package / changelogdoes not apply (both paths are in the exempt list).