Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 13fa409

Browse filesBrowse files
Add Online Help link to gRPC interface's Platform (#2009)
* Add online help field to rpc platform * Add online help field to the output of `core search --format json` * Add tests for the changes
1 parent de90579 commit 13fa409
Copy full SHA for 13fa409

File tree

Expand file treeCollapse file tree

4 files changed

+134
-33
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+134
-33
lines changed

‎commands/core.go

Copy file name to clipboardExpand all lines: commands/core.go
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ func PlatformReleaseToRPC(platformRelease *cores.PlatformRelease) *rpc.Platform
5656
Maintainer: platformRelease.Platform.Package.Maintainer,
5757
Website: platformRelease.Platform.Package.WebsiteURL,
5858
Email: platformRelease.Platform.Package.Email,
59+
Help: &rpc.HelpResources{Online: platformRelease.Platform.Package.Help.Online},
5960
Boards: boards,
6061
Latest: platformRelease.Version.String(),
6162
ManuallyInstalled: platformRelease.Platform.ManuallyInstalled,

‎commands/core/search_test.go

Copy file name to clipboardExpand all lines: commands/core/search_test.go
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func TestPlatformSearch(t *testing.T) {
6262
Email: "info@retrokits.com",
6363
Boards: []*rpc.Board{{Name: "RK002"}},
6464
Type: []string{"Contributed"},
65+
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
6566
})
6667
require.Contains(t, res.SearchOutput, &rpc.Platform{
6768
Id: "Retrokits-RK002:arm",
@@ -73,6 +74,7 @@ func TestPlatformSearch(t *testing.T) {
7374
Email: "info@retrokits.com",
7475
Boards: []*rpc.Board{{Name: "RK002"}},
7576
Type: []string{"Contributed"},
77+
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
7678
})
7779

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

98101
// Search the Package Maintainer
@@ -114,6 +117,7 @@ func TestPlatformSearch(t *testing.T) {
114117
Email: "info@retrokits.com",
115118
Boards: []*rpc.Board{{Name: "RK002"}},
116119
Type: []string{"Contributed"},
120+
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
117121
})
118122
require.Contains(t, res.SearchOutput, &rpc.Platform{
119123
Id: "Retrokits-RK002:arm",
@@ -125,6 +129,7 @@ func TestPlatformSearch(t *testing.T) {
125129
Email: "info@retrokits.com",
126130
Boards: []*rpc.Board{{Name: "RK002"}},
127131
Type: []string{"Contributed"},
132+
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
128133
})
129134

130135
// Search using the Package name
@@ -146,6 +151,7 @@ func TestPlatformSearch(t *testing.T) {
146151
Email: "info@retrokits.com",
147152
Boards: []*rpc.Board{{Name: "RK002"}},
148153
Type: []string{"Contributed"},
154+
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
149155
})
150156
require.Contains(t, res.SearchOutput, &rpc.Platform{
151157
Id: "Retrokits-RK002:arm",
@@ -157,6 +163,7 @@ func TestPlatformSearch(t *testing.T) {
157163
Email: "info@retrokits.com",
158164
Boards: []*rpc.Board{{Name: "RK002"}},
159165
Type: []string{"Contributed"},
166+
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
160167
})
161168

162169
// Search using the Platform name
@@ -178,6 +185,7 @@ func TestPlatformSearch(t *testing.T) {
178185
Email: "info@retrokits.com",
179186
Boards: []*rpc.Board{{Name: "RK002"}},
180187
Type: []string{"Contributed"},
188+
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
181189
})
182190
require.Contains(t, res.SearchOutput, &rpc.Platform{
183191
Id: "Retrokits-RK002:arm",
@@ -189,6 +197,7 @@ func TestPlatformSearch(t *testing.T) {
189197
Email: "info@retrokits.com",
190198
Boards: []*rpc.Board{{Name: "RK002"}},
191199
Type: []string{"Contributed"},
200+
Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"},
192201
})
193202

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

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

‎rpc/cc/arduino/cli/commands/v1/common.pb.go

Copy file name to clipboardExpand all lines: rpc/cc/arduino/cli/commands/v1/common.pb.go
+113-33Lines changed: 113 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎rpc/cc/arduino/cli/commands/v1/common.proto

Copy file name to clipboardExpand all lines: rpc/cc/arduino/cli/commands/v1/common.proto
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ message Platform {
9999
bool deprecated = 10;
100100
// Type of the platform.
101101
repeated string type = 11;
102+
// A URL provided by the author of the platform's package, intended to point
103+
// to their online help service.
104+
HelpResources help = 12;
102105
}
103106

104107
message InstalledPlatformReference {
@@ -126,3 +129,9 @@ message Profile {
126129
// FQBN specified in the profile.
127130
string fqbn = 2;
128131
}
132+
133+
message HelpResources {
134+
// A URL provided by the author of the platform's package, intended to point
135+
// to their online help service.
136+
string online = 1;
137+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.