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 b72f5ca

Browse filesBrowse files
authored
[breaking] Renamed gRPC field cc.arduino.cli.commands.v1.PlatformRelease.type to types (#2620)
1 parent 81d517b commit b72f5ca
Copy full SHA for b72f5ca

File tree

6 files changed

+128
-92
lines changed
Filter options

6 files changed

+128
-92
lines changed

‎commands/service_platform_search_test.go

Copy file name to clipboardExpand all lines: commands/service_platform_search_test.go
+10-10Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func TestPlatformSearch(t *testing.T) {
7070
Releases: map[string]*rpc.PlatformRelease{
7171
"1.0.5": {
7272
Name: "RK002",
73-
Type: []string{"Contributed"},
73+
Types: []string{"Contributed"},
7474
Installed: false,
7575
Version: "1.0.5",
7676
Boards: []*rpc.Board{{Name: "RK002"}},
@@ -79,7 +79,7 @@ func TestPlatformSearch(t *testing.T) {
7979
},
8080
"1.0.6": {
8181
Name: "RK002",
82-
Type: []string{"Contributed"},
82+
Types: []string{"Contributed"},
8383
Installed: false,
8484
Version: "1.0.6",
8585
Boards: []*rpc.Board{{Name: "RK002"}},
@@ -110,7 +110,7 @@ func TestPlatformSearch(t *testing.T) {
110110
Releases: map[string]*rpc.PlatformRelease{
111111
"1.0.5": {
112112
Name: "RK002",
113-
Type: []string{"Contributed"},
113+
Types: []string{"Contributed"},
114114
Installed: false,
115115
Version: "1.0.5",
116116
Boards: []*rpc.Board{{Name: "RK002"}},
@@ -119,7 +119,7 @@ func TestPlatformSearch(t *testing.T) {
119119
},
120120
"1.0.6": {
121121
Name: "RK002",
122-
Type: []string{"Contributed"},
122+
Types: []string{"Contributed"},
123123
Installed: false,
124124
Version: "1.0.6",
125125
Boards: []*rpc.Board{{Name: "RK002"}},
@@ -150,7 +150,7 @@ func TestPlatformSearch(t *testing.T) {
150150
Releases: map[string]*rpc.PlatformRelease{
151151
"1.0.5": {
152152
Name: "RK002",
153-
Type: []string{"Contributed"},
153+
Types: []string{"Contributed"},
154154
Installed: false,
155155
Version: "1.0.5",
156156
Boards: []*rpc.Board{{Name: "RK002"}},
@@ -159,7 +159,7 @@ func TestPlatformSearch(t *testing.T) {
159159
},
160160
"1.0.6": {
161161
Name: "RK002",
162-
Type: []string{"Contributed"},
162+
Types: []string{"Contributed"},
163163
Installed: false,
164164
Version: "1.0.6",
165165
Boards: []*rpc.Board{{Name: "RK002"}},
@@ -190,7 +190,7 @@ func TestPlatformSearch(t *testing.T) {
190190
Releases: map[string]*rpc.PlatformRelease{
191191
"1.0.5": {
192192
Name: "RK002",
193-
Type: []string{"Contributed"},
193+
Types: []string{"Contributed"},
194194
Installed: false,
195195
Version: "1.0.5",
196196
Boards: []*rpc.Board{{Name: "RK002"}},
@@ -199,7 +199,7 @@ func TestPlatformSearch(t *testing.T) {
199199
},
200200
"1.0.6": {
201201
Name: "RK002",
202-
Type: []string{"Contributed"},
202+
Types: []string{"Contributed"},
203203
Installed: false,
204204
Version: "1.0.6",
205205
Boards: []*rpc.Board{{Name: "RK002"}},
@@ -230,7 +230,7 @@ func TestPlatformSearch(t *testing.T) {
230230
Releases: map[string]*rpc.PlatformRelease{
231231
"1.8.3": {
232232
Name: "Arduino AVR Boards",
233-
Type: []string{"Arduino"},
233+
Types: []string{"Arduino"},
234234
Installed: false,
235235
Version: "1.8.3",
236236
Boards: []*rpc.Board{
@@ -288,7 +288,7 @@ func TestPlatformSearch(t *testing.T) {
288288
Releases: map[string]*rpc.PlatformRelease{
289289
"1.8.3": {
290290
Name: "Arduino AVR Boards",
291-
Type: []string{"Arduino"},
291+
Types: []string{"Arduino"},
292292
Installed: false,
293293
Version: "1.8.3",
294294
Boards: []*rpc.Board{

‎commands/utility_core.go

Copy file name to clipboardExpand all lines: commands/utility_core.go
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func platformReleaseToRPC(platformRelease *cores.PlatformRelease) *rpc.PlatformR
7272
Version: platformRelease.Version.String(),
7373
Installed: platformRelease.IsInstalled(),
7474
MissingMetadata: missingMetadata,
75-
Type: []string{platformRelease.Category},
75+
Types: []string{platformRelease.Category},
7676
Deprecated: platformRelease.Deprecated,
7777
Compatible: platformRelease.IsCompatible(),
7878
}

‎docs/UPGRADING.md

Copy file name to clipboardExpand all lines: docs/UPGRADING.md
+36Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,42 @@ func main() {
181181

182182
The `yaml` option of the `--format` flag is no more supported. Use `--format json` if machine parsable output is needed.
183183

184+
### gRPC: The `type` field has been renamed to `types` in the `cc.arduino.cli.commands.v1.PlatformRelease` message.
185+
186+
Rebuilding the gRPC bindings from the proto files requires to rename all access to `type` field as `types`.
187+
188+
By the way, the wire protocol is not affected by this change, existing clients should work fine without modification.
189+
190+
### The `type` field has been renamed to `types` in the JSON output including a platform release.
191+
192+
Since the `type` field may contain multiple values has been renamed to `types` to better express this aspect.
193+
194+
Previously:
195+
196+
```
197+
$ arduino-cli core list --json | jq '.platforms[4].releases."1.8.13"'
198+
{
199+
"name": "Arduino SAMD (32-bits ARM Cortex-M0+) Boards",
200+
"version": "1.8.13",
201+
"type": [
202+
"Arduino"
203+
],
204+
...
205+
```
206+
207+
Now:
208+
209+
```
210+
$ arduino-cli core list --json | jq '.platforms[4].releases."1.8.13"'
211+
{
212+
"name": "Arduino SAMD (32-bits ARM Cortex-M0+) Boards",
213+
"version": "1.8.13",
214+
"types": [
215+
"Arduino"
216+
],
217+
...
218+
```
219+
184220
### The gRPC `cc.arduino.cli.commands.v1.CompileRequest.export_binaries` changed type.
185221

186222
Previously the field `export_binaries` was a `google.protobuf.BoolValue`. We used this type because it expresses this

‎internal/cli/feedback/result/rpc.go

Copy file name to clipboardExpand all lines: internal/cli/feedback/result/rpc.go
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func NewPlatformRelease(in *rpc.PlatformRelease) *PlatformRelease {
117117
res := &PlatformRelease{
118118
Name: in.GetName(),
119119
Version: in.GetVersion(),
120-
Type: in.GetType(),
120+
Types: in.GetTypes(),
121121
Installed: in.GetInstalled(),
122122
Boards: boards,
123123
Help: help,
@@ -132,7 +132,7 @@ func NewPlatformRelease(in *rpc.PlatformRelease) *PlatformRelease {
132132
type PlatformRelease struct {
133133
Name string `json:"name,omitempty"`
134134
Version string `json:"version,omitempty"`
135-
Type []string `json:"type,omitempty"`
135+
Types []string `json:"types,omitempty"`
136136
Installed bool `json:"installed,omitempty"`
137137
Boards []*Board `json:"boards,omitempty"`
138138
Help *HelpResource `json:"help,omitempty"`

0 commit comments

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