feat: precondition checks as a feature #322
Merged
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.
Closes #
Changes
If enabled, the action should be configured to first head into the precondition checker for space verification before heading into downloader to be downloaded as follows:
Payload attached to the download action routed to this precondition checker must henceforth have the following fields:
Why?
It has become necessary for there to be a means by which the customer can define a precondition, in this case disk space required for an firmware update installation to succeed. With this feature we will be able to fail
update_firmware
actions before the download stage to ensure that valuable bandwidth isn't utilized in downloading a file that can't then be decompressed on device because of disk size constraints. We verify if the download and installation/decompression paths are in the same disk partition to ensure that the calculations are done appropriately.Trials Performed
Uplink running on three devices as follows:
The observations are made in the gist show that file download happened when space was available to decompress. whereas it did not when there wasn't enough, despite the compressed file being able to fit in.