Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use feedback/result structs in cli commands instead of rpc ones #2389

Merged
merged 24 commits into from
Nov 6, 2023

Conversation

alessio-perugini
Copy link
Contributor

@alessio-perugini alessio-perugini commented Oct 25, 2023

Please check if the PR fulfills these requirements

See how to contribute

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

IT add a layer of mappers used only in the cli output of ours command and subcommand

What is the current behavior?

We are currently returning/using the rpc structs which isn't ideal for 2 reasons:

  • Maps can be serialized randomly
  • Enums are serialized as a number instead of their string representation.

What is the new behavior?

Does this PR introduce a breaking change, and is titled accordingly?

Other information

@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

Attention: 200 lines in your changes are missing coverage. Please review.

Comparison is base (ba72833) 64.48% compared to head (1d855a0) 64.96%.
Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2389      +/-   ##
==========================================
+ Coverage   64.48%   64.96%   +0.48%     
==========================================
  Files         207      207              
  Lines       19593    20211     +618     
==========================================
+ Hits        12634    13130     +496     
- Misses       5867     5966      +99     
- Partials     1092     1115      +23     
Flag Coverage Δ
unit 64.96% <69.32%> (+0.48%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
internal/cli/compile/compile.go 73.41% <100.00%> (+0.24%) ⬆️
internal/cli/core/list.go 95.71% <100.00%> (ø)
internal/cli/core/search.go 77.65% <100.00%> (ø)
internal/cli/lib/list.go 94.44% <100.00%> (+0.26%) ⬆️
internal/cli/upload/upload.go 56.73% <100.00%> (ø)
internal/cli/outdated/outdated.go 74.25% <92.85%> (+1.34%) ⬆️
internal/cli/sketch/new.go 90.00% <60.00%> (-3.48%) ⬇️
internal/cli/lib/examples.go 55.88% <25.00%> (ø)
internal/cli/lib/check_deps.go 76.81% <46.15%> (-6.27%) ⬇️
internal/cli/lib/search.go 67.26% <53.33%> (-0.58%) ⬇️
... and 6 more

... and 5 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alessio-perugini alessio-perugini force-pushed the map-cli-ouputs branch 4 times, most recently from c28cb14 to 50afb30 Compare October 26, 2023 08:18
@alessio-perugini alessio-perugini added topic: code Related to content of the project itself type: enhancement Proposed improvement labels Oct 26, 2023
@alessio-perugini alessio-perugini self-assigned this Oct 26, 2023
@alessio-perugini alessio-perugini added this to the Arduino CLI v0.36.0 milestone Oct 26, 2023
@alessio-perugini alessio-perugini marked this pull request as ready for review October 27, 2023 10:23
@alessio-perugini alessio-perugini linked an issue Oct 27, 2023 that may be closed by this pull request
3 tasks
@umbynos umbynos removed this from the Arduino CLI v0.36.0 milestone Oct 30, 2023
Copy link
Member

@cmaglie cmaglie left a comment

Choose a reason for hiding this comment

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

  • I've left some nitpicks here and there.
  • I don't like the enumeration handling, I've left some suggestions, but I'm not sure let's chat about it next week
  • Great work on the unit-testing 👍🏼

internal/cli/board/details.go Outdated Show resolved Hide resolved
internal/cli/board/details.go Outdated Show resolved Hide resolved
internal/cli/board/details.go Outdated Show resolved Hide resolved
internal/cli/board/details.go Outdated Show resolved Hide resolved
internal/cli/board/list.go Outdated Show resolved Hide resolved
internal/cli/lib/search.go Outdated Show resolved Hide resolved
internal/cli/lib/search.go Outdated Show resolved Hide resolved
internal/cli/lib/search.go Outdated Show resolved Hide resolved
internal/cli/lib/search.go Outdated Show resolved Hide resolved
internal/cli/monitor/monitor.go Outdated Show resolved Hide resolved
@alessio-perugini alessio-perugini merged commit 4ad18ff into master Nov 6, 2023
187 checks passed
@alessio-perugini alessio-perugini deleted the map-cli-ouputs branch November 6, 2023 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enumerations in JSON output are weird
3 participants