Skip to content

Add Online Help link to gRPC interface's Platform #2009

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

Merged
merged 3 commits into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions commands/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func PlatformReleaseToRPC(platformRelease *cores.PlatformRelease) *rpc.Platform
Maintainer: platformRelease.Platform.Package.Maintainer,
Website: platformRelease.Platform.Package.WebsiteURL,
Email: platformRelease.Platform.Package.Email,
Help: &rpc.HelpResources{Online: platformRelease.Platform.Package.Help.Online},
Boards: boards,
Latest: platformRelease.Version.String(),
ManuallyInstalled: platformRelease.Platform.ManuallyInstalled,
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 @@ -62,6 +62,7 @@ func TestPlatformSearch(t *testing.T) {
Email: "[email protected]",
Boards: []*rpc.Board{{Name: "RK002"}},
Type: []string{"Contributed"},
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
})
require.Contains(t, res.SearchOutput, &rpc.Platform{
Id: "Retrokits-RK002:arm",
Expand All @@ -73,6 +74,7 @@ func TestPlatformSearch(t *testing.T) {
Email: "[email protected]",
Boards: []*rpc.Board{{Name: "RK002"}},
Type: []string{"Contributed"},
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
})

res, stat = PlatformSearch(&rpc.PlatformSearchRequest{
Expand All @@ -93,6 +95,7 @@ func TestPlatformSearch(t *testing.T) {
Email: "[email protected]",
Boards: []*rpc.Board{{Name: "RK002"}},
Type: []string{"Contributed"},
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
})

// Search the Package Maintainer
Expand All @@ -114,6 +117,7 @@ func TestPlatformSearch(t *testing.T) {
Email: "[email protected]",
Boards: []*rpc.Board{{Name: "RK002"}},
Type: []string{"Contributed"},
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
})
require.Contains(t, res.SearchOutput, &rpc.Platform{
Id: "Retrokits-RK002:arm",
Expand All @@ -125,6 +129,7 @@ func TestPlatformSearch(t *testing.T) {
Email: "[email protected]",
Boards: []*rpc.Board{{Name: "RK002"}},
Type: []string{"Contributed"},
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
})

// Search using the Package name
Expand All @@ -146,6 +151,7 @@ func TestPlatformSearch(t *testing.T) {
Email: "[email protected]",
Boards: []*rpc.Board{{Name: "RK002"}},
Type: []string{"Contributed"},
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
})
require.Contains(t, res.SearchOutput, &rpc.Platform{
Id: "Retrokits-RK002:arm",
Expand All @@ -157,6 +163,7 @@ func TestPlatformSearch(t *testing.T) {
Email: "[email protected]",
Boards: []*rpc.Board{{Name: "RK002"}},
Type: []string{"Contributed"},
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
})

// Search using the Platform name
Expand All @@ -178,6 +185,7 @@ func TestPlatformSearch(t *testing.T) {
Email: "[email protected]",
Boards: []*rpc.Board{{Name: "RK002"}},
Type: []string{"Contributed"},
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
})
require.Contains(t, res.SearchOutput, &rpc.Platform{
Id: "Retrokits-RK002:arm",
Expand All @@ -189,6 +197,7 @@ func TestPlatformSearch(t *testing.T) {
Email: "[email protected]",
Boards: []*rpc.Board{{Name: "RK002"}},
Type: []string{"Contributed"},
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
})

// Search using a board name
Expand Down Expand Up @@ -237,6 +246,7 @@ func TestPlatformSearch(t *testing.T) {
{Name: "Arduino Industrial 101"},
{Name: "Linino One"},
},
Help: &rpc.HelpResources{Online: "http://www.arduino.cc/en/Reference/HomePage"},
})

res, stat = PlatformSearch(&rpc.PlatformSearchRequest{
Expand Down Expand Up @@ -284,6 +294,7 @@ func TestPlatformSearch(t *testing.T) {
{Name: "Arduino Industrial 101"},
{Name: "Linino One"},
},
Help: &rpc.HelpResources{Online: "http://www.arduino.cc/en/Reference/HomePage"},
})
}

Expand Down
146 changes: 113 additions & 33 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.

9 changes: 9 additions & 0 deletions rpc/cc/arduino/cli/commands/v1/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ message Platform {
bool deprecated = 10;
// Type of the platform.
repeated string type = 11;
// A URL provided by the author of the platform's package, intended to point
// to their online help service.
HelpResources help = 12;
}

message InstalledPlatformReference {
Expand Down Expand Up @@ -126,3 +129,9 @@ message Profile {
// FQBN specified in the profile.
string fqbn = 2;
}

message HelpResources {
// A URL provided by the author of the platform's package, intended to point
// to their online help service.
string online = 1;
}