Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Fix/ota 3059/target check sooner #1271

Merged
merged 2 commits into from
Jul 29, 2019
Merged

Conversation

pattivacek
Copy link
Collaborator

Note that this will soon be followed up with a PR that will move uptaneOfflineIteration to be used before downloading and installing so that metadata will get quickly re-checked before allowing either of those operations to proceed. We can optionally hold this back until that work is ready. That work will also expand the new target_mismatch_test.cc file.

@codecov-io
Copy link

codecov-io commented Jul 29, 2019

Codecov Report

Merging #1271 into master will decrease coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1271      +/-   ##
==========================================
- Coverage   79.68%   79.64%   -0.05%     
==========================================
  Files         173      173              
  Lines       10314    10315       +1     
==========================================
- Hits         8219     8215       -4     
- Misses       2095     2100       +5
Impacted Files Coverage Δ
src/libaktualizr/primary/sotauptaneclient.cc 91.51% <100%> (+0.16%) ⬆️
src/libaktualizr-posix/ipuptanesecondary.cc 82.66% <0%> (-4%) ⬇️
src/libaktualizr/package_manager/ostreemanager.cc 76.27% <0%> (-1.7%) ⬇️
src/aktualizr_primary/secondary.cc 82.89% <0%> (-1.32%) ⬇️
src/libaktualizr/storage/sqlstorage.cc 75.89% <0%> (+0.25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dedceec...6d57e5a. Read the comment docs.

}
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor readability: do an early exit if (updates.emtpy()) { return ... } and no else, like it's done higher up in the function. Would make it a bit easier to follow as it's the style of the rest of the logic and would avoid the if { for { if {}}} nesting

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Previously the delegation walking and target matching was done in
downloadImages(). It now is done in checkUpdates() so that any problems
are detected as early as possible.

Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
Previously this wouldn't've been caught until the Download step. Now it
is caught during the check for updates.

Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
@pattivacek pattivacek force-pushed the fix/OTA-3059/target-check-sooner branch from e5eafee to 6d57e5a Compare July 29, 2019 11:47
@pattivacek pattivacek merged commit 3b25160 into master Jul 29, 2019
@pattivacek pattivacek deleted the fix/OTA-3059/target-check-sooner branch July 29, 2019 12:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants