From edcdefa48d3ea6a5c1668fd3db51119c7faeeb29 Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Wed, 8 Nov 2023 11:35:07 +0100 Subject: [PATCH] cr: remove `latest_compatible_version` from gRPC api. We leave only the `latest_compatible` field from the API. This field will have the same meaning the the former `latest_compatible_version`. Meaning that if the `latest_compatible` contains a version it is a release that can be installed. However it might happen that we have newer releases that cannot be installed. If the client is interested to show newer-non-installable-releases, the `releases` field can be used to infer that. --- .../cores/packagemanager/package_manager.go | 10 +- commands/core/search.go | 24 ++- commands/core/search_test.go | 37 +---- internal/cli/arguments/completion.go | 2 +- internal/cli/core/list.go | 8 +- internal/cli/core/search.go | 4 +- internal/cli/core/upgrade.go | 4 +- internal/cli/feedback/result/rpc.go | 31 ++-- internal/cli/outdated/outdated.go | 6 +- internal/integrationtest/core/core_test.go | 87 ++++++---- rpc/cc/arduino/cli/commands/v1/common.go | 9 - rpc/cc/arduino/cli/commands/v1/common.pb.go | 155 ++++++++---------- rpc/cc/arduino/cli/commands/v1/common.proto | 10 +- 13 files changed, 180 insertions(+), 207 deletions(-) diff --git a/arduino/cores/packagemanager/package_manager.go b/arduino/cores/packagemanager/package_manager.go index 1f2b380e08a..96251d93f4d 100644 --- a/arduino/cores/packagemanager/package_manager.go +++ b/arduino/cores/packagemanager/package_manager.go @@ -229,14 +229,20 @@ func (pme *Explorer) GetCustomGlobalProperties() *properties.Map { } // FindPlatformReleaseProvidingBoardsWithVidPid FIXMEDOC -func (pme *Explorer) FindPlatformReleaseProvidingBoardsWithVidPid(vid, pid string) []*cores.Platform { +func (pme *Explorer) FindPlatformReleaseProvidingBoardsWithVidPid(vid, pid string, showAllRelease bool) []*cores.Platform { res := []*cores.Platform{} for _, targetPackage := range pme.packages { for _, targetPlatform := range targetPackage.Platforms { - platformRelease := targetPlatform.GetLatestRelease() + var platformRelease *cores.PlatformRelease + if showAllRelease { + platformRelease = targetPlatform.GetLatestRelease() + } else { + platformRelease = targetPlatform.GetLatestCompatibleRelease() + } if platformRelease == nil { continue } + for _, boardManifest := range platformRelease.BoardsManifest { if boardManifest.HasUsbID(vid, pid) { res = append(res, targetPlatform) diff --git a/commands/core/search.go b/commands/core/search.go index c766d8637e4..0b42f1fa37f 100644 --- a/commands/core/search.go +++ b/commands/core/search.go @@ -39,7 +39,7 @@ func PlatformSearch(req *rpc.PlatformSearchRequest) (*rpc.PlatformSearchResponse res := []*cores.Platform{} if isUsb, _ := regexp.MatchString("[0-9a-f]{4}:[0-9a-f]{4}", req.SearchArgs); isUsb { vid, pid := req.SearchArgs[:4], req.SearchArgs[5:] - res = pme.FindPlatformReleaseProvidingBoardsWithVidPid(vid, pid) + res = pme.FindPlatformReleaseProvidingBoardsWithVidPid(vid, pid, req.AllVersions) } else { searchArgs := utils.SearchTermsFromQueryString(req.SearchArgs) for _, targetPackage := range pme.GetPackages() { @@ -53,12 +53,15 @@ func PlatformSearch(req *rpc.PlatformSearchRequest) (*rpc.PlatformSearchResponse continue } - // Discard platforms with no releases - latestRelease := platform.GetLatestRelease() - if latestRelease == nil { - continue + // In case we ask for all versions we also show incompatible ones + var latestRelease *cores.PlatformRelease + if req.AllVersions { + latestRelease = platform.GetLatestRelease() + } else { + latestRelease = platform.GetLatestCompatibleRelease() } - if latestRelease.Name == "" { + // Discard platforms with no releases + if latestRelease == nil || latestRelease.Name == "" { continue } @@ -93,12 +96,8 @@ func PlatformSearch(req *rpc.PlatformSearchRequest) (*rpc.PlatformSearchResponse rpcPlatformSummary.InstalledVersion = installed.Version.String() rpcPlatformSummary.Releases[installed.Version.String()] = commands.PlatformReleaseToRPC(installed) } - if latest := platform.GetLatestRelease(); latest != nil { - rpcPlatformSummary.LatestVersion = latest.Version.String() - rpcPlatformSummary.Releases[latest.Version.String()] = commands.PlatformReleaseToRPC(latest) - } if latestCompatible := platform.GetLatestCompatibleRelease(); latestCompatible != nil { - rpcPlatformSummary.LatestCompatibleVersion = latestCompatible.Version.String() + rpcPlatformSummary.LatestVersion = latestCompatible.Version.String() rpcPlatformSummary.Releases[latestCompatible.Version.String()] = commands.PlatformReleaseToRPC(latestCompatible) } if req.AllVersions { @@ -112,8 +111,7 @@ func PlatformSearch(req *rpc.PlatformSearchRequest) (*rpc.PlatformSearchResponse // Sort result alphabetically and put deprecated platforms at the bottom sort.Slice(out, func(i, j int) bool { - return strings.ToLower(out[i].GetLatestRelease().GetName()) < - strings.ToLower(out[j].GetLatestRelease().GetName()) + return strings.ToLower(out[i].GetLatestRelease().GetName()) < strings.ToLower(out[j].GetLatestRelease().GetName()) }) sort.SliceStable(out, func(i, j int) bool { return !out[i].GetMetadata().Deprecated && out[j].GetMetadata().Deprecated diff --git a/commands/core/search_test.go b/commands/core/search_test.go index 2babe57ea81..60f3f91a72a 100644 --- a/commands/core/search_test.go +++ b/commands/core/search_test.go @@ -80,11 +80,11 @@ func TestPlatformSearch(t *testing.T) { }, }, InstalledVersion: "", - LatestVersion: "1.0.6", }) }) t.Run("SearchNoAllVersions", func(t *testing.T) { + // This platform doesn't contain any installable release res, stat := PlatformSearch(&rpc.PlatformSearchRequest{ Instance: inst, SearchArgs: "retrokit", @@ -92,29 +92,7 @@ func TestPlatformSearch(t *testing.T) { }) require.Nil(t, stat) require.NotNil(t, res) - require.Len(t, res.SearchOutput, 1) - require.Contains(t, res.SearchOutput, &rpc.PlatformSummary{ - Metadata: &rpc.PlatformMetadata{ - Id: "Retrokits-RK002:arm", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Indexed: true, - }, - Releases: map[string]*rpc.PlatformRelease{ - "1.0.6": { - Name: "RK002", - Type: []string{"Contributed"}, - Installed: false, - Version: "1.0.6", - Boards: []*rpc.Board{{Name: "RK002"}}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, - Compatible: false, - }, - }, - InstalledVersion: "", - LatestVersion: "1.0.6", - }) + require.Empty(t, res.SearchOutput) }) t.Run("SearchThePackageMaintainer", func(t *testing.T) { @@ -155,7 +133,6 @@ func TestPlatformSearch(t *testing.T) { }, }, InstalledVersion: "", - LatestVersion: "1.0.6", }) }) @@ -197,7 +174,6 @@ func TestPlatformSearch(t *testing.T) { }, }, InstalledVersion: "", - LatestVersion: "1.0.6", }) }) @@ -239,7 +215,6 @@ func TestPlatformSearch(t *testing.T) { }, }, InstalledVersion: "", - LatestVersion: "1.0.6", }) }) @@ -299,7 +274,6 @@ func TestPlatformSearch(t *testing.T) { }, }, InstalledVersion: "", - LatestVersion: "1.8.3", }) }) @@ -359,7 +333,6 @@ func TestPlatformSearch(t *testing.T) { }, }, InstalledVersion: "", - LatestVersion: "1.8.3", }) }) } @@ -383,15 +356,15 @@ func TestPlatformSearchSorting(t *testing.T) { res, stat := PlatformSearch(&rpc.PlatformSearchRequest{ Instance: inst, SearchArgs: "", - AllVersions: false, + AllVersions: true, }) require.Nil(t, stat) require.NotNil(t, res) require.Len(t, res.SearchOutput, 3) - require.Equal(t, res.SearchOutput[0].GetLatestRelease().Name, "Arduino AVR Boards") + require.Equal(t, res.SearchOutput[0].GetSortedReleases()[0].Name, "Arduino AVR Boards") require.Equal(t, res.SearchOutput[0].Metadata.Deprecated, false) - require.Equal(t, res.SearchOutput[1].GetLatestRelease().Name, "RK002") + require.Equal(t, res.SearchOutput[1].GetSortedReleases()[0].Name, "RK002") require.Equal(t, res.SearchOutput[1].Metadata.Deprecated, false) require.Equal(t, res.SearchOutput[2].GetLatestRelease().Name, "Platform") require.Equal(t, res.SearchOutput[2].Metadata.Deprecated, true) diff --git a/internal/cli/arguments/completion.go b/internal/cli/arguments/completion.go index 843f200c42b..b5c6d8f455f 100644 --- a/internal/cli/arguments/completion.go +++ b/internal/cli/arguments/completion.go @@ -113,7 +113,7 @@ func GetInstallableCores() []string { var res []string // transform the data structure for the completion for _, i := range platforms.GetSearchOutput() { - if latest := i.GetLatestCompatibleRelease(); latest != nil { + if latest := i.GetLatestRelease(); latest != nil { res = append(res, i.GetMetadata().GetId()+"\t"+latest.GetName()) } } diff --git a/internal/cli/core/list.go b/internal/cli/core/list.go index 502ce85ac20..58f8d6f8c82 100644 --- a/internal/cli/core/list.go +++ b/internal/cli/core/list.go @@ -80,7 +80,7 @@ func GetList(inst *rpc.Instance, all bool, updatableOnly bool) []*rpc.PlatformSu if platform.InstalledVersion == "" && !platform.GetMetadata().ManuallyInstalled { continue } - if updatableOnly && platform.InstalledVersion == platform.LatestCompatibleVersion { + if updatableOnly && platform.InstalledVersion == platform.LatestVersion { continue } result = append(result, platform) @@ -122,9 +122,7 @@ func (ir coreListResult) String() string { name = installed.Name } if name == "" { - if latestCompatible := platform.GetLatestCompatibleRelease(); latestCompatible != nil { - name = latestCompatible.Name - } else if latest := platform.GetLatestRelease(); latest != nil && name == "" { + if latest := platform.GetLatestRelease(); latest != nil { name = latest.Name } } @@ -132,7 +130,7 @@ func (ir coreListResult) String() string { name = fmt.Sprintf("[%s] %s", tr("DEPRECATED"), name) } - t.AddRow(platform.Id, platform.InstalledVersion, platform.LatestCompatibleVersion, name) + t.AddRow(platform.Id, platform.InstalledVersion, platform.LatestVersion, name) } return t.Render() diff --git a/internal/cli/core/search.go b/internal/cli/core/search.go index 4e20a129368..e1f0cd67444 100644 --- a/internal/cli/core/search.go +++ b/internal/cli/core/search.go @@ -125,8 +125,8 @@ func (sr searchResults) String() string { for _, platform := range sr.platforms { // When allVersions is not requested we only show the latest compatible version if !sr.allVersions { - if latestCompatible := platform.GetLatestCompatibleRelease(); latestCompatible != nil { - addRow(platform, latestCompatible) + if latest := platform.GetLatestRelease(); latest != nil { + addRow(platform, latest) } continue } diff --git a/internal/cli/core/upgrade.go b/internal/cli/core/upgrade.go index d6dfd243aed..b73769622bf 100644 --- a/internal/cli/core/upgrade.go +++ b/internal/cli/core/upgrade.go @@ -73,13 +73,13 @@ func Upgrade(inst *rpc.Instance, args []string, skipPostInstall bool, skipPreUni if platform.InstalledVersion == "" { continue } - if platform.InstalledVersion == platform.LatestCompatibleVersion { + if platform.InstalledVersion == platform.GetLatestVersion() { // if it's not updatable, skip it continue } targets = append(targets, &rpc.Platform{ Metadata: platform.GetMetadata(), - Release: platform.GetLatestCompatibleRelease(), + Release: platform.GetLatestRelease(), }) } diff --git a/internal/cli/feedback/result/rpc.go b/internal/cli/feedback/result/rpc.go index 1d9664f9cec..f60b8fee98f 100644 --- a/internal/cli/feedback/result/rpc.go +++ b/internal/cli/feedback/result/rpc.go @@ -37,17 +37,16 @@ func NewPlatformSummary(in *rpc.PlatformSummary) *PlatformSummary { releases.SortKeys((*semver.Version).CompareTo) return &PlatformSummary{ - Id: in.GetMetadata().GetId(), - Maintainer: in.GetMetadata().GetMaintainer(), - Website: in.GetMetadata().GetWebsite(), - Email: in.GetMetadata().GetEmail(), - ManuallyInstalled: in.GetMetadata().GetManuallyInstalled(), - Deprecated: in.GetMetadata().GetDeprecated(), - Indexed: in.GetMetadata().GetIndexed(), - Releases: releases, - InstalledVersion: semver.MustParse(in.GetInstalledVersion()), - LatestVersion: semver.MustParse(in.GetLatestVersion()), - LatestCompatibleVersion: semver.MustParse(in.LatestCompatibleVersion), + Id: in.GetMetadata().GetId(), + Maintainer: in.GetMetadata().GetMaintainer(), + Website: in.GetMetadata().GetWebsite(), + Email: in.GetMetadata().GetEmail(), + ManuallyInstalled: in.GetMetadata().GetManuallyInstalled(), + Deprecated: in.GetMetadata().GetDeprecated(), + Indexed: in.GetMetadata().GetIndexed(), + Releases: releases, + InstalledVersion: semver.MustParse(in.GetInstalledVersion()), + LatestVersion: semver.MustParse(in.GetLatestVersion()), } } @@ -63,9 +62,8 @@ type PlatformSummary struct { Releases orderedmap.Map[*semver.Version, *PlatformRelease] `json:"releases,omitempty"` - InstalledVersion *semver.Version `json:"installed_version,omitempty"` - LatestVersion *semver.Version `json:"latest_version,omitempty"` - LatestCompatibleVersion *semver.Version `json:"latest_compatible_version,omitempty"` + InstalledVersion *semver.Version `json:"installed_version,omitempty"` + LatestVersion *semver.Version `json:"latest_version,omitempty"` } // GetLatestRelease returns the latest relase of this platform or nil if none available. @@ -73,11 +71,6 @@ func (p *PlatformSummary) GetLatestRelease() *PlatformRelease { return p.Releases.Get(p.LatestVersion) } -// GetLatestCompatibleRelease returns the latest relase of this platform or nil if none available. -func (p *PlatformSummary) GetLatestCompatibleRelease() *PlatformRelease { - return p.Releases.Get(p.LatestCompatibleVersion) -} - // GetInstalledRelease returns the installed relase of this platform or nil if none available. func (p *PlatformSummary) GetInstalledRelease() *PlatformRelease { return p.Releases.Get(p.InstalledVersion) diff --git a/internal/cli/outdated/outdated.go b/internal/cli/outdated/outdated.go index 9d4cb39f218..39cba04481c 100644 --- a/internal/cli/outdated/outdated.go +++ b/internal/cli/outdated/outdated.go @@ -109,13 +109,13 @@ func (ir outdatedResult) String() string { // Based on internal/cli/core/list.go for _, p := range ir.Platforms { name := "" - if latestCompatible := p.GetLatestCompatibleRelease(); latestCompatible != nil { - name = latestCompatible.Name + if latest := p.GetLatestRelease(); latest != nil { + name = latest.Name } if p.Deprecated { name = fmt.Sprintf("[%s] %s", tr("DEPRECATED"), name) } - t.AddRow(p.Id, name, p.InstalledVersion, p.LatestCompatibleVersion, "", "") + t.AddRow(p.Id, name, p.InstalledVersion, p.LatestVersion, "", "") } // Based on internal/cli/lib/list.go diff --git a/internal/integrationtest/core/core_test.go b/internal/integrationtest/core/core_test.go index 6406bf3854d..1763f87eb4f 100644 --- a/internal/integrationtest/core/core_test.go +++ b/internal/integrationtest/core/core_test.go @@ -182,7 +182,7 @@ func TestCoreSearchNoArgs(t *testing.T) { stdout, _, err = cli.Run("core", "search", "--format", "json") require.NoError(t, err) requirejson.Contains(t, stdout, `[{"id": "test:x86", "releases": { "2.0.0": {"name":"test_core"}}}]`) - requirejson.Query(t, stdout, `[.[] | select(.latest_compatible_version != "")] | length`, fmt.Sprint(numPlatforms)) + requirejson.Query(t, stdout, `[.[] | select(.latest_version != "")] | length`, fmt.Sprint(numPlatforms)) // list all with additional urls, check the test core is there stdout, _, err = cli.Run("core", "search", "--additional-urls="+url.String()) @@ -198,8 +198,8 @@ func TestCoreSearchNoArgs(t *testing.T) { // same thing in JSON format, also check the number of platforms found is the same stdout, _, err = cli.Run("core", "search", "--format", "json", "--additional-urls="+url.String()) require.NoError(t, err) - requirejson.Contains(t, stdout, `[{"id": "test:x86", "releases": { "3.0.0": {"name":"test_core"}}}]`) - requirejson.Query(t, stdout, `[.[] | select(.latest_compatible_version != "")] | length`, fmt.Sprint(numPlatforms)) + requirejson.NotContains(t, stdout, `[{"id": "test:x86", "releases": { "3.0.0": {"name":"test_core"}}}]`) + requirejson.Query(t, stdout, `[.[] | select(.latest_version != "")] | length`, fmt.Sprint(numPlatforms)) } func TestCoreUpdateIndexUrlNotFound(t *testing.T) { @@ -1111,6 +1111,12 @@ func TestCoreListWhenNoPlatformAreInstalled(t *testing.T) { } func TestCoreHavingIncompatibleDepTools(t *testing.T) { + /** + The `core list`, `core search`, and the combiation of `--all` have slightly different behaviour in how the + populate the `releases` field. + - `core list`, `core list --all`, and `core search --all` always shows every existent platform versions. + - `core search` shows upmost 2 versions: the currently installed and the newer installable one. + **/ env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t) defer env.CleanUp() @@ -1120,51 +1126,70 @@ func TestCoreHavingIncompatibleDepTools(t *testing.T) { _, _, err := cli.Run("core", "update-index", additionalURLs) require.NoError(t, err) - // check that list shows only compatible versions + // the `latest_version` must point to an installable release. In the releases field the latest entry points to an incompatible version. stdout, _, err := cli.Run("core", "list", "--all", "--format", "json", additionalURLs) require.NoError(t, err) - t.Log(string(stdout)) - requirejson.Query(t, stdout, `.[] | select(.id == "foo_vendor:avr") | .latest_version`, `"1.0.2"`) - requirejson.Query(t, stdout, `.[] | select(.id == "foo_vendor:avr") | .latest_compatible_version`, `"1.0.1"`) + requirejson.Parse(t, stdout). + Query(`.[] | select(.id == "foo_vendor:avr")`). + MustContain(`{ + "installed_version": "", + "latest_version": "1.0.1", + "releases": { + "1.0.0": {"compatible": true}, + "1.0.1": {"compatible": true}, + "1.0.2": {"compatible": false} + } + }`) // install latest compatible version _, _, err = cli.Run("core", "install", "foo_vendor:avr", additionalURLs) require.NoError(t, err) stdout, _, err = cli.Run("core", "list", "--all", "--format", "json", additionalURLs) require.NoError(t, err) - requirejson.Query(t, stdout, `.[] | select(.id == "foo_vendor:avr") | .latest_compatible_version`, `"1.0.1"`) + requirejson.Parse(t, stdout). + Query(`.[] | select(.id == "foo_vendor:avr")`). + MustContain(`{ + "latest_version": "1.0.1", + "installed_version": "1.0.1", + "releases": {"1.0.1": {"compatible": true}} + }`) // install incompatible version _, stderr, err := cli.Run("core", "install", "foo_vendor:avr@1.0.2", additionalURLs) require.Error(t, err) require.Contains(t, string(stderr), "no versions available for the current OS") - // install compatible version + // install a specific compatible version _, _, err = cli.Run("core", "install", "foo_vendor:avr@1.0.0", additionalURLs) require.NoError(t, err) stdout, _, err = cli.Run("core", "list", "--format", "json", additionalURLs) require.NoError(t, err) - requirejson.Query(t, stdout, `.[] | select(.id == "foo_vendor:avr") | .installed_version`, `"1.0.0"`) + requirejson.Parse(t, stdout). + Query(`.[] | select(.id == "foo_vendor:avr")`). + MustContain(`{"installed_version": "1.0.0", "releases": {"1.0.0": {"compatible": true}}}`) // Lists all updatable cores stdout, _, err = cli.Run("core", "list", "--updatable", "--format", "json", additionalURLs) require.NoError(t, err) - requirejson.Query(t, stdout, `.[] | select(.id == "foo_vendor:avr") | .latest_compatible_version`, `"1.0.1"`) + requirejson.Parse(t, stdout). + Query(`.[] | select(.id == "foo_vendor:avr")`). + MustContain(`{"latest_version": "1.0.1", "releases": {"1.0.1": {"compatible": true}}}`) // Show outdated cores, must show latest compatible stdout, _, err = cli.Run("outdated", "--format", "json", additionalURLs) require.NoError(t, err) - requirejson.Query(t, stdout, - `.platforms | .[] | select(.id == "foo_vendor:avr") | {latest_compatible: .latest_compatible_version, latest: .latest_version}`, - `{"latest_compatible": "1.0.1", "latest": "1.0.2"}`, - ) + requirejson.Parse(t, stdout). + Query(`.platforms | .[] | select(.id == "foo_vendor:avr")`). + MustContain(`{"latest_version": "1.0.1", "releases":{"1.0.1": {"compatible": true}}}`) // upgrade to latest compatible (1.0.0 -> 1.0.1) _, _, err = cli.Run("core", "upgrade", "foo_vendor:avr", "--format", "json", additionalURLs) require.NoError(t, err) stdout, _, err = cli.Run("core", "list", "--format", "json", additionalURLs) require.NoError(t, err) - requirejson.Query(t, stdout, `.[] | select(.id == "foo_vendor:avr") | .installed_version`, `"1.0.1"`) + requirejson.Parse(t, stdout). + Query(`.[] | select(.id == "foo_vendor:avr") | .releases[.installed_version]`). + MustContain(`{"version": "1.0.1", "compatible": true}`) // upgrade to latest incompatible not possible (1.0.1 -> 1.0.2) _, _, err = cli.Run("core", "upgrade", "foo_vendor:avr", "--format", "json", additionalURLs) @@ -1174,27 +1199,31 @@ func TestCoreHavingIncompatibleDepTools(t *testing.T) { requirejson.Query(t, stdout, `.[] | select(.id == "foo_vendor:avr") | .installed_version`, `"1.0.1"`) // When no compatible version are found return error + // When trying to install a platform with no compatible version fails _, stderr, err = cli.Run("core", "install", "incompatible_vendor:avr", additionalURLs) require.Error(t, err) - require.Contains(t, string(stderr), "has no available releases for your OS") + //require.Contains(t, string(stderr), "has no available releases for your OS") + require.Contains(t, string(stderr), "Invalid argument passed: Platform 'incompatible_vendor:avr' not found") - // Core search --all shows incompatible field when a version is incompatible + // Core search --all shows all the releases even the incompatible ones stdout, _, err = cli.Run("core", "search", "--all", "--format", "json", additionalURLs) require.NoError(t, err) - requirejson.Query(t, stdout, - `[.[] | select(.id == "foo_vendor:avr") | .releases | map(.) | .[] | {version: .version, compatible: .compatible}] | sort_by(.version)`, - `[ - {"compatible":true,"version":"1.0.0"}, - {"compatible":true,"version":"1.0.1"}, - {"compatible":false,"version":"1.0.2"} - ]`, - ) + requirejson.Parse(t, stdout). + Query(`.[] | select(.id == "foo_vendor:avr")`). + MustContain(`{"releases": { + "1.0.0": {"compatible": true}, + "1.0.1": {"compatible": true}, + "1.0.2": {"compatible": false} + }}`) - // Core search shows latest compatible version even if incompatible + // Core search shows only cores that contains at least 1 installable release stdout, _, err = cli.Run("core", "search", "--format", "json", additionalURLs) require.NoError(t, err) - requirejson.Query(t, stdout, `.[] | select(.id == "foo_vendor:avr") | .latest_version`, `"1.0.2"`) - requirejson.Query(t, stdout, `.[] | select(.id == "incompatible_vendor:avr") | .releases[.latest_version].compatible`, `false`) + requirejson.Parse(t, stdout).Query(`[.[] | select(.id == "incompatible_vendor:avr")]`).MustBeEmpty() + requirejson.Query(t, stdout, `.[] | select(.id == "foo_vendor:avr") | .releases | length`, `1`) + requirejson.Parse(t, stdout). + Query(`.[] | select(.id == "foo_vendor:avr") | .releases[.latest_version]`). + MustContain(`{"version":"1.0.1", "compatible":true}`) // In text mode, core search doesn't show any version if no compatible one are present stdout, _, err = cli.Run("core", "search", additionalURLs) diff --git a/rpc/cc/arduino/cli/commands/v1/common.go b/rpc/cc/arduino/cli/commands/v1/common.go index e98b59780d3..a04ebff193f 100644 --- a/rpc/cc/arduino/cli/commands/v1/common.go +++ b/rpc/cc/arduino/cli/commands/v1/common.go @@ -78,15 +78,6 @@ func (s *PlatformSummary) GetLatestRelease() *PlatformRelease { return s.Releases[s.LatestVersion] } -// GetLatestCompatibleRelease returns the latest compatible release in this PlatformSummary, -// or nil if not available. -func (s *PlatformSummary) GetLatestCompatibleRelease() *PlatformRelease { - if s.LatestCompatibleVersion == "" { - return nil - } - return s.Releases[s.LatestCompatibleVersion] -} - // GetInstalledRelease returns the latest release in this PlatformSummary, // or nil if not available. func (s *PlatformSummary) GetInstalledRelease() *PlatformRelease { diff --git a/rpc/cc/arduino/cli/commands/v1/common.pb.go b/rpc/cc/arduino/cli/commands/v1/common.pb.go index 66f1cd1d14b..28bc1b6ed68 100644 --- a/rpc/cc/arduino/cli/commands/v1/common.pb.go +++ b/rpc/cc/arduino/cli/commands/v1/common.pb.go @@ -560,11 +560,9 @@ type PlatformSummary struct { Releases map[string]*PlatformRelease `protobuf:"bytes,2,rep,name=releases,proto3" json:"releases,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // The installed version of the platform, or empty string if none installed InstalledVersion string `protobuf:"bytes,3,opt,name=installed_version,json=installedVersion,proto3" json:"installed_version,omitempty"` - // The latest available version of the platform, or empty if none available + // The latest available version of the platform that can be installable, or + // empty if none available. LatestVersion string `protobuf:"bytes,4,opt,name=latest_version,json=latestVersion,proto3" json:"latest_version,omitempty"` - // The latest available version of the platform containing all compatible - // dependencies, or empty if none available - LatestCompatibleVersion string `protobuf:"bytes,5,opt,name=latest_compatible_version,json=latestCompatibleVersion,proto3" json:"latest_compatible_version,omitempty"` } func (x *PlatformSummary) Reset() { @@ -627,13 +625,6 @@ func (x *PlatformSummary) GetLatestVersion() string { return "" } -func (x *PlatformSummary) GetLatestCompatibleVersion() string { - if x != nil { - return x.LatestCompatibleVersion - } - return "" -} - // PlatformMetadata contains generic information about a platform (not // correlated to a specific release). type PlatformMetadata struct { @@ -771,8 +762,8 @@ type PlatformRelease struct { MissingMetadata bool `protobuf:"varint,7,opt,name=missing_metadata,json=missingMetadata,proto3" json:"missing_metadata,omitempty"` // True this release is deprecated Deprecated bool `protobuf:"varint,8,opt,name=deprecated,proto3" json:"deprecated,omitempty"` - // True if the platform dependencies are available for the current OS. This - // also means that the platform is installable. + // True if the platform dependencies are available for the current OS/ARCH. + // This also means that the platform is installable. Compatible bool `protobuf:"varint,9,opt,name=compatible,proto3" json:"compatible,omitempty"` } @@ -1171,7 +1162,7 @@ var file_cc_arduino_cli_commands_v1_common_proto_rawDesc = []byte{ 0x32, 0x2b, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x07, 0x72, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0xac, 0x03, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x74, 0x66, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0xf0, 0x02, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x48, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, @@ -1187,76 +1178,72 @@ var file_cc_arduino_cli_commands_v1_common_proto_rawDesc = []byte{ 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x3a, 0x0a, 0x19, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, - 0x69, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x17, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x74, - 0x69, 0x62, 0x6c, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x68, 0x0a, 0x0d, 0x52, - 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x41, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, - 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xdb, 0x01, 0x0a, 0x10, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x61, - 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x65, - 0x62, 0x73, 0x69, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x77, 0x65, 0x62, - 0x73, 0x69, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x2d, 0x0a, 0x12, 0x6d, 0x61, - 0x6e, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x6d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x6c, 0x79, - 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, - 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, - 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x65, 0x64, 0x22, 0xd6, 0x02, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, - 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x39, 0x0a, 0x06, 0x62, 0x6f, 0x61, 0x72, 0x64, - 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, - 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x52, 0x06, 0x62, 0x6f, 0x61, 0x72, - 0x64, 0x73, 0x12, 0x3d, 0x0a, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x29, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, - 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, - 0x6c, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x04, 0x68, 0x65, 0x6c, - 0x70, 0x12, 0x29, 0x0a, 0x10, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x6d, 0x69, 0x73, - 0x73, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1e, 0x0a, 0x0a, - 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, - 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x6c, 0x65, 0x22, 0x88, 0x01, 0x0a, - 0x1a, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, - 0x5f, 0x64, 0x69, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, - 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, - 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x22, 0x2f, 0x0a, 0x05, 0x42, 0x6f, 0x61, 0x72, 0x64, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x22, 0x31, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x66, - 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x22, 0x27, 0x0a, 0x0d, 0x48, - 0x65, 0x6c, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, - 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x6e, - 0x6c, 0x69, 0x6e, 0x65, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, - 0x6e, 0x6f, 0x2d, 0x63, 0x6c, 0x69, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x63, 0x2f, 0x61, 0x72, - 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x63, 0x6c, 0x69, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x0d, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, + 0x68, 0x0a, 0x0d, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x41, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, + 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xdb, 0x01, 0x0a, 0x10, 0x50, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, + 0x0a, 0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x18, + 0x0a, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x2d, + 0x0a, 0x12, 0x6d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x6d, 0x61, 0x6e, 0x75, + 0x61, 0x6c, 0x6c, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x1e, 0x0a, + 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, + 0x07, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x22, 0xd6, 0x02, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x74, + 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, + 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x39, 0x0a, 0x06, 0x62, + 0x6f, 0x61, 0x72, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x63, + 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x52, 0x06, + 0x62, 0x6f, 0x61, 0x72, 0x64, 0x73, 0x12, 0x3d, 0x0a, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, + 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x48, 0x65, 0x6c, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, + 0x04, 0x68, 0x65, 0x6c, 0x70, 0x12, 0x29, 0x0a, 0x10, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, + 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, + 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x6c, 0x65, + 0x22, 0x88, 0x01, 0x0a, 0x1a, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x50, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x22, 0x2f, 0x0a, 0x05, 0x42, + 0x6f, 0x61, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x71, 0x62, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x22, 0x31, 0x0a, 0x07, + 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, + 0x71, 0x62, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x22, + 0x27, 0x0a, 0x0d, 0x48, 0x65, 0x6c, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x61, + 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2d, 0x63, 0x6c, 0x69, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, + 0x63, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x63, 0x6c, 0x69, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, + 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/rpc/cc/arduino/cli/commands/v1/common.proto b/rpc/cc/arduino/cli/commands/v1/common.proto index 13befb5bf82..9a324985d54 100644 --- a/rpc/cc/arduino/cli/commands/v1/common.proto +++ b/rpc/cc/arduino/cli/commands/v1/common.proto @@ -89,11 +89,9 @@ message PlatformSummary { map releases = 2; // The installed version of the platform, or empty string if none installed string installed_version = 3; - // The latest available version of the platform, or empty if none available + // The latest available version of the platform that can be installable, or + // empty if none available. string latest_version = 4; - // The latest available version of the platform containing all compatible - // dependencies, or empty if none available - string latest_compatible_version = 5; } // PlatformMetadata contains generic information about a platform (not @@ -144,8 +142,8 @@ message PlatformRelease { bool missing_metadata = 7; // True this release is deprecated bool deprecated = 8; - // True if the platform dependencies are available for the current OS. This - // also means that the platform is installable. + // True if the platform dependencies are available for the current OS/ARCH. + // This also means that the platform is installable. bool compatible = 9; }