remove artifact kind from PendingMgsUpdate#8017
Merged
davepacheco merged 11 commits intomainfrom Apr 22, 2025
Merged
Conversation
andrewjstone
approved these changes
Apr 21, 2025
…' into dap/sp-blueprint-simplify
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.
PendingMgsUpdatecurrently includes anArtifactHashId, which is a combination ofArtifactKindandArtifactHash. We need the hash, but we don't need the kind. This choice dates from the first iteration ofPendingMgsUpdate, when thekindhere specified which component was being updated. Now, that's specified by thedetailsfield, which has other component-specific information, too. So we don't need thekindand we can use anArtifactHashdirectly rather thanArtifactHashId.This is built on #8016 just to avoid conflicts.
Anticipating some related questions: we do still make other assumptions about some fields matching up. For example, the artifact referenced by this hash must be appropriate for the component being updated (SP vs. RoT vs. RoT bootloader), the board being updated (when it comes to the SP), the slot being updated (when it comes to RoT), the signing key (when it comes to RoT and RoT bootloader), etc. And updating to this artifact should result in version
artifact_versionbeing in the component's active slot. The executor checks / will double-check most of these. But it's the responsibility of the planner to set them correctly.The way I think about all this is that the planner is responsible for taking the high-level, normalized data (like the policy "we should be running release 14" and the TUF repo metadata that specifies which artifact is appropriate for any given component) and creating a
PendingMgsUpdate. That structure is essentially denormalized and gives the executor all the information it needs to complete the update without having to consult any other sources.