Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added Category field to Platform gRPC struct
  • Loading branch information
cmaglie committed Aug 29, 2022
commit 61e3e01e51f03c47994389dccf67e656068f1353
1 change: 1 addition & 0 deletions commands/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func PlatformReleaseToRPC(platformRelease *cores.PlatformRelease) *rpc.Platform
Latest: platformRelease.Version.String(),
ManuallyInstalled: platformRelease.Platform.ManuallyInstalled,
Deprecated: platformRelease.Platform.Deprecated,
Category: platformRelease.Platform.Category,
}

return result
Expand Down
11 changes: 11 additions & 0 deletions commands/core/search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func TestPlatformSearch(t *testing.T) {
Website: "https://www.retrokits.com",
Email: "[email protected]",
Boards: []*rpc.Board{{Name: "RK002"}},
Category: "Contributed",
})
require.Contains(t, res.SearchOutput, &rpc.Platform{
Id: "Retrokits-RK002:arm",
Expand All @@ -71,6 +72,7 @@ func TestPlatformSearch(t *testing.T) {
Website: "https://www.retrokits.com",
Email: "[email protected]",
Boards: []*rpc.Board{{Name: "RK002"}},
Category: "Contributed",
})

res, stat = PlatformSearch(&rpc.PlatformSearchRequest{
Expand All @@ -90,6 +92,7 @@ func TestPlatformSearch(t *testing.T) {
Website: "https://www.retrokits.com",
Email: "[email protected]",
Boards: []*rpc.Board{{Name: "RK002"}},
Category: "Contributed",
})

// Search the Package Maintainer
Expand All @@ -110,6 +113,7 @@ func TestPlatformSearch(t *testing.T) {
Website: "https://www.retrokits.com",
Email: "[email protected]",
Boards: []*rpc.Board{{Name: "RK002"}},
Category: "Contributed",
})
require.Contains(t, res.SearchOutput, &rpc.Platform{
Id: "Retrokits-RK002:arm",
Expand All @@ -120,6 +124,7 @@ func TestPlatformSearch(t *testing.T) {
Website: "https://www.retrokits.com",
Email: "[email protected]",
Boards: []*rpc.Board{{Name: "RK002"}},
Category: "Contributed",
})

// Search using the Package name
Expand All @@ -140,6 +145,7 @@ func TestPlatformSearch(t *testing.T) {
Website: "https://www.retrokits.com",
Email: "[email protected]",
Boards: []*rpc.Board{{Name: "RK002"}},
Category: "Contributed",
})
require.Contains(t, res.SearchOutput, &rpc.Platform{
Id: "Retrokits-RK002:arm",
Expand All @@ -150,6 +156,7 @@ func TestPlatformSearch(t *testing.T) {
Website: "https://www.retrokits.com",
Email: "[email protected]",
Boards: []*rpc.Board{{Name: "RK002"}},
Category: "Contributed",
})

// Search using the Platform name
Expand All @@ -170,6 +177,7 @@ func TestPlatformSearch(t *testing.T) {
Website: "https://www.retrokits.com",
Email: "[email protected]",
Boards: []*rpc.Board{{Name: "RK002"}},
Category: "Contributed",
})
require.Contains(t, res.SearchOutput, &rpc.Platform{
Id: "Retrokits-RK002:arm",
Expand All @@ -180,6 +188,7 @@ func TestPlatformSearch(t *testing.T) {
Website: "https://www.retrokits.com",
Email: "[email protected]",
Boards: []*rpc.Board{{Name: "RK002"}},
Category: "Contributed",
})

// Search using a board name
Expand All @@ -199,6 +208,7 @@ func TestPlatformSearch(t *testing.T) {
Maintainer: "Arduino",
Website: "https://www.arduino.cc/",
Email: "[email protected]",
Category: "Arduino",
Boards: []*rpc.Board{
{Name: "Arduino Yún"},
{Name: "Arduino Uno"},
Expand Down Expand Up @@ -245,6 +255,7 @@ func TestPlatformSearch(t *testing.T) {
Maintainer: "Arduino",
Website: "https://www.arduino.cc/",
Email: "[email protected]",
Category: "Arduino",
Boards: []*rpc.Board{
{Name: "Arduino Yún"},
{Name: "Arduino Uno"},
Expand Down
55 changes: 33 additions & 22 deletions rpc/cc/arduino/cli/commands/v1/common.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions rpc/cc/arduino/cli/commands/v1/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ message Platform {
bool manually_installed = 9;
// If true this Platform has been deprecated
bool deprecated = 10;
// Category of the platform.
string category = 11;
}

message InstalledPlatformReference {
Expand Down