Skip to content

Commit 61e3e01

Browse files
committed
Added Category field to Platform gRPC struct
1 parent aa41d72 commit 61e3e01

File tree

4 files changed

+47
-22
lines changed

4 files changed

+47
-22
lines changed

Diff for: commands/core.go

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ func PlatformReleaseToRPC(platformRelease *cores.PlatformRelease) *rpc.Platform
6060
Latest: platformRelease.Version.String(),
6161
ManuallyInstalled: platformRelease.Platform.ManuallyInstalled,
6262
Deprecated: platformRelease.Platform.Deprecated,
63+
Category: platformRelease.Platform.Category,
6364
}
6465

6566
return result

Diff for: commands/core/search_test.go

+11
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ func TestPlatformSearch(t *testing.T) {
6161
Website: "https://www.retrokits.com",
6262
6363
Boards: []*rpc.Board{{Name: "RK002"}},
64+
Category: "Contributed",
6465
})
6566
require.Contains(t, res.SearchOutput, &rpc.Platform{
6667
Id: "Retrokits-RK002:arm",
@@ -71,6 +72,7 @@ func TestPlatformSearch(t *testing.T) {
7172
Website: "https://www.retrokits.com",
7273
7374
Boards: []*rpc.Board{{Name: "RK002"}},
75+
Category: "Contributed",
7476
})
7577

7678
res, stat = PlatformSearch(&rpc.PlatformSearchRequest{
@@ -90,6 +92,7 @@ func TestPlatformSearch(t *testing.T) {
9092
Website: "https://www.retrokits.com",
9193
9294
Boards: []*rpc.Board{{Name: "RK002"}},
95+
Category: "Contributed",
9396
})
9497

9598
// Search the Package Maintainer
@@ -110,6 +113,7 @@ func TestPlatformSearch(t *testing.T) {
110113
Website: "https://www.retrokits.com",
111114
112115
Boards: []*rpc.Board{{Name: "RK002"}},
116+
Category: "Contributed",
113117
})
114118
require.Contains(t, res.SearchOutput, &rpc.Platform{
115119
Id: "Retrokits-RK002:arm",
@@ -120,6 +124,7 @@ func TestPlatformSearch(t *testing.T) {
120124
Website: "https://www.retrokits.com",
121125
122126
Boards: []*rpc.Board{{Name: "RK002"}},
127+
Category: "Contributed",
123128
})
124129

125130
// Search using the Package name
@@ -140,6 +145,7 @@ func TestPlatformSearch(t *testing.T) {
140145
Website: "https://www.retrokits.com",
141146
142147
Boards: []*rpc.Board{{Name: "RK002"}},
148+
Category: "Contributed",
143149
})
144150
require.Contains(t, res.SearchOutput, &rpc.Platform{
145151
Id: "Retrokits-RK002:arm",
@@ -150,6 +156,7 @@ func TestPlatformSearch(t *testing.T) {
150156
Website: "https://www.retrokits.com",
151157
152158
Boards: []*rpc.Board{{Name: "RK002"}},
159+
Category: "Contributed",
153160
})
154161

155162
// Search using the Platform name
@@ -170,6 +177,7 @@ func TestPlatformSearch(t *testing.T) {
170177
Website: "https://www.retrokits.com",
171178
172179
Boards: []*rpc.Board{{Name: "RK002"}},
180+
Category: "Contributed",
173181
})
174182
require.Contains(t, res.SearchOutput, &rpc.Platform{
175183
Id: "Retrokits-RK002:arm",
@@ -180,6 +188,7 @@ func TestPlatformSearch(t *testing.T) {
180188
Website: "https://www.retrokits.com",
181189
182190
Boards: []*rpc.Board{{Name: "RK002"}},
191+
Category: "Contributed",
183192
})
184193

185194
// Search using a board name
@@ -199,6 +208,7 @@ func TestPlatformSearch(t *testing.T) {
199208
Maintainer: "Arduino",
200209
Website: "https://www.arduino.cc/",
201210
211+
Category: "Arduino",
202212
Boards: []*rpc.Board{
203213
{Name: "Arduino Yún"},
204214
{Name: "Arduino Uno"},
@@ -245,6 +255,7 @@ func TestPlatformSearch(t *testing.T) {
245255
Maintainer: "Arduino",
246256
Website: "https://www.arduino.cc/",
247257
258+
Category: "Arduino",
248259
Boards: []*rpc.Board{
249260
{Name: "Arduino Yún"},
250261
{Name: "Arduino Uno"},

Diff for: rpc/cc/arduino/cli/commands/v1/common.pb.go

+33-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: rpc/cc/arduino/cli/commands/v1/common.proto

+2
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ message Platform {
8080
bool manually_installed = 9;
8181
// If true this Platform has been deprecated
8282
bool deprecated = 10;
83+
// Category of the platform.
84+
string category = 11;
8385
}
8486

8587
message InstalledPlatformReference {

0 commit comments

Comments
 (0)