Skip to content

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

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 1 commit into from
May 30, 2024
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
20 changes: 10 additions & 10 deletions commands/service_platform_search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"}},
Expand All @@ -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"}},
Expand Down Expand Up @@ -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"}},
Expand All @@ -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"}},
Expand Down Expand Up @@ -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"}},
Expand All @@ -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"}},
Expand Down Expand Up @@ -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"}},
Expand All @@ -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"}},
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion commands/utility_core.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
Expand Down
36 changes: 36 additions & 0 deletions docs/UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions internal/cli/feedback/result/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"`
Expand Down
Loading
Loading