Unverified Commit b72f5ca7 authored by Cristian Maglie's avatar Cristian Maglie Committed by GitHub

[breaking] Renamed gRPC field `cc.arduino.cli.commands.v1.PlatformRelease.type` to `types` (#2620)

parent 81d517b3
......@@ -70,7 +70,7 @@ func TestPlatformSearch(t *testing.T) {
Releases: map[string]*rpc.PlatformRelease{
"1.0.5": {
Name: "RK002",
Type: []string{"Contributed"},
Types: []string{"Contributed"},
Installed: false,
Version: "1.0.5",
Boards: []*rpc.Board{{Name: "RK002"}},
......@@ -79,7 +79,7 @@ func TestPlatformSearch(t *testing.T) {
},
"1.0.6": {
Name: "RK002",
Type: []string{"Contributed"},
Types: []string{"Contributed"},
Installed: false,
Version: "1.0.6",
Boards: []*rpc.Board{{Name: "RK002"}},
......@@ -110,7 +110,7 @@ func TestPlatformSearch(t *testing.T) {
Releases: map[string]*rpc.PlatformRelease{
"1.0.5": {
Name: "RK002",
Type: []string{"Contributed"},
Types: []string{"Contributed"},
Installed: false,
Version: "1.0.5",
Boards: []*rpc.Board{{Name: "RK002"}},
......@@ -119,7 +119,7 @@ func TestPlatformSearch(t *testing.T) {
},
"1.0.6": {
Name: "RK002",
Type: []string{"Contributed"},
Types: []string{"Contributed"},
Installed: false,
Version: "1.0.6",
Boards: []*rpc.Board{{Name: "RK002"}},
......@@ -150,7 +150,7 @@ func TestPlatformSearch(t *testing.T) {
Releases: map[string]*rpc.PlatformRelease{
"1.0.5": {
Name: "RK002",
Type: []string{"Contributed"},
Types: []string{"Contributed"},
Installed: false,
Version: "1.0.5",
Boards: []*rpc.Board{{Name: "RK002"}},
......@@ -159,7 +159,7 @@ func TestPlatformSearch(t *testing.T) {
},
"1.0.6": {
Name: "RK002",
Type: []string{"Contributed"},
Types: []string{"Contributed"},
Installed: false,
Version: "1.0.6",
Boards: []*rpc.Board{{Name: "RK002"}},
......@@ -190,7 +190,7 @@ func TestPlatformSearch(t *testing.T) {
Releases: map[string]*rpc.PlatformRelease{
"1.0.5": {
Name: "RK002",
Type: []string{"Contributed"},
Types: []string{"Contributed"},
Installed: false,
Version: "1.0.5",
Boards: []*rpc.Board{{Name: "RK002"}},
......@@ -199,7 +199,7 @@ func TestPlatformSearch(t *testing.T) {
},
"1.0.6": {
Name: "RK002",
Type: []string{"Contributed"},
Types: []string{"Contributed"},
Installed: false,
Version: "1.0.6",
Boards: []*rpc.Board{{Name: "RK002"}},
......@@ -230,7 +230,7 @@ func TestPlatformSearch(t *testing.T) {
Releases: map[string]*rpc.PlatformRelease{
"1.8.3": {
Name: "Arduino AVR Boards",
Type: []string{"Arduino"},
Types: []string{"Arduino"},
Installed: false,
Version: "1.8.3",
Boards: []*rpc.Board{
......@@ -288,7 +288,7 @@ func TestPlatformSearch(t *testing.T) {
Releases: map[string]*rpc.PlatformRelease{
"1.8.3": {
Name: "Arduino AVR Boards",
Type: []string{"Arduino"},
Types: []string{"Arduino"},
Installed: false,
Version: "1.8.3",
Boards: []*rpc.Board{
......
......@@ -72,7 +72,7 @@ func platformReleaseToRPC(platformRelease *cores.PlatformRelease) *rpc.PlatformR
Version: platformRelease.Version.String(),
Installed: platformRelease.IsInstalled(),
MissingMetadata: missingMetadata,
Type: []string{platformRelease.Category},
Types: []string{platformRelease.Category},
Deprecated: platformRelease.Deprecated,
Compatible: platformRelease.IsCompatible(),
}
......
......@@ -181,6 +181,42 @@ func main() {
The `yaml` option of the `--format` flag is no more supported. Use `--format json` if machine parsable output is needed.
### gRPC: The `type` field has been renamed to `types` in the `cc.arduino.cli.commands.v1.PlatformRelease` message.
Rebuilding the gRPC bindings from the proto files requires to rename all access to `type` field as `types`.
By the way, the wire protocol is not affected by this change, existing clients should work fine without modification.
### The `type` field has been renamed to `types` in the JSON output including a platform release.
Since the `type` field may contain multiple values has been renamed to `types` to better express this aspect.
Previously:
```
$ arduino-cli core list --json | jq '.platforms[4].releases."1.8.13"'
{
"name": "Arduino SAMD (32-bits ARM Cortex-M0+) Boards",
"version": "1.8.13",
"type": [
"Arduino"
],
...
```
Now:
```
$ arduino-cli core list --json | jq '.platforms[4].releases."1.8.13"'
{
"name": "Arduino SAMD (32-bits ARM Cortex-M0+) Boards",
"version": "1.8.13",
"types": [
"Arduino"
],
...
```
### The gRPC `cc.arduino.cli.commands.v1.CompileRequest.export_binaries` changed type.
Previously the field `export_binaries` was a `google.protobuf.BoolValue`. We used this type because it expresses this
......
......@@ -117,7 +117,7 @@ func NewPlatformRelease(in *rpc.PlatformRelease) *PlatformRelease {
res := &PlatformRelease{
Name: in.GetName(),
Version: in.GetVersion(),
Type: in.GetType(),
Types: in.GetTypes(),
Installed: in.GetInstalled(),
Boards: boards,
Help: help,
......@@ -132,7 +132,7 @@ func NewPlatformRelease(in *rpc.PlatformRelease) *PlatformRelease {
type PlatformRelease struct {
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
Type []string `json:"type,omitempty"`
Types []string `json:"types,omitempty"`
Installed bool `json:"installed,omitempty"`
Boards []*Board `json:"boards,omitempty"`
Help *HelpResource `json:"help,omitempty"`
......
This diff is collapsed.
......@@ -129,7 +129,7 @@ message PlatformRelease {
// Version of the platform release
string version = 2;
// Type of the platform.
repeated string type = 3;
repeated string types = 3;
// True if the platform is installed
bool installed = 4;
// List of boards provided by the platform. If the platform is installed,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment