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

aktualizr-info add parameter '--images-snapshot' and '--images-timest… #1207

Merged
merged 1 commit into from
May 14, 2019

Conversation

xcheng-here
Copy link
Contributor

aktualizr-info add parameter '--images-snapshot' and '--images-timestamp'

@codecov-io
Copy link

codecov-io commented May 10, 2019

Codecov Report

Merging #1207 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1207      +/-   ##
==========================================
+ Coverage   76.75%   76.78%   +0.02%     
==========================================
  Files         168      168              
  Lines        9993    10005      +12     
==========================================
+ Hits         7670     7682      +12     
  Misses       2323     2323
Impacted Files Coverage Δ
src/aktualizr_info/main.cc 92.05% <100%> (+0.68%) ⬆️

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 00d97ce...f8a6b53. Read the comment docs.

std::string images_snapshot = Utils::jsonToStr(meta_snapshot);
db_storage_->storeNonRoot(images_snapshot, Uptane::RepositoryType::Image(), Uptane::Role::Snapshot());

aktualizr_info_process_.run(std::vector<std::string>{"--snapshot"});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it really necessary to do an explicit casting here (std::vectorstd::string) ? If not, then it can be removed.

std::string images_timestamp = Utils::jsonToStr(meta_timestamp);
db_storage_->storeNonRoot(images_timestamp, Uptane::RepositoryType::Image(), Uptane::Role::Timestamp());

aktualizr_info_process_.run(std::vector<std::string>{"--timestamp"});
Copy link
Collaborator

Choose a reason for hiding this comment

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

The same as above, explicit casting can be avoided (std::vectorstd::string)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you Mike, I believe you are right, they should be removed.

@pattivacek
Copy link
Collaborator

Two minor issues that I see:

  1. The DCO check is failing. You need to run git rebase HEAD^ --signoff to sign the DCO.
  2. To be consistent with the other metadata output commands, I think we should name these commands "images-timestamp" and "images-snapshot". It's not strictly necessary since we don't support those on the director, but we may change that, so we might as well be specific about it now. (Delegations are different, because they can only exist in the images repo according to the standard.)

Thanks for the work! I've tested it and it works as expected.

Copy link
Collaborator

@mike-sul mike-sul left a comment

Choose a reason for hiding this comment

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

I am fine with this specific change/code. I do have some concerns/suggestion around aktualizr-info in general but it's out of scope of this PR.

("allow-migrate", "Opens database in read/write mode to make possible to migrate database if needed");
("allow-migrate", "Opens database in read/write mode to make possible to migrate database if needed")
("images-snapshot", "Outputs snapshot.json from images repo")
("images-timestamp", "Outputs timestamp.json from images repo");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Very small complaint: could you move these two items between "images-root" and "images-target"? The ideal order would be: root, timestamp, snapshot, targets. That more or less matches the order they are downloaded by libaktualizr and the order in which they sign each other.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Of cause. I moved them.

…amp'

Signed-off-by: cheng.xiang <ext-cheng.xiang@here.com>
Copy link
Collaborator

@pattivacek pattivacek left a comment

Choose a reason for hiding this comment

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

Thank you! Travis is failing due to a codecov timeout; I'm merging despite that since it isn't relevant to your changes.

@pattivacek pattivacek merged commit 3de1f88 into advancedtelematic:master May 14, 2019
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

4 participants