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

Core search/list now return boards in a platform #268

Merged
merged 1 commit into from
Jul 9, 2019
Merged

Core search/list now return boards in a platform #268

merged 1 commit into from
Jul 9, 2019

Conversation

csweichel
Copy link
Contributor

This PR adds the list of boards supported by a platform, as well some more metadata to the response of Core/List and Core/Search. Further, does it harmonise the structures used by both operations to de-duplicate conversion code converting from the internal structures to the RPC messages.

@CLAassistant
Copy link

CLAassistant commented Jul 9, 2019

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@masci masci left a comment

Choose a reason for hiding this comment

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

Left a few nits but overall this is great, proto definition is much better now 👍

@@ -0,0 +1,37 @@
package core
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add license and copyright header?


// platformReleaseToRPC converts our internal structure to the RPC structure.
// Note: this function does not touch the "Installed" field of rpc.Platform as it's not always clear that the
// platformRelease we're currently converting is actually installed.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: there's an extra tab at the beginning of this line

func platformReleaseToRPC(platformRelease *cores.PlatformRelease) *rpc.Platform {
boards := make([]*rpc.Board, len(platformRelease.Boards))
i := 0
for _, b := range platformRelease.Boards {
Copy link
Contributor

@masci masci Jul 9, 2019

Choose a reason for hiding this comment

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

let's do for i, b := range platformRelease.Boards and let range deal with the index increments comment not relevant since it's a map

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would be my preferred way, too. Boards is a map[string].. though, thus i would not be numeric index here unfortunately.

Copy link
Contributor

Choose a reason for hiding this comment

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

oops my bad, didn't check what's been iterated here, scratch my comment!

string ID = 1;
string Version = 2;
string Name = 3;
repeated Platform search_output = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

🍰

@masci masci merged commit d80c29e into arduino:master Jul 9, 2019
@csweichel csweichel deleted the boards branch July 9, 2019 08:15
mastrolinux pushed a commit that referenced this pull request Jul 16, 2019
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