Skip to content

Conversation

Saviq
Copy link
Collaborator

@Saviq Saviq commented May 20, 2019

No description provided.

@codecov
Copy link

codecov bot commented May 20, 2019

Codecov Report

Merging #794 into master will increase coverage by 0.57%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #794      +/-   ##
==========================================
+ Coverage   67.69%   68.26%   +0.57%     
==========================================
  Files         177      177              
  Lines        6219     6268      +49     
==========================================
+ Hits         4210     4279      +69     
+ Misses       2009     1989      -20
Impacted Files Coverage Δ
include/multipass/cli/json_formatter.h 100% <ø> (ø) ⬆️
include/multipass/cli/yaml_formatter.h 100% <ø> (ø) ⬆️
src/client/cli/cmd/find.h 100% <ø> (ø) ⬆️
include/multipass/cli/csv_formatter.h 100% <ø> (ø) ⬆️
include/multipass/cli/table_formatter.h 100% <ø> (ø) ⬆️
include/multipass/cli/formatter.h 50% <ø> (ø) ⬆️
src/client/cli/formatter/format_utils.cpp 89.13% <100%> (+2.64%) ⬆️
src/client/cli/formatter/yaml_formatter.cpp 98.85% <100%> (+0.25%) ⬆️
src/client/cli/formatter/json_formatter.cpp 100% <100%> (ø) ⬆️
src/client/cli/formatter/table_formatter.cpp 93.67% <100%> (+1.24%) ⬆️
... and 3 more

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 cd31507...a21c29c. Read the comment docs.

@codecov
Copy link

codecov bot commented May 20, 2019

Codecov Report

Merging #794 into master will increase coverage by 0.59%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #794      +/-   ##
==========================================
+ Coverage   67.69%   68.28%   +0.59%     
==========================================
  Files         177      177              
  Lines        6219     6272      +53     
==========================================
+ Hits         4210     4283      +73     
+ Misses       2009     1989      -20
Impacted Files Coverage Δ
include/multipass/cli/json_formatter.h 100% <ø> (ø) ⬆️
include/multipass/cli/yaml_formatter.h 100% <ø> (ø) ⬆️
src/client/cli/cmd/find.h 100% <ø> (ø) ⬆️
include/multipass/cli/csv_formatter.h 100% <ø> (ø) ⬆️
include/multipass/cli/table_formatter.h 100% <ø> (ø) ⬆️
include/multipass/cli/formatter.h 50% <ø> (ø) ⬆️
src/client/cli/formatter/format_utils.cpp 89.58% <100%> (+3.09%) ⬆️
src/client/cli/formatter/yaml_formatter.cpp 98.86% <100%> (+0.27%) ⬆️
src/client/cli/formatter/json_formatter.cpp 100% <100%> (ø) ⬆️
src/client/cli/formatter/table_formatter.cpp 93.58% <100%> (+1.16%) ⬆️
... and 3 more

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 cd31507...9c72fb2. Read the comment docs.

@Saviq Saviq force-pushed the format-find-output branch from a21c29c to 1233271 Compare May 20, 2019 08:14
Copy link
Collaborator

@ricab ricab left a comment

Choose a reason for hiding this comment

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

Elegant, clear, precise. Quality coding here! I'm ready to approve, I'll just wait for your reply on a couple of comments.

Copy link
Contributor

@gerboland gerboland left a comment

Choose a reason for hiding this comment

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

The --show-unsupported table and CSV output has this for me:

core,snapcraft,core16,,Snapcraft builder for Core 16,20190515
core18,snapcraft,,,Snapcraft builder for Core 18,20190515
core,,core16,Ubuntu,Core 16,20190424
core18,,,Ubuntu,Core 18,20190213

but the YAML & JSON do not include the duplicated entries "core" and "core18" - they only have the last ones.

Very edge-case, I presume this just points out the problem with duplicate image names?

Other than issue @ricab pointed out, it's fine

Copy link
Collaborator Author

@Saviq Saviq left a comment

Choose a reason for hiding this comment

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

Very edge-case, I presume this just points out the problem with duplicate image names?

Right, I'll need to include the remote name in there after all.

@Saviq Saviq force-pushed the format-find-output branch from 4b90041 to 174f3e3 Compare May 20, 2019 13:10
@Saviq Saviq force-pushed the format-find-output branch from 174f3e3 to 64c85bf Compare May 20, 2019 13:13
@Saviq
Copy link
Collaborator Author

Saviq commented May 20, 2019

Right, I'll need to include the remote name in there after all.

@gerboland fixed, there's some duplication with the image_id thus, think it worth it abstracting out into format_utils.cpp? At first I thought I'd use a fmtlib formatter, but I'd have to modify the _ImageInfo instance to filter the aliases out…

" \"version\": \"20190520\"\n"
" }\n"
" }\n"
"}\n";
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a suggestion, raw string literals might make this nicer on the eye: https://stackoverflow.com/a/5460235

@gerboland
Copy link
Contributor

@gerboland fixed, there's some duplication with the image_id thus, think it worth it abstracting out into format_utils.cpp? At first I thought I'd use a fmtlib formatter, but I'd have to modify the _ImageInfo instance to filter the aliases out…

I don't think it's worth the trouble tbh.

@ricab
Copy link
Collaborator

ricab commented May 20, 2019

I don't think it's worth the trouble tbh.

@Saviq @gerboland I beg to differ. The "trouble" is negligible and quite worth eliminating triplication. This is the sort of thing that accumulates with time and makes bigger trouble in the long run. Just my opinion.

@Saviq
Copy link
Collaborator Author

Saviq commented May 20, 2019

@ricab @gerboland abstracted out a tiny utility for this then.

@ricab
Copy link
Collaborator

ricab commented May 20, 2019

@Saviq perfect, happy codebase says thanks 😃 And me too, thanks a lot!

Copy link
Collaborator

@ricab ricab left a comment

Choose a reason for hiding this comment

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

Detail: autocomplete for --format. Can also just be offloaded to a separate issue (it's missing for --show-unsupported too) or just left alone if we consider it an advanced option we don't want to complete. @Saviq I'll wait to know what you want to do and then approve.

Copy link
Collaborator

@ricab ricab left a comment

Choose a reason for hiding this comment

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

OK approving then

bors r=gerboland,ricab

bors bot added a commit that referenced this pull request May 20, 2019
794: [cli] format `find` output r=gerboland,ricab a=Saviq



Co-authored-by: Michał Sawicz <[email protected]>
@bors
Copy link
Contributor

bors bot commented May 20, 2019

@bors bors bot merged commit 9c72fb2 into master May 20, 2019
@bors bors bot deleted the format-find-output branch May 20, 2019 15:49
Saviq added a commit that referenced this pull request May 28, 2019
794: [cli] format `find` output r=gerboland,ricab a=Saviq



Co-authored-by: Michał Sawicz <[email protected]>
Saviq added a commit that referenced this pull request May 28, 2019
794: [cli] format `find` output r=gerboland,ricab a=Saviq



Co-authored-by: Michał Sawicz <[email protected]>
Saviq added a commit that referenced this pull request May 28, 2019
794: [cli] format `find` output r=gerboland,ricab a=Saviq



Co-authored-by: Michał Sawicz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants