diff --git a/.github/workflows/release-go-task.yml b/.github/workflows/release-go-task.yml index fa40a11cb1e..e6f103de132 100644 --- a/.github/workflows/release-go-task.yml +++ b/.github/workflows/release-go-task.yml @@ -13,7 +13,7 @@ env: on: push: tags: - - "[0-9]+.[0-9]+.[0-9]+*" + - "v[0-9]+.[0-9]+.[0-9]+*" jobs: create-release-artifacts: @@ -45,7 +45,7 @@ jobs: if: matrix.os == 'Windows_32bit' uses: arduino/create-changelog@v1 with: - tag-regex: '^[0-9]+\.[0-9]+\.[0-9]+.*$' + tag-regex: '^v[0-9]+\.[0-9]+\.[0-9]+.*$' filter-regex: '^\[(skip|changelog)[ ,-](skip|changelog)\].*' case-insensitive-regex: true changelog-file-path: "${{ env.DIST_DIR }}/CHANGELOG.md" diff --git a/.golangci.yml b/.golangci.yml index 7e9f18d1482..36b59fa925b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -62,7 +62,6 @@ linters-settings: - name: redefines-builtin-id - name: superfluous-else - name: time-naming - - name: unexported-return - name: unreachable-code - name: var-declaration - name: defer diff --git a/Taskfile.yml b/Taskfile.yml index 8d78b17b48d..e19fd011777 100755 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -363,7 +363,7 @@ vars: TIMESTAMP_SHORT: sh: echo "{{now | date "20060102"}}" TAG: - sh: echo "$(git tag --points-at=HEAD 2> /dev/null | head -n1)" + sh: echo "$(git tag --points-at=HEAD 2> /dev/null | head -n1 | sed 's/^v//')" VERSION: "{{if .NIGHTLY}}nightly-{{.TIMESTAMP_SHORT}}{{else if .TAG}}{{.TAG}}{{else}}{{.PACKAGE_NAME_PREFIX}}git-snapshot{{end}}" CONFIGURATION_PACKAGE: "github.com/arduino/arduino-cli/version" LDFLAGS: >- diff --git a/arduino/cores/cores.go b/arduino/cores/cores.go index 19ba9eeaf76..0c836c20f8d 100644 --- a/arduino/cores/cores.go +++ b/arduino/cores/cores.go @@ -37,14 +37,13 @@ import ( // Platform represents a platform package. type Platform struct { - Architecture string // The name of the architecture of this package. - Name string - Category string + Architecture string // The name of the architecture of this package. Releases map[semver.NormalizedString]*PlatformRelease // The Releases of this platform, labeled by version. Package *Package `json:"-"` ManuallyInstalled bool // true if the Platform has been installed without the CLI - Deprecated bool // true if the Platform has been deprecated + Deprecated bool // true if the latest PlatformRelease of this Platform has been deprecated Indexed bool // true if the Platform has been indexed from additional-urls + Latest *semver.Version `json:"-"` } // PlatformReleaseHelp represents the help URL for this Platform release @@ -54,12 +53,15 @@ type PlatformReleaseHelp struct { // PlatformRelease represents a release of a plaform package. type PlatformRelease struct { + Name string + Category string Resource *resources.DownloadResource Version *semver.Version BoardsManifest []*BoardManifest ToolDependencies ToolDependencies DiscoveryDependencies DiscoveryDependencies MonitorDependencies MonitorDependencies + Deprecated bool Help PlatformReleaseHelp `json:"-"` Platform *Platform `json:"-"` Properties *properties.Map `json:"-"` @@ -407,7 +409,7 @@ func (release *PlatformRelease) MarshalJSON() ([]byte, error) { ID: release.Platform.String(), Installed: release.Version.String(), Latest: latestStr, - Name: release.Platform.Name, + Name: release.Name, }) } diff --git a/arduino/cores/packageindex/index.go b/arduino/cores/packageindex/index.go index 61621ed4cca..a54776f3bba 100644 --- a/arduino/cores/packageindex/index.go +++ b/arduino/cores/packageindex/index.go @@ -222,11 +222,11 @@ func IndexFromPlatformRelease(pr *cores.PlatformRelease) Index { URL: pr.Platform.Package.URL, Email: pr.Platform.Package.Email, Platforms: []*indexPlatformRelease{{ - Name: pr.Platform.Name, + Name: pr.Name, Architecture: pr.Platform.Architecture, Version: pr.Version, - Deprecated: pr.Platform.Deprecated, - Category: pr.Platform.Category, + Deprecated: pr.Deprecated, + Category: pr.Category, URL: pr.Resource.URL, ArchiveFileName: pr.Resource.ArchiveFileName, Checksum: pr.Resource.Checksum, @@ -263,18 +263,13 @@ func (inPackage indexPackage) extractPackageIn(outPackages cores.Packages, trust func (inPlatformRelease indexPlatformRelease) extractPlatformIn(outPackage *cores.Package, trusted bool, isInstallJSON bool) error { outPlatform := outPackage.GetOrCreatePlatform(inPlatformRelease.Architecture) - // FIXME: shall we use the Name and Category of the latest release? or maybe move Name and Category in PlatformRelease? - outPlatform.Name = inPlatformRelease.Name - outPlatform.Category = inPlatformRelease.Category // If the variable `isInstallJSON` is false it means that the index we're reading is coming from the additional-urls. // Therefore, the `outPlatform.Indexed` will be set at `true`. outPlatform.Indexed = outPlatform.Indexed || !isInstallJSON - // If the Platform is installed before deprecation installed.json file does not include "deprecated" field. - // The installed.json is read during loading phase of an installed Platform, if the deprecated field is not found - // the package_index.json field would be overwritten and the deprecation info would be lost. - // This check prevents that behaviour. - if !outPlatform.Deprecated { + // If the latest platform release is deprecated, then deprecate the whole platform. + if outPlatform.Latest == nil || outPlatform.Latest.LessThan(inPlatformRelease.Version) { + outPlatform.Latest = inPlatformRelease.Version outPlatform.Deprecated = inPlatformRelease.Deprecated } @@ -283,6 +278,8 @@ func (inPlatformRelease indexPlatformRelease) extractPlatformIn(outPackage *core return fmt.Errorf(tr("invalid platform archive size: %s"), err) } outPlatformRelease := outPlatform.GetOrCreateRelease(inPlatformRelease.Version) + outPlatformRelease.Name = inPlatformRelease.Name + outPlatformRelease.Category = inPlatformRelease.Category outPlatformRelease.IsTrusted = trusted outPlatformRelease.Resource = &resources.DownloadResource{ ArchiveFileName: inPlatformRelease.ArchiveFileName, @@ -296,6 +293,7 @@ func (inPlatformRelease indexPlatformRelease) extractPlatformIn(outPackage *core outPlatformRelease.ToolDependencies = inPlatformRelease.extractToolDependencies() outPlatformRelease.DiscoveryDependencies = inPlatformRelease.extractDiscoveryDependencies() outPlatformRelease.MonitorDependencies = inPlatformRelease.extractMonitorDependencies() + outPlatformRelease.Deprecated = inPlatformRelease.Deprecated return nil } diff --git a/arduino/cores/packageindex/index_test.go b/arduino/cores/packageindex/index_test.go index efb05c16aa0..8a2d5474693 100644 --- a/arduino/cores/packageindex/index_test.go +++ b/arduino/cores/packageindex/index_test.go @@ -91,11 +91,10 @@ func TestIndexFromPlatformRelease(t *testing.T) { Name: "serial-monitor", }, }, + Name: "Arduino AVR Boards", + Category: "Arduino", Platform: &cores.Platform{ - Name: "Arduino AVR Boards", Architecture: "avr", - Category: "Arduino", - Package: &cores.Package{ Name: "arduino", Maintainer: "Arduino", diff --git a/arduino/cores/packagemanager/loader.go b/arduino/cores/packagemanager/loader.go index 2644a9f22e2..8d5cfe76da0 100644 --- a/arduino/cores/packagemanager/loader.go +++ b/arduino/cores/packagemanager/loader.go @@ -323,14 +323,14 @@ func (pm *Builder) loadPlatformRelease(platform *cores.PlatformRelease, path *pa platform.Properties.Set("pluggable_monitor.required.serial", "builtin:serial-monitor") } - if platform.Platform.Name == "" { + if platform.Name == "" { if name, ok := platform.Properties.GetOk("name"); ok { - platform.Platform.Name = name + platform.Name = name } else { // If the platform.txt file doesn't exist for this platform and it's not in any // package index there is no way of retrieving its name, so we build one using // the available information, that is the packager name and the architecture. - platform.Platform.Name = fmt.Sprintf("%s-%s", platform.Platform.Package.Name, platform.Platform.Architecture) + platform.Name = fmt.Sprintf("%s-%s", platform.Platform.Package.Name, platform.Platform.Architecture) } } diff --git a/arduino/cores/packagemanager/package_manager.go b/arduino/cores/packagemanager/package_manager.go index 7773b407109..1d6ac17aac0 100644 --- a/arduino/cores/packagemanager/package_manager.go +++ b/arduino/cores/packagemanager/package_manager.go @@ -192,8 +192,8 @@ func (pme *Explorer) GetCustomGlobalProperties() *properties.Map { } // FindPlatformReleaseProvidingBoardsWithVidPid FIXMEDOC -func (pme *Explorer) FindPlatformReleaseProvidingBoardsWithVidPid(vid, pid string) []*cores.PlatformRelease { - res := []*cores.PlatformRelease{} +func (pme *Explorer) FindPlatformReleaseProvidingBoardsWithVidPid(vid, pid string) []*cores.Platform { + res := []*cores.Platform{} for _, targetPackage := range pme.packages { for _, targetPlatform := range targetPackage.Platforms { platformRelease := targetPlatform.GetLatestRelease() @@ -202,7 +202,7 @@ func (pme *Explorer) FindPlatformReleaseProvidingBoardsWithVidPid(vid, pid strin } for _, boardManifest := range platformRelease.BoardsManifest { if boardManifest.HasUsbID(vid, pid) { - res = append(res, platformRelease) + res = append(res, targetPlatform) break } } diff --git a/arduino/cores/packagemanager/profiles.go b/arduino/cores/packagemanager/profiles.go index 423bfdaeffa..a8f12789521 100644 --- a/arduino/cores/packagemanager/profiles.go +++ b/arduino/cores/packagemanager/profiles.go @@ -45,7 +45,7 @@ func (pmb *Builder) LoadHardwareForProfile(p *sketch.Profile, installMissing boo logrus.WithField("platform", platformRef).WithError(err).Debugf("Error loading platform for profile") } else { platformReleases = append(platformReleases, platformRelease) - indexURLs[platformRelease.Platform.Name] = platformRef.PlatformIndexURL + indexURLs[platformRelease.Name] = platformRef.PlatformIndexURL logrus.WithField("platform", platformRef).Debugf("Loaded platform for profile") } } diff --git a/client_example/main.go b/client_example/main.go index 7ae3745a598..3be6fb596fe 100644 --- a/client_example/main.go +++ b/client_example/main.go @@ -145,11 +145,6 @@ func main() { log.Println("calling PlatformInstall(arduino:samd@1.6.19)") callPlatformInstall(client, instance) - // Now list the installed platforms to double check previous installation - // went right. - log.Println("calling PlatformList()") - callPlatformList(client, instance) - // Upgrade the installed platform to the latest version. log.Println("calling PlatformUpgrade(arduino:samd)") callPlatformUpgrade(client, instance) @@ -420,7 +415,7 @@ func callPlatformSearch(client rpc.ArduinoCoreServiceClient, instance *rpc.Insta for _, plat := range platforms { // We only print ID and version of the platforms found but you can look // at the definition for the rpc.Platform struct for more fields. - log.Printf("Search result: %+v - %+v", plat.GetId(), plat.GetLatest()) + log.Printf("Search result: %+v - %+v", plat.GetMetadata().GetId(), plat.GetLatestVersion()) } } @@ -464,21 +459,6 @@ func callPlatformInstall(client rpc.ArduinoCoreServiceClient, instance *rpc.Inst } } -func callPlatformList(client rpc.ArduinoCoreServiceClient, instance *rpc.Instance) { - listResp, err := client.PlatformList(context.Background(), - &rpc.PlatformListRequest{Instance: instance}) - - if err != nil { - log.Fatalf("List error: %s", err) - } - - for _, plat := range listResp.GetInstalledPlatforms() { - // We only print ID and version of the installed platforms but you can look - // at the definition for the rpc.Platform struct for more fields. - log.Printf("Installed platform: %s - %s", plat.GetId(), plat.GetInstalled()) - } -} - func callPlatformUpgrade(client rpc.ArduinoCoreServiceClient, instance *rpc.Instance) { upgradeRespStream, err := client.PlatformUpgrade(context.Background(), &rpc.PlatformUpgradeRequest{ @@ -546,7 +526,7 @@ func callBoardSearch(client rpc.ArduinoCoreServiceClient, instance *rpc.Instance } for _, board := range res.Boards { - log.Printf("Board Name: %s, Board Platform: %s\n", board.Name, board.Platform.Id) + log.Printf("Board Name: %s, Board Platform: %s\n", board.Name, board.Platform.Metadata.Id) } } diff --git a/commands/board/details.go b/commands/board/details.go index 17314aa1432..c00f315c788 100644 --- a/commands/board/details.go +++ b/commands/board/details.go @@ -39,7 +39,7 @@ func Details(ctx context.Context, req *rpc.BoardDetailsRequest) (*rpc.BoardDetai return nil, &arduino.InvalidFQBNError{Cause: err} } - boardPackage, boardPlatform, board, boardProperties, boardRefPlatform, err := pme.ResolveFQBN(fqbn) + boardPackage, boardPlatformRelease, board, boardProperties, boardRefPlatform, err := pme.ResolveFQBN(fqbn) if err != nil { return nil, &arduino.UnknownFQBNError{Cause: err} } @@ -65,11 +65,11 @@ func Details(ctx context.Context, req *rpc.BoardDetailsRequest) (*rpc.BoardDetai } details.DebuggingSupported = boardProperties.ContainsKey("debug.executable") || - boardPlatform.Properties.ContainsKey("debug.executable") || + boardPlatformRelease.Properties.ContainsKey("debug.executable") || (boardRefPlatform != nil && boardRefPlatform.Properties.ContainsKey("debug.executable")) || // HOTFIX: Remove me when the `arduino:samd` core is updated - boardPlatform.String() == "arduino:samd@1.8.9" || - boardPlatform.String() == "arduino:samd@1.8.8" + boardPlatformRelease.String() == "arduino:samd@1.8.9" || + boardPlatformRelease.String() == "arduino:samd@1.8.8" details.Package = &rpc.Package{ Name: boardPackage.Name, @@ -81,16 +81,16 @@ func Details(ctx context.Context, req *rpc.BoardDetailsRequest) (*rpc.BoardDetai } details.Platform = &rpc.BoardPlatform{ - Architecture: boardPlatform.Platform.Architecture, - Category: boardPlatform.Platform.Category, - Name: boardPlatform.Platform.Name, + Architecture: boardPlatformRelease.Platform.Architecture, + Category: boardPlatformRelease.Category, + Name: boardPlatformRelease.Name, } - if boardPlatform.Resource != nil { - details.Platform.Url = boardPlatform.Resource.URL - details.Platform.ArchiveFilename = boardPlatform.Resource.ArchiveFileName - details.Platform.Checksum = boardPlatform.Resource.Checksum - details.Platform.Size = boardPlatform.Resource.Size + if boardPlatformRelease.Resource != nil { + details.Platform.Url = boardPlatformRelease.Resource.URL + details.Platform.ArchiveFilename = boardPlatformRelease.Resource.ArchiveFileName + details.Platform.Checksum = boardPlatformRelease.Resource.Checksum + details.Platform.Size = boardPlatformRelease.Resource.Size } details.ConfigOptions = []*rpc.ConfigOption{} @@ -118,7 +118,7 @@ func Details(ctx context.Context, req *rpc.BoardDetailsRequest) (*rpc.BoardDetai } details.ToolsDependencies = []*rpc.ToolsDependencies{} - for _, tool := range boardPlatform.ToolDependencies { + for _, tool := range boardPlatformRelease.ToolDependencies { toolRelease := pme.FindToolDependency(tool) var systems []*rpc.Systems if toolRelease != nil { @@ -141,9 +141,9 @@ func Details(ctx context.Context, req *rpc.BoardDetailsRequest) (*rpc.BoardDetai } details.Programmers = []*rpc.Programmer{} - for id, p := range boardPlatform.Programmers { + for id, p := range boardPlatformRelease.Programmers { details.Programmers = append(details.Programmers, &rpc.Programmer{ - Platform: boardPlatform.Platform.Name, + Platform: boardPlatformRelease.Name, Id: id, Name: p.Name, }) diff --git a/commands/board/list.go b/commands/board/list.go index d0b5cb78dc4..b953efb25d5 100644 --- a/commands/board/list.go +++ b/commands/board/list.go @@ -157,7 +157,9 @@ func identify(pme *packagemanager.Explorer, port *discovery.Port) ([]*rpc.BoardL // We need the Platform maintaner for sorting so we set it here platform := &rpc.Platform{ - Maintainer: board.PlatformRelease.Platform.Package.Maintainer, + Metadata: &rpc.PlatformMetadata{ + Maintainer: board.PlatformRelease.Platform.Package.Maintainer, + }, } boards = append(boards, &rpc.BoardListItem{ Name: board.Name(), @@ -185,7 +187,7 @@ func identify(pme *packagemanager.Explorer, port *discovery.Port) ([]*rpc.BoardL // Put Arduino boards before others in case there are non Arduino boards with identical VID:PID combination sort.SliceStable(boards, func(i, j int) bool { - if boards[i].Platform.Maintainer == "Arduino" && boards[j].Platform.Maintainer != "Arduino" { + if boards[i].Platform.Metadata.Maintainer == "Arduino" && boards[j].Platform.Metadata.Maintainer != "Arduino" { return true } return false diff --git a/commands/board/listall.go b/commands/board/listall.go index d4118aca4e7..407b54ad8e7 100644 --- a/commands/board/listall.go +++ b/commands/board/listall.go @@ -23,6 +23,7 @@ import ( "github.com/arduino/arduino-cli/arduino" "github.com/arduino/arduino-cli/arduino/cores" "github.com/arduino/arduino-cli/arduino/utils" + "github.com/arduino/arduino-cli/commands" "github.com/arduino/arduino-cli/commands/internal/instances" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" ) @@ -46,29 +47,14 @@ func ListAll(ctx context.Context, req *rpc.BoardListAllRequest) (*rpc.BoardListA continue } - installedVersion := installedPlatformRelease.Version.String() - - latestVersion := "" - if latestPlatformRelease := platform.GetLatestRelease(); latestPlatformRelease != nil { - latestVersion = latestPlatformRelease.Version.String() - } - rpcPlatform := &rpc.Platform{ - Id: platform.String(), - Installed: installedVersion, - Latest: latestVersion, - Name: platform.Name, - Maintainer: platform.Package.Maintainer, - Website: platform.Package.WebsiteURL, - Email: platform.Package.Email, - ManuallyInstalled: platform.ManuallyInstalled, - Indexed: platform.Indexed, - MissingMetadata: !installedPlatformRelease.HasMetadata(), + Metadata: commands.PlatformToRPCPlatformMetadata(platform), + Release: commands.PlatformReleaseToRPC(installedPlatformRelease), } toTest := []string{ platform.String(), - platform.Name, + installedPlatformRelease.Name, platform.Architecture, targetPackage.Name, targetPackage.Maintainer, diff --git a/commands/board/search.go b/commands/board/search.go index da0553463fa..007867775e3 100644 --- a/commands/board/search.go +++ b/commands/board/search.go @@ -22,6 +22,7 @@ import ( "github.com/arduino/arduino-cli/arduino" "github.com/arduino/arduino-cli/arduino/utils" + "github.com/arduino/arduino-cli/commands" "github.com/arduino/arduino-cli/commands/internal/instances" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" ) @@ -37,7 +38,7 @@ func Search(ctx context.Context, req *rpc.BoardSearchRequest) (*rpc.BoardSearchR } defer release() - res := &rpc.BoardSearchResponse{Boards: []*rpc.BoardListItem{}} + foundBoards := []*rpc.BoardListItem{} for _, targetPackage := range pme.GetPackages() { for _, platform := range targetPackage.Platforms { latestPlatformRelease := platform.GetLatestRelease() @@ -47,24 +48,6 @@ func Search(ctx context.Context, req *rpc.BoardSearchRequest) (*rpc.BoardSearchR continue } - rpcPlatform := &rpc.Platform{ - Id: platform.String(), - Name: platform.Name, - Maintainer: platform.Package.Maintainer, - Website: platform.Package.WebsiteURL, - Email: platform.Package.Email, - ManuallyInstalled: platform.ManuallyInstalled, - Indexed: platform.Indexed, - } - - if latestPlatformRelease != nil { - rpcPlatform.Latest = latestPlatformRelease.Version.String() - } - if installedPlatformRelease != nil { - rpcPlatform.Installed = installedPlatformRelease.Version.String() - rpcPlatform.MissingMetadata = !installedPlatformRelease.HasMetadata() - } - // Platforms that are not installed don't have a list of boards // generated from their boards.txt file so we need two different // ways of reading board data. @@ -81,11 +64,14 @@ func Search(ctx context.Context, req *rpc.BoardSearchRequest) (*rpc.BoardSearchR continue } - res.Boards = append(res.Boards, &rpc.BoardListItem{ + foundBoards = append(foundBoards, &rpc.BoardListItem{ Name: board.Name(), Fqbn: board.FQBN(), IsHidden: board.IsHidden(), - Platform: rpcPlatform, + Platform: &rpc.Platform{ + Metadata: commands.PlatformToRPCPlatformMetadata(platform), + Release: commands.PlatformReleaseToRPC(installedPlatformRelease), + }, }) } } else if latestPlatformRelease != nil { @@ -95,20 +81,24 @@ func Search(ctx context.Context, req *rpc.BoardSearchRequest) (*rpc.BoardSearchR continue } - res.Boards = append(res.Boards, &rpc.BoardListItem{ - Name: strings.Trim(board.Name, " \n"), - Platform: rpcPlatform, + foundBoards = append(foundBoards, &rpc.BoardListItem{ + Name: strings.Trim(board.Name, " \n"), + Platform: &rpc.Platform{ + Metadata: commands.PlatformToRPCPlatformMetadata(platform), + Release: commands.PlatformReleaseToRPC(latestPlatformRelease), + }, }) } } } } - sort.Slice(res.Boards, func(i, j int) bool { - if res.Boards[i].Name != res.Boards[j].Name { - return res.Boards[i].Name < res.Boards[j].Name + sort.Slice(foundBoards, func(i, j int) bool { + if foundBoards[i].Name != foundBoards[j].Name { + return foundBoards[i].Name < foundBoards[j].Name } - return res.Boards[i].Platform.Id < res.Boards[j].Platform.Id + return foundBoards[i].Platform.Metadata.Id < foundBoards[j].Platform.Metadata.Id }) - return res, nil + + return &rpc.BoardSearchResponse{Boards: foundBoards}, nil } diff --git a/commands/core.go b/commands/core.go index f75fbce04f4..14dc3360e4c 100644 --- a/commands/core.go +++ b/commands/core.go @@ -20,10 +20,23 @@ import ( rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" ) +// PlatformToRPCPlatformMetadata converts our internal structure to the RPC structure. +func PlatformToRPCPlatformMetadata(platform *cores.Platform) *rpc.PlatformMetadata { + return &rpc.PlatformMetadata{ + Id: platform.String(), + Maintainer: platform.Package.Maintainer, + Website: platform.Package.WebsiteURL, + Email: platform.Package.Email, + ManuallyInstalled: platform.ManuallyInstalled, + Deprecated: platform.Deprecated, + Indexed: platform.Indexed, + } +} + // PlatformReleaseToRPC converts our internal structure to the RPC structure. // Note: this function does not touch the "Installed" field of rpc.Platform as it's not always clear that the // platformRelease we're currently converting is actually installed. -func PlatformReleaseToRPC(platformRelease *cores.PlatformRelease) *rpc.Platform { +func PlatformReleaseToRPC(platformRelease *cores.PlatformRelease) *rpc.PlatformRelease { // If the boards are not installed yet, the `platformRelease.Boards` will be a zero length slice. // In such case, we have to use the `platformRelease.BoardsManifest` instead. // So that we can retrieve the name of the boards at least. @@ -50,21 +63,16 @@ func PlatformReleaseToRPC(platformRelease *cores.PlatformRelease) *rpc.Platform } } - result := &rpc.Platform{ - Id: platformRelease.Platform.String(), - Name: platformRelease.Platform.Name, - Maintainer: platformRelease.Platform.Package.Maintainer, - Website: platformRelease.Platform.Package.WebsiteURL, - Email: platformRelease.Platform.Package.Email, - Help: &rpc.HelpResources{Online: platformRelease.Platform.Package.Help.Online}, - Boards: boards, - Latest: platformRelease.Version.String(), - ManuallyInstalled: platformRelease.Platform.ManuallyInstalled, - Deprecated: platformRelease.Platform.Deprecated, - Type: []string{platformRelease.Platform.Category}, - Indexed: platformRelease.Platform.Indexed, - MissingMetadata: !platformRelease.HasMetadata(), + // This field make sense only if the platformRelease is installed otherwise is an "undefined behaviour" + missingMetadata := platformRelease.IsInstalled() && !platformRelease.HasMetadata() + return &rpc.PlatformRelease{ + Name: platformRelease.Name, + Help: &rpc.HelpResources{Online: platformRelease.Platform.Package.Help.Online}, + Boards: boards, + Version: platformRelease.Version.String(), + Installed: platformRelease.IsInstalled(), + MissingMetadata: missingMetadata, + Type: []string{platformRelease.Category}, + Deprecated: platformRelease.Deprecated, } - - return result } diff --git a/commands/core/list.go b/commands/core/list.go deleted file mode 100644 index 10d582de2d1..00000000000 --- a/commands/core/list.go +++ /dev/null @@ -1,90 +0,0 @@ -// This file is part of arduino-cli. -// -// Copyright 2020 ARDUINO SA (http://www.arduino.cc/) -// -// This software is released under the GNU General Public License version 3, -// which covers the main part of arduino-cli. -// The terms of this license can be found at: -// https://www.gnu.org/licenses/gpl-3.0.en.html -// -// You can be released from the requirements of the above licenses by purchasing -// a commercial license. Buying such a license is mandatory if you want to -// modify or otherwise use the software for commercial activities involving the -// Arduino software without disclosing the source code of your own applications. -// To purchase a commercial license, send an email to license@arduino.cc. - -package core - -import ( - "fmt" - "sort" - "strings" - - "github.com/arduino/arduino-cli/arduino" - "github.com/arduino/arduino-cli/commands" - "github.com/arduino/arduino-cli/commands/internal/instances" - rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" -) - -// PlatformList returns a list of installed platforms, optionally filtered by -// those requiring an update. -func PlatformList(req *rpc.PlatformListRequest) (*rpc.PlatformListResponse, error) { - pme, release := instances.GetPackageManagerExplorer(req.GetInstance()) - if pme == nil { - return nil, &arduino.InvalidInstanceError{} - } - defer release() - - res := []*rpc.Platform{} - for _, targetPackage := range pme.GetPackages() { - for _, platform := range targetPackage.Platforms { - platformRelease := pme.GetInstalledPlatformRelease(platform) - - // The All flags adds to the list of installed platforms the installable platforms (from the indexes) - // If both All and UpdatableOnly are set All takes precedence - if req.All { - installedVersion := "" - if platformRelease == nil { // if the platform is not installed - platformRelease = platform.GetLatestRelease() - } else { - installedVersion = platformRelease.Version.String() - } - // it could happen, especially with indexes not perfectly compliant with specs that a platform do not contain a valid release - if platformRelease != nil { - rpcPlatform := commands.PlatformReleaseToRPC(platformRelease) - rpcPlatform.Installed = installedVersion - res = append(res, rpcPlatform) - continue - } - } - - if platformRelease != nil { - latest := platform.GetLatestRelease() - if latest == nil { - return nil, &arduino.PlatformNotFoundError{Platform: platform.String(), Cause: fmt.Errorf(tr("the platform has no releases"))} - } - - // show only the updatable platforms - if req.UpdatableOnly && latest == platformRelease { - continue - } - - rpcPlatform := commands.PlatformReleaseToRPC(platformRelease) - rpcPlatform.Installed = platformRelease.Version.String() - rpcPlatform.Latest = latest.Version.String() - res = append(res, rpcPlatform) - } - } - } - // Sort result alphabetically and put deprecated platforms at the bottom - sort.Slice(res, func(i, j int) bool { - return strings.ToLower(res[i].Name) < strings.ToLower(res[j].Name) - }) - sort.SliceStable(res, func(i, j int) bool { - if !res[i].Deprecated && res[j].Deprecated { - return true - } - return false - }) - return &rpc.PlatformListResponse{InstalledPlatforms: res}, nil -} diff --git a/commands/core/search.go b/commands/core/search.go index 4562eb570e0..7d0b5662f31 100644 --- a/commands/core/search.go +++ b/commands/core/search.go @@ -36,19 +36,20 @@ func PlatformSearch(req *rpc.PlatformSearchRequest) (*rpc.PlatformSearchResponse } defer release() - res := []*cores.PlatformRelease{} + 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) } else { searchArgs := utils.SearchTermsFromQueryString(req.SearchArgs) - allVersions := req.AllVersions for _, targetPackage := range pme.GetPackages() { for _, platform := range targetPackage.Platforms { + if platform == nil { + continue + } // Users can install platforms manually in the Sketchbook hardware folder, - // the core search command must operate only on platforms installed through - // the PlatformManager, thus we skip the manually installed ones. - if platform == nil || platform.Name == "" || platform.ManuallyInstalled { + // if not explictily requested we skip them. + if !req.ManuallyInstalled && platform.ManuallyInstalled { continue } @@ -57,10 +58,13 @@ func PlatformSearch(req *rpc.PlatformSearchRequest) (*rpc.PlatformSearchResponse if latestRelease == nil { continue } + if latestRelease.Name == "" { + continue + } // Gather all strings that can be used for searching toTest := platform.String() + " " + - platform.Name + " " + + latestRelease.Name + " " + platform.Architecture + " " + targetPackage.Name + " " + targetPackage.Maintainer + " " + @@ -74,33 +78,52 @@ func PlatformSearch(req *rpc.PlatformSearchRequest) (*rpc.PlatformSearchResponse continue } - if allVersions { - res = append(res, platform.GetAllReleases()...) - } else { - res = append(res, latestRelease) - } + res = append(res, platform) } } } - out := make([]*rpc.Platform, len(res)) - for i, platformRelease := range res { - out[i] = commands.PlatformReleaseToRPC(platformRelease) - if platformRelease.IsInstalled() { - out[i].Installed = platformRelease.Version.String() + out := []*rpc.PlatformSummary{} + for _, platform := range res { + rpcPlatformSummary := &rpc.PlatformSummary{ + Releases: map[string]*rpc.PlatformRelease{}, + } + + rpcPlatformSummary.Metadata = commands.PlatformToRPCPlatformMetadata(platform) + + installed := pme.GetInstalledPlatformRelease(platform) + latest := platform.GetLatestRelease() + if installed != nil { + rpcPlatformSummary.InstalledVersion = installed.Version.String() } + if latest != nil { + rpcPlatformSummary.LatestVersion = latest.Version.String() + } + if req.AllVersions { + for _, platformRelease := range platform.GetAllReleases() { + rpcPlatformRelease := commands.PlatformReleaseToRPC(platformRelease) + rpcPlatformSummary.Releases[rpcPlatformRelease.Version] = rpcPlatformRelease + } + } else { + if installed != nil { + rpcPlatformRelease := commands.PlatformReleaseToRPC(installed) + rpcPlatformSummary.Releases[installed.Version.String()] = rpcPlatformRelease + } + if latest != nil { + rpcPlatformRelease := commands.PlatformReleaseToRPC(latest) + rpcPlatformSummary.Releases[latest.Version.String()] = rpcPlatformRelease + } + } + out = append(out, rpcPlatformSummary) } + // Sort result alphabetically and put deprecated platforms at the bottom - sort.Slice( - out, func(i, j int) bool { - return strings.ToLower(out[i].Name) < strings.ToLower(out[j].Name) - }) - sort.SliceStable( - out, func(i, j int) bool { - if !out[i].Deprecated && out[j].Deprecated { - return true - } - return false - }) + sort.Slice(out, func(i, j int) bool { + return strings.ToLower(out[i].GetReleases()[out[i].GetLatestVersion()].Name) < + strings.ToLower(out[j].GetReleases()[out[j].GetLatestVersion()].Name) + }) + sort.SliceStable(out, func(i, j int) bool { + return !out[i].GetMetadata().Deprecated && out[j].GetMetadata().Deprecated + }) return &rpc.PlatformSearchResponse{SearchOutput: out}, nil } diff --git a/commands/core/search_test.go b/commands/core/search_test.go index b96c19912af..a695acbd6b4 100644 --- a/commands/core/search_test.go +++ b/commands/core/search_test.go @@ -26,7 +26,6 @@ import ( ) func TestPlatformSearch(t *testing.T) { - dataDir := paths.TempDir().Join("test", "data_dir") downloadDir := paths.TempDir().Join("test", "staging") t.Setenv("ARDUINO_DATA_DIR", dataDir.String()) @@ -42,280 +41,315 @@ func TestPlatformSearch(t *testing.T) { inst := instance.CreateAndInit() require.NotNil(t, inst) - res, stat := PlatformSearch(&rpc.PlatformSearchRequest{ - Instance: inst, - SearchArgs: "retrokit", - AllVersions: true, - }) - require.Nil(t, stat) - require.NotNil(t, res) + t.Run("SearchAllVersions", func(t *testing.T) { + res, stat := PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: inst, + SearchArgs: "retrokit", + AllVersions: true, + }) + require.Nil(t, stat) + require.NotNil(t, res) - require.Len(t, res.SearchOutput, 2) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.5", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, - Indexed: true, - MissingMetadata: true, - }) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.6", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, - Indexed: true, - MissingMetadata: true, + 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.5": { + Name: "RK002", + Type: []string{"Contributed"}, + Installed: false, + Version: "1.0.5", + Boards: []*rpc.Board{{Name: "RK002"}}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + }, + "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"}, + }, + }, + InstalledVersion: "", + LatestVersion: "1.0.6", + }) }) - res, stat = PlatformSearch(&rpc.PlatformSearchRequest{ - Instance: inst, - SearchArgs: "retrokit", - AllVersions: false, - }) - require.Nil(t, stat) - require.NotNil(t, res) - require.Len(t, res.SearchOutput, 1) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.6", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, - Indexed: true, - MissingMetadata: true, + t.Run("SearchNoAllVersions", func(t *testing.T) { + res, stat := PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: inst, + SearchArgs: "retrokit", + AllVersions: false, + }) + 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"}, + }, + }, + InstalledVersion: "", + LatestVersion: "1.0.6", + }) }) - // Search the Package Maintainer - res, stat = PlatformSearch(&rpc.PlatformSearchRequest{ - Instance: inst, - SearchArgs: "Retrokits (www.retrokits.com)", - AllVersions: true, - }) - require.Nil(t, stat) - require.NotNil(t, res) - require.Len(t, res.SearchOutput, 2) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.5", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, - Indexed: true, - MissingMetadata: true, - }) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.6", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, - Indexed: true, - MissingMetadata: true, + t.Run("SearchThePackageMaintainer", func(t *testing.T) { + res, stat := PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: inst, + SearchArgs: "Retrokits (www.retrokits.com)", + AllVersions: true, + }) + 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.5": { + Name: "RK002", + Type: []string{"Contributed"}, + Installed: false, + Version: "1.0.5", + Boards: []*rpc.Board{{Name: "RK002"}}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + }, + "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"}, + }, + }, + InstalledVersion: "", + LatestVersion: "1.0.6", + }) }) - // Search using the Package name - res, stat = PlatformSearch(&rpc.PlatformSearchRequest{ - Instance: inst, - SearchArgs: "Retrokits-RK002", - AllVersions: true, - }) - require.Nil(t, stat) - require.NotNil(t, res) - require.Len(t, res.SearchOutput, 2) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.5", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, - Indexed: true, - MissingMetadata: true, - }) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.6", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, - Indexed: true, - MissingMetadata: true, + t.Run("SearchPackageName", func(t *testing.T) { + res, stat := PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: inst, + SearchArgs: "Retrokits-RK002", + AllVersions: true, + }) + 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.5": { + Name: "RK002", + Type: []string{"Contributed"}, + Installed: false, + Version: "1.0.5", + Boards: []*rpc.Board{{Name: "RK002"}}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + }, + "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"}, + }, + }, + InstalledVersion: "", + LatestVersion: "1.0.6", + }) }) - // Search using the Platform name - res, stat = PlatformSearch(&rpc.PlatformSearchRequest{ - Instance: inst, - SearchArgs: "rk002", - AllVersions: true, - }) - require.Nil(t, stat) - require.NotNil(t, res) - require.Len(t, res.SearchOutput, 2) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.5", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, - Indexed: true, - MissingMetadata: true, - }) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.6", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, - Indexed: true, - MissingMetadata: true, + t.Run("SearchPlatformName", func(t *testing.T) { + res, stat := PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: inst, + SearchArgs: "rk002", + AllVersions: true, + }) + 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.5": { + Name: "RK002", + Type: []string{"Contributed"}, + Installed: false, + Version: "1.0.5", + Boards: []*rpc.Board{{Name: "RK002"}}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + }, + "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"}, + }, + }, + InstalledVersion: "", + LatestVersion: "1.0.6", + }) }) - // Search using a board name - res, stat = PlatformSearch(&rpc.PlatformSearchRequest{ - Instance: inst, - SearchArgs: "Yún", - AllVersions: true, - }) - require.Nil(t, stat) - require.NotNil(t, res) - require.Len(t, res.SearchOutput, 1) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "arduino:avr", - Installed: "", - Latest: "1.8.3", - Name: "Arduino AVR Boards", - Maintainer: "Arduino", - Website: "https://www.arduino.cc/", - Email: "packages@arduino.cc", - Type: []string{"Arduino"}, - Boards: []*rpc.Board{ - {Name: "Arduino Yún"}, - {Name: "Arduino Uno"}, - {Name: "Arduino Uno WiFi"}, - {Name: "Arduino Diecimila"}, - {Name: "Arduino Nano"}, - {Name: "Arduino Mega"}, - {Name: "Arduino MegaADK"}, - {Name: "Arduino Leonardo"}, - {Name: "Arduino Leonardo Ethernet"}, - {Name: "Arduino Micro"}, - {Name: "Arduino Esplora"}, - {Name: "Arduino Mini"}, - {Name: "Arduino Ethernet"}, - {Name: "Arduino Fio"}, - {Name: "Arduino BT"}, - {Name: "Arduino LilyPadUSB"}, - {Name: "Arduino Lilypad"}, - {Name: "Arduino Pro"}, - {Name: "Arduino ATMegaNG"}, - {Name: "Arduino Robot Control"}, - {Name: "Arduino Robot Motor"}, - {Name: "Arduino Gemma"}, - {Name: "Adafruit Circuit Playground"}, - {Name: "Arduino Yún Mini"}, - {Name: "Arduino Industrial 101"}, - {Name: "Linino One"}, - }, - Help: &rpc.HelpResources{Online: "http://www.arduino.cc/en/Reference/HomePage"}, - Indexed: true, - MissingMetadata: true, + t.Run("SearchBoardName", func(t *testing.T) { + res, stat := PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: inst, + SearchArgs: "Yún", + AllVersions: true, + }) + 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: "arduino:avr", + Maintainer: "Arduino", + Website: "https://www.arduino.cc/", + Email: "packages@arduino.cc", + Indexed: true, + }, + Releases: map[string]*rpc.PlatformRelease{ + "1.8.3": { + Name: "Arduino AVR Boards", + Type: []string{"Arduino"}, + Installed: false, + Version: "1.8.3", + Boards: []*rpc.Board{ + {Name: "Arduino Yún"}, + {Name: "Arduino Uno"}, + {Name: "Arduino Uno WiFi"}, + {Name: "Arduino Diecimila"}, + {Name: "Arduino Nano"}, + {Name: "Arduino Mega"}, + {Name: "Arduino MegaADK"}, + {Name: "Arduino Leonardo"}, + {Name: "Arduino Leonardo Ethernet"}, + {Name: "Arduino Micro"}, + {Name: "Arduino Esplora"}, + {Name: "Arduino Mini"}, + {Name: "Arduino Ethernet"}, + {Name: "Arduino Fio"}, + {Name: "Arduino BT"}, + {Name: "Arduino LilyPadUSB"}, + {Name: "Arduino Lilypad"}, + {Name: "Arduino Pro"}, + {Name: "Arduino ATMegaNG"}, + {Name: "Arduino Robot Control"}, + {Name: "Arduino Robot Motor"}, + {Name: "Arduino Gemma"}, + {Name: "Adafruit Circuit Playground"}, + {Name: "Arduino Yún Mini"}, + {Name: "Arduino Industrial 101"}, + {Name: "Linino One"}, + }, + Help: &rpc.HelpResources{Online: "http://www.arduino.cc/en/Reference/HomePage"}, + }, + }, + InstalledVersion: "", + LatestVersion: "1.8.3", + }) }) - res, stat = PlatformSearch(&rpc.PlatformSearchRequest{ - Instance: inst, - SearchArgs: "yun", - AllVersions: true, - }) - require.Nil(t, stat) - require.NotNil(t, res) - require.Len(t, res.SearchOutput, 1) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "arduino:avr", - Installed: "", - Latest: "1.8.3", - Name: "Arduino AVR Boards", - Maintainer: "Arduino", - Website: "https://www.arduino.cc/", - Email: "packages@arduino.cc", - Type: []string{"Arduino"}, - Boards: []*rpc.Board{ - {Name: "Arduino Yún"}, - {Name: "Arduino Uno"}, - {Name: "Arduino Uno WiFi"}, - {Name: "Arduino Diecimila"}, - {Name: "Arduino Nano"}, - {Name: "Arduino Mega"}, - {Name: "Arduino MegaADK"}, - {Name: "Arduino Leonardo"}, - {Name: "Arduino Leonardo Ethernet"}, - {Name: "Arduino Micro"}, - {Name: "Arduino Esplora"}, - {Name: "Arduino Mini"}, - {Name: "Arduino Ethernet"}, - {Name: "Arduino Fio"}, - {Name: "Arduino BT"}, - {Name: "Arduino LilyPadUSB"}, - {Name: "Arduino Lilypad"}, - {Name: "Arduino Pro"}, - {Name: "Arduino ATMegaNG"}, - {Name: "Arduino Robot Control"}, - {Name: "Arduino Robot Motor"}, - {Name: "Arduino Gemma"}, - {Name: "Adafruit Circuit Playground"}, - {Name: "Arduino Yún Mini"}, - {Name: "Arduino Industrial 101"}, - {Name: "Linino One"}, - }, - Help: &rpc.HelpResources{Online: "http://www.arduino.cc/en/Reference/HomePage"}, - Indexed: true, - MissingMetadata: true, + t.Run("SearchBoardName2", func(t *testing.T) { + res, stat := PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: inst, + SearchArgs: "yun", + AllVersions: true, + }) + 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: "arduino:avr", + Indexed: true, + Maintainer: "Arduino", + Website: "https://www.arduino.cc/", + Email: "packages@arduino.cc", + }, + Releases: map[string]*rpc.PlatformRelease{ + "1.8.3": { + Name: "Arduino AVR Boards", + Type: []string{"Arduino"}, + Installed: false, + Version: "1.8.3", + Boards: []*rpc.Board{ + {Name: "Arduino Yún"}, + {Name: "Arduino Uno"}, + {Name: "Arduino Uno WiFi"}, + {Name: "Arduino Diecimila"}, + {Name: "Arduino Nano"}, + {Name: "Arduino Mega"}, + {Name: "Arduino MegaADK"}, + {Name: "Arduino Leonardo"}, + {Name: "Arduino Leonardo Ethernet"}, + {Name: "Arduino Micro"}, + {Name: "Arduino Esplora"}, + {Name: "Arduino Mini"}, + {Name: "Arduino Ethernet"}, + {Name: "Arduino Fio"}, + {Name: "Arduino BT"}, + {Name: "Arduino LilyPadUSB"}, + {Name: "Arduino Lilypad"}, + {Name: "Arduino Pro"}, + {Name: "Arduino ATMegaNG"}, + {Name: "Arduino Robot Control"}, + {Name: "Arduino Robot Motor"}, + {Name: "Arduino Gemma"}, + {Name: "Adafruit Circuit Playground"}, + {Name: "Arduino Yún Mini"}, + {Name: "Arduino Industrial 101"}, + {Name: "Linino One"}, + }, + Help: &rpc.HelpResources{Online: "http://www.arduino.cc/en/Reference/HomePage"}, + }, + }, + InstalledVersion: "", + LatestVersion: "1.8.3", + }) }) } @@ -344,11 +378,10 @@ func TestPlatformSearchSorting(t *testing.T) { require.NotNil(t, res) require.Len(t, res.SearchOutput, 3) - require.Equal(t, res.SearchOutput[0].Name, "Arduino AVR Boards") - require.Equal(t, res.SearchOutput[0].Deprecated, false) - require.Equal(t, res.SearchOutput[1].Name, "RK002") - require.Equal(t, res.SearchOutput[1].Deprecated, false) - require.Equal(t, res.SearchOutput[2].Name, "Platform") - require.Equal(t, res.SearchOutput[2].Deprecated, true) - + require.Equal(t, res.SearchOutput[0].GetLatestRelease().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].Metadata.Deprecated, false) + require.Equal(t, res.SearchOutput[2].GetLatestRelease().Name, "Platform") + require.Equal(t, res.SearchOutput[2].Metadata.Deprecated, true) } diff --git a/commands/core/upgrade.go b/commands/core/upgrade.go index 2baaf2c97d6..19c93fe95cf 100644 --- a/commands/core/upgrade.go +++ b/commands/core/upgrade.go @@ -49,10 +49,12 @@ func PlatformUpgrade(ctx context.Context, req *rpc.PlatformUpgradeRequest, downl } var rpcPlatform *rpc.Platform - platformRelease, err := upgrade() if platformRelease != nil { - rpcPlatform = commands.PlatformReleaseToRPC(platformRelease) + rpcPlatform = &rpc.Platform{ + Metadata: commands.PlatformToRPCPlatformMetadata(platformRelease.Platform), + Release: commands.PlatformReleaseToRPC(platformRelease), + } } if err != nil { return &rpc.PlatformUpgradeResponse{Platform: rpcPlatform}, err diff --git a/commands/daemon/daemon.go b/commands/daemon/daemon.go index ec7fd10e9d9..ef6e4daa506 100644 --- a/commands/daemon/daemon.go +++ b/commands/daemon/daemon.go @@ -258,12 +258,6 @@ func (s *ArduinoCoreServerImpl) PlatformSearch(ctx context.Context, req *rpc.Pla return resp, convertErrorToRPCStatus(err) } -// PlatformList FIXMEDOC -func (s *ArduinoCoreServerImpl) PlatformList(ctx context.Context, req *rpc.PlatformListRequest) (*rpc.PlatformListResponse, error) { - platforms, err := core.PlatformList(req) - return platforms, convertErrorToRPCStatus(err) -} - // Upload FIXMEDOC func (s *ArduinoCoreServerImpl) Upload(req *rpc.UploadRequest, stream rpc.ArduinoCoreService_UploadServer) error { syncSend := NewSynchronizedSend(stream.Send) diff --git a/commands/lib/search.go b/commands/lib/search.go index 5e44e2273e1..91a8ddaabcb 100644 --- a/commands/lib/search.go +++ b/commands/lib/search.go @@ -23,7 +23,6 @@ import ( "github.com/arduino/arduino-cli/arduino" "github.com/arduino/arduino-cli/arduino/libraries/librariesindex" "github.com/arduino/arduino-cli/arduino/libraries/librariesmanager" - "github.com/arduino/arduino-cli/arduino/utils" "github.com/arduino/arduino-cli/commands/internal/instances" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" semver "go.bug.st/relaxed-semver" @@ -44,18 +43,11 @@ func searchLibrary(req *rpc.LibrarySearchRequest, lm *librariesmanager.Libraries if query == "" { query = req.GetQuery() } - queryTerms := utils.SearchTermsFromQueryString(query) - for _, lib := range lm.Index.Libraries { - toTest := lib.Name + " " + - lib.Latest.Paragraph + " " + - lib.Latest.Sentence + " " + - lib.Latest.Author + " " - for _, include := range lib.Latest.ProvidesIncludes { - toTest += include + " " - } + matcher := MatcherFromQueryString(query) - if utils.Match(toTest, queryTerms) { + for _, lib := range lm.Index.Libraries { + if matcher(lib) { res = append(res, indexLibraryToRPCSearchLibrary(lib, req.GetOmitReleasesDetails())) } } diff --git a/commands/lib/search_matcher.go b/commands/lib/search_matcher.go new file mode 100644 index 00000000000..193246579ca --- /dev/null +++ b/commands/lib/search_matcher.go @@ -0,0 +1,135 @@ +// This file is part of arduino-cli. +// +// Copyright 2023 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to +// modify or otherwise use the software for commercial activities involving the +// Arduino software without disclosing the source code of your own applications. +// To purchase a commercial license, send an email to license@arduino.cc. + +package lib + +import ( + "strings" + + "github.com/arduino/arduino-cli/arduino/libraries/librariesindex" + "github.com/arduino/arduino-cli/arduino/utils" +) + +// matcherTokensFromQueryString parses the query string into tokens of interest +// for the qualifier-value pattern matching. +func matcherTokensFromQueryString(query string) []string { + escaped := false + quoted := false + tokens := []string{} + sb := &strings.Builder{} + + for _, r := range query { + // Short circuit the loop on backslash so that all other paths can clear + // the escaped flag. + if !escaped && r == '\\' { + escaped = true + continue + } + + if r == '"' { + if !escaped { + quoted = !quoted + } else { + sb.WriteRune(r) + } + } else if !quoted && r == ' ' { + tokens = append(tokens, strings.ToLower(sb.String())) + sb.Reset() + } else { + sb.WriteRune(r) + } + escaped = false + } + if sb.Len() > 0 { + tokens = append(tokens, strings.ToLower(sb.String())) + } + + return tokens +} + +// defaulLibraryMatchExtractor returns a string describing the library that +// is used for the simple search. +func defaultLibraryMatchExtractor(lib *librariesindex.Library) string { + res := lib.Name + " " + + lib.Latest.Paragraph + " " + + lib.Latest.Sentence + " " + + lib.Latest.Author + " " + for _, include := range lib.Latest.ProvidesIncludes { + res += include + " " + } + return res +} + +var qualifiers map[string]func(lib *librariesindex.Library) string = map[string]func(lib *librariesindex.Library) string{ + "name": func(lib *librariesindex.Library) string { return lib.Name }, + "architectures": func(lib *librariesindex.Library) string { return strings.Join(lib.Latest.Architectures, " ") }, + "author": func(lib *librariesindex.Library) string { return lib.Latest.Author }, + "category": func(lib *librariesindex.Library) string { return lib.Latest.Category }, + "dependencies": func(lib *librariesindex.Library) string { + names := make([]string, len(lib.Latest.Dependencies)) + for i, dep := range lib.Latest.Dependencies { + names[i] = dep.GetName() + } + return strings.Join(names, " ") + }, + "license": func(lib *librariesindex.Library) string { return lib.Latest.License }, + "maintainer": func(lib *librariesindex.Library) string { return lib.Latest.Maintainer }, + "paragraph": func(lib *librariesindex.Library) string { return lib.Latest.Paragraph }, + "provides": func(lib *librariesindex.Library) string { return strings.Join(lib.Latest.ProvidesIncludes, " ") }, + "sentence": func(lib *librariesindex.Library) string { return lib.Latest.Sentence }, + "types": func(lib *librariesindex.Library) string { return strings.Join(lib.Latest.Types, " ") }, + "version": func(lib *librariesindex.Library) string { return lib.Latest.Version.String() }, + "website": func(lib *librariesindex.Library) string { return lib.Latest.Website }, +} + +// MatcherFromQueryString returns a closure that takes a library as a +// parameter and returns true if the library matches the query. +func MatcherFromQueryString(query string) func(*librariesindex.Library) bool { + // A qv-query is one using [:=] syntax. + qvQuery := strings.Contains(query, ":") || strings.Contains(query, "=") + + if !qvQuery { + queryTerms := utils.SearchTermsFromQueryString(query) + return func(lib *librariesindex.Library) bool { + return utils.Match(defaultLibraryMatchExtractor(lib), queryTerms) + } + } + + queryTerms := matcherTokensFromQueryString(query) + + return func(lib *librariesindex.Library) bool { + matched := true + for _, term := range queryTerms { + if sepIdx := strings.IndexAny(term, ":="); sepIdx != -1 { + qualifier, separator, target := term[:sepIdx], term[sepIdx], term[sepIdx+1:] + if extractor, ok := qualifiers[qualifier]; ok { + switch separator { + case ':': + matched = (matched && utils.Match(extractor(lib), []string{target})) + continue + case '=': + matched = (matched && strings.ToLower(extractor(lib)) == target) + continue + } + } + } + // We perform the usual match in the following cases: + // 1. Unknown qualifier names revert to basic search terms. + // 2. Terms that do not use qv-syntax. + matched = (matched && utils.Match(defaultLibraryMatchExtractor(lib), []string{term})) + } + return matched + } +} diff --git a/commands/lib/search_test.go b/commands/lib/search_test.go index affb9ba6911..8a5870338cd 100644 --- a/commands/lib/search_test.go +++ b/commands/lib/search_test.go @@ -28,6 +28,7 @@ import ( var customIndexPath = paths.New("testdata", "test1") var fullIndexPath = paths.New("testdata", "full") +var qualifiedSearchIndexPath = paths.New("testdata", "qualified_search") func TestSearchLibrary(t *testing.T) { lm := librariesmanager.NewLibraryManager(customIndexPath, nil) @@ -94,3 +95,112 @@ func TestSearchLibraryFields(t *testing.T) { require.Len(t, res, 19) require.Equal(t, "FlashStorage", res[0]) } + +func TestSearchLibraryWithQualifiers(t *testing.T) { + lm := librariesmanager.NewLibraryManager(qualifiedSearchIndexPath, nil) + lm.LoadIndex() + + query := func(q string) []string { + libs := []string{} + for _, lib := range searchLibrary(&rpc.LibrarySearchRequest{SearchArgs: q}, lm).Libraries { + libs = append(libs, lib.Name) + } + return libs + } + + res := query("mesh") + require.Len(t, res, 4) + + res = query("name:Mesh") + require.Len(t, res, 3) + + res = query("name=Mesh") + require.Len(t, res, 0) + + // Space not in double-quoted string + res = query("name=Painless Mesh") + require.Len(t, res, 0) + + // Embedded space in double-quoted string + res = query("name=\"Painless Mesh\"") + require.Len(t, res, 1) + require.Equal(t, "Painless Mesh", res[0]) + + // No closing double-quote - still tokenizes with embedded space + res = query("name:\"Painless Mesh") + require.Len(t, res, 1) + + // Malformed double-quoted string with escaped first double-quote + res = query("name:\\\"Painless Mesh\"") + require.Len(t, res, 0) + + res = query("name:mesh author:TMRh20") + require.Len(t, res, 1) + require.Equal(t, "RF24Mesh", res[0]) + + res = query("mesh dependencies:ArduinoJson") + require.Len(t, res, 1) + require.Equal(t, "Painless Mesh", res[0]) + + res = query("architectures:esp author=\"Suraj I.\"") + require.Len(t, res, 1) + require.Equal(t, "esp8266-framework", res[0]) + + res = query("mesh esp") + require.Len(t, res, 2) + + res = query("mesh esp paragraph:wifi") + require.Len(t, res, 1) + require.Equal(t, "esp8266-framework", res[0]) + + // Unknown qualifier should revert to original matching + res = query("std::array") + require.Len(t, res, 1) + require.Equal(t, "Array", res[0]) + + res = query("data storage") + require.Len(t, res, 1) + require.Equal(t, "Pushdata_ESP8266_SSL", res[0]) + + res = query("category:\"data storage\"") + require.Len(t, res, 1) + require.Equal(t, "Array", res[0]) + + res = query("maintainer:@") + require.Len(t, res, 4) + + res = query("sentence:\"A library for NRF24L01(+) devices mesh.\"") + require.Len(t, res, 1) + require.Equal(t, "RF24Mesh", res[0]) + + res = query("types=contributed") + require.Len(t, res, 7) + + res = query("version:1.0") + require.Len(t, res, 3) + + res = query("version=1.2.1") + require.Len(t, res, 1) + require.Equal(t, "Array", res[0]) + + // Non-SSL URLs + res = query("website:http://") + require.Len(t, res, 1) + require.Equal(t, "RF24Mesh", res[0]) + + // Literal double-quote + res = query("sentence:\\\"") + require.Len(t, res, 1) + require.Equal(t, "RTCtime", res[0]) + + res = query("license=MIT") + require.Len(t, res, 2) + + // Empty string + res = query("license=\"\"") + require.Len(t, res, 5) + + res = query("provides:painlessmesh.h") + require.Len(t, res, 1) + require.Equal(t, "Painless Mesh", res[0]) +} diff --git a/commands/lib/testdata/qualified_search/library_index.json b/commands/lib/testdata/qualified_search/library_index.json new file mode 100644 index 00000000000..23dfb04bae9 --- /dev/null +++ b/commands/lib/testdata/qualified_search/library_index.json @@ -0,0 +1,136 @@ +{ + "libraries": [ + { + "name": "Array", + "version": "1.2.1", + "author": "Peter Polidoro \u003cpeterpolidoro@gmail.com\u003e", + "maintainer": "Peter Polidoro \u003cpeterpolidoro@gmail.com\u003e", + "sentence": "An array container similar to the C++ std::array", + "paragraph": "Like this project? Please star it on GitHub!", + "website": "https://github.com/janelia-arduino/Array.git", + "category": "Data Storage", + "architectures": ["*"], + "types": ["Contributed"], + "repository": "https://github.com/janelia-arduino/Array.git", + "url": "https://downloads.arduino.cc/libraries/github.com/janelia-arduino/Array-1.2.1.zip", + "archiveFileName": "Array-1.2.1.zip", + "size": 7859, + "checksum": "SHA-256:dc69e0b4d1390c08253120a80e6e07e5cc6185ec24cbe3cb96dec2d8173e6495" + }, + { + "name": "esp8266-framework", + "version": "1.1.5", + "author": "Suraj I.", + "maintainer": "Suraj I. \u003csurajinamdar151@gmail.com\u003e", + "sentence": "esp8266 framework stack for easy configurable applications", + "paragraph": "esp8266 framework includes all services like gpio, wifi, http, mqtt, ntp, ota, napt, espnow, mesh, server etc. which are ready to use in all applications", + "website": "https://github.com/Suraj151/esp8266-framework", + "category": "Communication", + "architectures": ["esp8266"], + "types": ["Contributed"], + "repository": "https://github.com/Suraj151/esp8266-framework.git", + "url": "https://downloads.arduino.cc/libraries/github.com/Suraj151/esp8266_framework-1.1.5.zip", + "archiveFileName": "esp8266_framework-1.1.5.zip", + "size": 1918535, + "checksum": "SHA-256:81731d4ccc80846c317a2d4e2086d32caa695ed97d3e4765a59c5651b4be30b5" + }, + { + "name": "Painless Mesh", + "version": "1.5.0", + "author": "Coopdis,Scotty Franzyshen,Edwin van Leeuwen,Germán Martín,Maximilian Schwarz,Doanh Doanh", + "maintainer": "Edwin van Leeuwen", + "sentence": "A painless way to setup a mesh with ESP8266 and ESP32 devices", + "paragraph": "A painless way to setup a mesh with ESP8266 and ESP32 devices", + "website": "https://gitlab.com/painlessMesh/painlessMesh", + "category": "Communication", + "architectures": ["esp8266", "esp32"], + "types": ["Contributed"], + "repository": "https://gitlab.com/painlessMesh/painlessMesh.git", + "providesIncludes": ["painlessMesh.h"], + "dependencies": [ + { + "name": "ArduinoJson" + }, + { + "name": "TaskScheduler" + } + ], + "url": "https://downloads.arduino.cc/libraries/gitlab.com/painlessMesh/Painless_Mesh-1.5.0.zip", + "archiveFileName": "Painless_Mesh-1.5.0.zip", + "size": 293531, + "checksum": "SHA-256:9d965064fc704e8ba19c0452cc50e619145f7869b9b135dbf7e521f6ec0a4b33" + }, + { + "name": "Pushdata_ESP8266_SSL", + "version": "0.0.6", + "author": "Ragnar Lonn", + "maintainer": "Ragnar Lonn \u003chello@pushdata.io\u003e", + "license": "MIT", + "sentence": "Free, ultra-simple time series data storage for your IoT sensors", + "paragraph": "Pushdata.io client library that makes it very simple to store your time series data online", + "website": "https://pushdata.io", + "category": "Communication", + "architectures": ["*"], + "types": ["Contributed"], + "repository": "https://github.com/pushdata-io/Arduino_ESP8266_SSL.git", + "providesIncludes": ["Pushdata_ESP8266_SSL.h"], + "url": "https://downloads.arduino.cc/libraries/github.com/pushdata-io/Pushdata_ESP8266_SSL-0.0.6.zip", + "archiveFileName": "Pushdata_ESP8266_SSL-0.0.6.zip", + "size": 12160, + "checksum": "SHA-256:5d592eb7900782f681b86f5fd77c5d9f25c78555e3b5f0880c52197031206df0" + }, + { + "name": "RF24Mesh", + "version": "1.0.0", + "author": "TMRh20", + "maintainer": "TMRh20", + "sentence": "A library for NRF24L01(+) devices mesh.", + "paragraph": "Provides a simple and seamless 'mesh' layer for sensor networks, allowing automatic and dynamic configuration that can be customized to suit many scenarios. It is currently designed to interface directly with with the RF24Network Development library, an OSI Network Layer using nRF24L01(+) radios driven by the newly optimized RF24 library fork.", + "website": "http://tmrh20.github.io/RF24Mesh/", + "category": "Communication", + "architectures": ["avr"], + "types": ["Contributed"], + "repository": "https://github.com/TMRh20/RF24Mesh.git", + "url": "https://downloads.arduino.cc/libraries/github.com/TMRh20/RF24Mesh-1.0.0.zip", + "archiveFileName": "RF24Mesh-1.0.0.zip", + "size": 31419, + "checksum": "SHA-256:1b122a6412bc06a33a7fbcef34e2210d0990c25839fd7bc547604103f28194b5" + }, + { + "name": "RTCtime", + "version": "1.0.5", + "author": "smz \u003ctinker@smz.it\u003e", + "maintainer": "smz (https://github.com/smz)", + "sentence": "A \"Standard C Runtime\" compatible library for interfacing the DS1307 and DS3231 Real Time Clock modules.", + "paragraph": "This library is for getting/setting time from hardware RTC modules. It uses an API compatible with the AVR implementation of the Standard C runtime time library as available in the Arduino IDE since version 1.6.10 (AVR C Runtime Library 2.0.0)", + "website": "https://github.com/smz/Arduino-RTCtime", + "category": "Timing", + "architectures": ["*"], + "types": ["Contributed"], + "repository": "https://github.com/smz/Arduino-RTCtime.git", + "url": "https://downloads.arduino.cc/libraries/github.com/smz/RTCtime-1.0.5.zip", + "archiveFileName": "RTCtime-1.0.5.zip", + "size": 18870, + "checksum": "SHA-256:89493bb6d1f834426e82330fdf55a249ff43eb61707831d75deed8644a7ebce8" + }, + { + "name": "DLLN3X ZigBee Mesh Module Library", + "version": "1.0.1", + "author": "Duke Liu \u003cmentalflow@ourdocs.cn\u003e", + "maintainer": "Duke Liu \u003cmentalflow@ourdocs.cn\u003e", + "license": "MIT", + "sentence": "This library allows you to use DLLN3X ZigBee mesh module very easily.", + "paragraph": "This library currently allows basic send and receive operations using the DLLN3X module, with more features to come.", + "website": "https://github.com/mentalfl0w/DLLN3X_zigbee_mesh_module_library", + "category": "Communication", + "architectures": ["*"], + "types": ["Contributed"], + "repository": "https://github.com/mentalfl0w/DLLN3X_zigbee_mesh_module_library.git", + "providesIncludes": ["DLLN3X.h"], + "url": "https://downloads.arduino.cc/libraries/github.com/mentalfl0w/DLLN3X_ZigBee_Mesh_Module_Library-1.0.1.zip", + "archiveFileName": "DLLN3X_ZigBee_Mesh_Module_Library-1.0.1.zip", + "size": 6122, + "checksum": "SHA-256:a28833bbd575ef8deab744a1f0e1175dad9e5329bf5c620fc2fe53e1de1d32ba" + } + ] +} diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md index 6b12115c0ff..7c92c5f336d 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -2,6 +2,171 @@ Here you can find a list of migration guides to handle breaking changes between releases of the CLI. +## 0.36.0 + +### CLI `core list` and `core search` changed JSON output. + +Below is an example of the response containing an object with all possible keys set. + +```json +[ + { + "id": "arduino:avr", + "maintainer": "Arduino", + "website": "http://www.arduino.cc/", + "email": "packages@arduino.cc", + "indexed": true, + "manually_installed": true, + "deprecated": true, + "releases": { + "1.6.2": { + "name": "Arduino AVR Boards", + "version": "1.6.2", + "type": [ + "Arduino" + ], + "installed": true, + "boards": [ + { + "name": "Arduino Robot Motor" + } + ], + "help": { + "online": "http://www.arduino.cc/en/Reference/HomePage" + }, + "missing_metadata": true, + "deprecated": true + }, + "1.8.3": { ... } + }, + "installed_version": "1.6.2", + "latest_version": "1.8.3" + } +] +``` + +### gRPC `cc.arduino.cli.commands.v1.PlatformSearchResponse` message has been changed. + +The old behavior was a bit misleading to the client because, to list all the available versions for each platform, we +used to use the `latest` as it was describing the current platform version. We introduced a new message: +`PlatformSummary`, with the intent to make the response more straightforward and less error-prone. + +```protobuf +message PlatformSearchResponse { + // Results of the search. + repeated PlatformSummary search_output = 1; +} + +// PlatformSummary is a structure containing all the information about +// a platform and all its available releases. +message PlatformSummary { + // Generic information about a platform + PlatformMetadata metadata = 1; + // Maps version to the corresponding PlatformRelease + 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 + string latest_version = 4; +} +``` + +The new response contains an array of `PlatformSummary`. `PlatformSummary` contains all the information about a platform +and all its available releases. Releases contain all the PlatformReleases of a specific platform, and the key is the +semver string of a specific version. We've added the `installed_version` and `latest_version` to make more convenient +the access of such values in the map. A few notes about the behavior of the `releases` map: + +- It can be empty if no releases are found +- It can contain a single-release +- It can contain multiple releases +- If in the request we provide the `manually_installed=true`, the key of such release is an empty string. + +### Removed gRPC API: `cc.arduino.cli.commands.v1.PlatformList`, `PlatformListRequest`, and `PlatformListResponse`. + +The following gRPC API have been removed: + +- `cc.arduino.cli.commands.v1.PlatformList`: you can use the already available gRPC method `PlatformSearch` to perform + the same task. Setting the `all_versions=true` and `manually_installed=true` in the `PlatformSearchRequest` returns + all the data needed to produce the same result of the old api. +- `cc.arduino.cli.commands.v1.PlatformListRequest`. +- `cc.arduino.cli.commands.v1.PlatformListResponse`. + +### gRPC `cc.arduino.cli.commands.v1.Platform` message has been changed. + +The old `Platform` and other information such as name, website, and email... contained details about the currently +installed version and the latest available. We noticed an ambiguous use of the `latest` field, especially when such a +message came in the `PlatformSearchResponse` response. In that use case, the latest field contained the specific version +of a particular platform: this is a hack because the value doesn't always reflect the meaning of that property. Another +inconsistent case occurs when a platform maintainer changes the name of a particular release. We always pick the value +from the latest release, but this might not be what we want to do all the time. We concluded that the design of that +message isn't something to be considered future-proof proof, so we decided to modify it as follows: + +```protobuf +// Platform is a structure containing all the information about a single +// platform release. +message Platform { + // Generic information about a platform + PlatformMetadata metadata = 1; + // Information about a specific release of a platform + PlatformRelease release = 2; +} + +// PlatformMetadata contains generic information about a platform (not +// correlated to a specific release). +message PlatformMetadata { + // Platform ID (e.g., `arduino:avr`). + string id = 1; + // Maintainer of the platform's package. + string maintainer = 2; + // A URL provided by the author of the platform's package, intended to point + // to their website. + string website = 3; + // Email of the maintainer of the platform's package. + string email = 4; + // If true this Platform has been installed manually in the user' sketchbook + // hardware folder + bool manually_installed = 5; + // True if the latest release of this Platform has been deprecated + bool deprecated = 6; + // If true the platform is indexed + bool indexed = 7; +} + +// PlatformRelease contains information about a specific release of a platform. +message PlatformRelease { + // Name used to identify the platform to humans (e.g., "Arduino AVR Boards"). + string name = 1; + // Version of the platform release + string version = 5; + // Type of the platform. + repeated string type = 6; + // True if the platform is installed + bool installed = 7; + // List of boards provided by the platform. If the platform is installed, + // this is the boards listed in the platform's boards.txt. If the platform is + // not installed, this is an arbitrary list of board names provided by the + // platform author for display and may not match boards.txt. + repeated Board boards = 8; + // A URL provided by the author of the platform's package, intended to point + // to their online help service. + HelpResources help = 9; + // This field is true if the platform is missing installation metadata (this + // happens if the platform has been installed with the legacy Arduino IDE + // <=1.8.x). If the platform miss metadata and it's not indexed through a + // package index, it may fail to work correctly in some circumstances, and it + // may need to be reinstalled. This should be evaluated only when the + // PlatformRelease is `Installed` otherwise is an undefined behaviour. + bool missing_metadata = 10; + // True this release is deprecated + bool deprecated = 11; +} +``` + +To address all the inconsistencies/inaccuracies we introduced two messages: + +- `PlatformMetadata` contains generic information about a platform (not correlated to a specific release). +- `PlatformRelease` contains information about a specific release of a platform. + ## 0.35.0 ### CLI `debug --info` changed JSON output. diff --git a/go.mod b/go.mod index 3cb1be40908..86bc603bf72 100644 --- a/go.mod +++ b/go.mod @@ -11,6 +11,8 @@ require ( github.com/arduino/go-properties-orderedmap v1.8.0 github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b github.com/arduino/go-win32-utils v1.0.0 + github.com/arduino/pluggable-discovery-protocol-handler/v2 v2.1.1 + github.com/arduino/pluggable-monitor-protocol-handler v0.9.2 github.com/cmaglie/pb v1.0.27 github.com/codeclysm/extract/v3 v3.1.1 github.com/djherbis/buffer v1.2.0 @@ -59,6 +61,8 @@ require ( github.com/go-git/go-billy/v5 v5.5.0 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/h2non/filetype v1.1.3 // indirect + github.com/hashicorp/errwrap v1.0.0 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/imdario/mergo v0.3.12 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect diff --git a/go.sum b/go.sum index 7de473165d6..b2674d86777 100644 --- a/go.sum +++ b/go.sum @@ -17,6 +17,9 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -25,6 +28,7 @@ cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4g cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -48,19 +52,35 @@ github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCv github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= +github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/arduino/arduino-cli v0.0.0-20230206132931-4c0aaa876d1b/go.mod h1:arYwKdEvHC0uvv0FZ0hcWJcUAvqbaaPxv0e7wiamSqo= github.com/arduino/go-paths-helper v1.0.1/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= +github.com/arduino/go-paths-helper v1.2.0/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= +github.com/arduino/go-paths-helper v1.8.0/go.mod h1:V82BWgAAp4IbmlybxQdk9Bpkz8M4Qyx+RAFKaG9NuvU= github.com/arduino/go-paths-helper v1.9.2 h1:omR8DPTL4nbUCWfGey5D+e3WvWfA2zEgoM6ZBRNt7ls= github.com/arduino/go-paths-helper v1.9.2/go.mod h1:V82BWgAAp4IbmlybxQdk9Bpkz8M4Qyx+RAFKaG9NuvU= +github.com/arduino/go-properties-orderedmap v1.7.1/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk= github.com/arduino/go-properties-orderedmap v1.8.0 h1:wEfa6hHdpezrVOh787OmClsf/Kd8qB+zE3P2Xbrn0CQ= github.com/arduino/go-properties-orderedmap v1.8.0/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk= github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b h1:9hDi4F2st6dbLC3y4i02zFT5quS4X6iioWifGlVwfy4= github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b/go.mod h1:uwGy5PpN4lqW97FiLnbcx+xx8jly5YuPMJWfVwwjJiQ= +github.com/arduino/go-win32-utils v0.0.0-20180330194947-ed041402e83b/go.mod h1:iIPnclBMYm1g32Q5kXoqng4jLhMStReIP7ZxaoUC2y8= github.com/arduino/go-win32-utils v1.0.0 h1:/cXB86sOJxOsCHP7sQmXGLkdValwJt56mIwOHYxgQjQ= github.com/arduino/go-win32-utils v1.0.0/go.mod h1:0jqM7doGEAs6DaJCxxhLBUDS5OawrqF48HqXkcEie/Q= +github.com/arduino/pluggable-discovery-protocol-handler/v2 v2.1.1 h1:MPQZ2YImq5qBiOPwTFGOrl6E99XGSRHc+UzHA6hsjvc= +github.com/arduino/pluggable-discovery-protocol-handler/v2 v2.1.1/go.mod h1:2lA930B1Xu/otYT1kbx3l1n5vFJuuyPNkQaqOoQHmPE= +github.com/arduino/pluggable-monitor-protocol-handler v0.9.2 h1:vb5AmE3bT9we5Ej4AdBxcC9dJLXasRimVqaComf9L3M= +github.com/arduino/pluggable-monitor-protocol-handler v0.9.2/go.mod h1:vMG8tgHyE+hli26oT0JB/M7NxUMzzWoU5wd6cgJQRK4= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -76,12 +96,17 @@ github.com/cmaglie/pb v1.0.27/go.mod h1:GilkKZMXYjBA4NxItWFfO+lwkp59PLHQ+IOW/b/k github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/codeclysm/extract/v3 v3.1.0/go.mod h1:ZJi80UG2JtfHqJI+lgJSCACttZi++dHxfWuPaMhlOfQ= github.com/codeclysm/extract/v3 v3.1.1 h1:iHZtdEAwSTqPrd+1n4jfhr1qBhUWtHlMTjT90+fJVXg= github.com/codeclysm/extract/v3 v3.1.1/go.mod h1:ZJi80UG2JtfHqJI+lgJSCACttZi++dHxfWuPaMhlOfQ= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/goselect v0.1.2 h1:2DNy14+JPjRBgPzAd1thbQp4BSIihxcBf0IXhQXDRa0= github.com/creack/goselect v0.1.2/go.mod h1:a/NhLweNvqIYMuxcMOuWY516Cimucms3DglDzQP3hKY= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= @@ -102,14 +127,18 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= @@ -126,8 +155,11 @@ github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid/v5 v5.0.0 h1:p544++a97kEL+svbcFbCQVM9KFu0Yo25UoISXGNNH9M= github.com/gofrs/uuid/v5 v5.0.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -139,6 +171,7 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -154,6 +187,8 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -166,10 +201,12 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -183,21 +220,46 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/h2non/filetype v1.1.3 h1:FKkx9QbD7HR/zjK1Ia5XiBsq9zdLi5Kf3zGyFTAFkGg= github.com/h2non/filetype v1.1.3/go.mod h1:319b3zT68BvV+WRj7cwy856M2ehB3HqNOt6sy1HndBY= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/itchyny/gojq v0.12.8 h1:Zxcwq8w4IeR8JJYEtoG2MWJZUv0RGY6QqJcO1cqV8+A= @@ -206,17 +268,32 @@ github.com/itchyny/timefmt-go v0.1.3 h1:7M3LGVDsqcd0VZH2U+x393obrzZisp7C0uEe921i github.com/itchyny/timefmt-go v0.1.3/go.mod h1:0osSSCQSASBJMsIZnhAaF1C2fCBTJZXrnj37mG8/c+A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/juju/clock v0.0.0-20180524022203-d293bb356ca4/go.mod h1:nD0vlnrUjcjJhqN5WuCWZyzfd5AHZAC9/ajvbSx69xA= +github.com/juju/errors v0.0.0-20150916125642-1b5e39b83d18/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= +github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= github.com/juju/errors v1.0.0 h1:yiq7kjCLll1BiaRuNY53MGI0+EQ3rF6GB+wvboZDefM= github.com/juju/errors v1.0.0/go.mod h1:B5x9thDqx0wIMH3+aLIMP9HjItInYWObRovoCFM5Qe8= +github.com/juju/loggo v0.0.0-20170605014607-8232ab8918d9/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= +github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= +github.com/juju/retry v0.0.0-20160928201858-1998d01ba1c3/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= +github.com/juju/testing v0.0.0-20200510222523-6c8c298c77a0/go.mod h1:hpGvhGHPVbNBraRLZEhoQwFLMrjK8PSlO4D3nDjKYXo= +github.com/juju/utils v0.0.0-20180808125547-9dfc6dbfb02b/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= +github.com/juju/version v0.0.0-20161031051906-1f41e27e54f2/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= +github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.15.13/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -226,19 +303,25 @@ github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leonelquinteros/gotext v1.4.0 h1:2NHPCto5IoMXbrT0bldPrxj0qM5asOCwtb1aUQZ1tys= github.com/leonelquinteros/gotext v1.4.0/go.mod h1:yZGXREmoGTtBvZHNcc+Yfug49G/2spuF/i/Qlsvz1Us= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/marcinbor85/gohex v0.0.0-20210308104911-55fb1c624d84 h1:hyAgCuG5nqTMDeUD8KZs7HSPs6KprPgPP8QmGV8nyvk= github.com/marcinbor85/gohex v0.0.0-20210308104911-55fb1c624d84/go.mod h1:Pb6XcsXyropB9LNHhnqaknG/vEwYztLkQzVCHv8sQ3M= github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= @@ -246,75 +329,112 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= +github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmylund/sortutil v0.0.0-20120526081524-abeda66eb583/go.mod h1:sFPiU/UgDcsQVu3vkqpZLCXWFwUoQRpHGu9ATihPAl0= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 h1:mZHayPoR0lNmnHyvtYjDeq0zlVHn9K/ZXoy17ylucdo= github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5/go.mod h1:GEXHk5HgEKCvEIIrSpFI3ozzG5xOKA2DVlEX/gGnewM= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sagikazarmark/locafero v0.3.0 h1:zT7VEGWC2DTflmccN/5T1etyKvxSxpHsjb9cJvm4SvQ= github.com/sagikazarmark/locafero v0.3.0/go.mod h1:w+v7UsPNFwzF1cHuOajOOzoq4U7v/ig1mpRjqV+Bu1U= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/schollz/closestmatch v2.1.0+incompatible h1:Uel2GXEpJqOWBrlyI+oY9LTiyyjYS17cCYRqP13/SHk= github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI= github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI= +github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= @@ -328,31 +448,45 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.bug.st/cleanup v1.0.0 h1:XVj1HZxkBXeq3gMT7ijWUpHyIC1j8XAoNSyQ06CskgA= go.bug.st/cleanup v1.0.0/go.mod h1:EqVmTg2IBk4znLbPD28xne3abjsJftMdqqJEjhn70bk= go.bug.st/downloader/v2 v2.1.1 h1:nyqbUizo3E2IxCCm4YFac4FtSqqFpqWP+Aae5GCMuw4= go.bug.st/downloader/v2 v2.1.1/go.mod h1:VZW2V1iGKV8rJL2ZEGIDzzBeKowYv34AedJz13RzVII= +go.bug.st/relaxed-semver v0.9.0/go.mod h1:ug0/W/RPYUjliE70Ghxg77RDHmPxqpo7SHV16ijss7Q= go.bug.st/relaxed-semver v0.11.0 h1:ngzpUlBEZ5F9hJnMZP55LIFbgX3bCztBBufMhJViAsY= go.bug.st/relaxed-semver v0.11.0/go.mod h1:rqPEm+790OTQlAdfSJSHWwpKOg3A8UyvAWMZxYkQivc= +go.bug.st/serial v1.3.2/go.mod h1:jDkjqASf/qSjmaOxHSHljwUQ6eHo/ZX/bxJLQqSlvZg= go.bug.st/serial v1.6.1 h1:VSSWmUxlj1T/YlRo2J104Zv3wJFrjHIl/T3NeruWAHY= go.bug.st/serial v1.6.1/go.mod h1:UABfsluHAiaNI+La2iESysd9Vetq7VRdpxvjx7CmmOE= go.bug.st/testifyjson v1.1.1 h1:nHotIMK151LF3vYsU/b2RaoVaWCgrf2kvQeGNoZkGaA= go.bug.st/testifyjson v1.1.1/go.mod h1:nZyy2icFbv3OE3zW3mGVOnC/GhWgb93LRu+29n2tJlI= +go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +golang.org/x/crypto v0.0.0-20180214000028-650f4a345ab4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= @@ -389,6 +523,7 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -399,12 +534,16 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20180406214816-61147c48b25b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -431,10 +570,14 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= @@ -451,6 +594,9 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -461,15 +607,20 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -477,10 +628,12 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -500,14 +653,21 @@ golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -532,6 +692,7 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= @@ -548,15 +709,18 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -579,6 +743,7 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= @@ -587,8 +752,10 @@ golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= @@ -616,6 +783,9 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -646,6 +816,7 @@ google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= @@ -658,7 +829,13 @@ google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a h1:a2MQQVoTo96JC9PMGtGBymLp7+/RzpFc2yX/9WfFg1c= google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -674,9 +851,13 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -694,22 +875,33 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/mgo.v2 v2.0.0-20160818015218-f2b6f6c918c4/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= +gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= +gopkg.in/src-d/go-billy.v4 v4.3.2/go.mod h1:nDjArDMp+XMs1aFAESLRjfGSgfvoYN0hDfzEk0GjC98= +gopkg.in/src-d/go-git-fixtures.v3 v3.5.0/go.mod h1:dLBcvytrw/TYZsNTWCnkNF2DSIlzWYqTe3rJR56Ac7g= +gopkg.in/src-d/go-git.v4 v4.13.1/go.mod h1:nx5NYcxdKxq5fpltdHnPa2Exj4Sx0EclMWZQbYDu2z8= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170712054546-1be3d31502d6/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/i18n/data/it_IT.po b/i18n/data/it_IT.po index 31236af5d92..08764032efe 100644 --- a/i18n/data/it_IT.po +++ b/i18n/data/it_IT.po @@ -1651,7 +1651,7 @@ msgstr "Manca il programmatore" #: internal/cli/upload/upload.go:162 msgid "Missing required upload field: %s" -msgstr "" +msgstr "Manca un campo obbligatorio del caricamento: %s" #: arduino/builder/sizer.go:243 msgid "Missing size regexp" @@ -2144,7 +2144,7 @@ msgstr "Tipo di server" #: internal/cli/upload/upload.go:81 msgid "Set a value for a field required to upload." -msgstr "" +msgstr "Imposta un valore per un campo richiesto dal caricamento." #: internal/cli/monitor/monitor.go:68 msgid "Set terminal in raw mode (unbuffered)." diff --git a/install.sh b/install.sh index 1ef08729e69..8be41ae6c9d 100755 --- a/install.sh +++ b/install.sh @@ -84,7 +84,7 @@ initDownloadTool() { checkLatestVersion() { # Use the GitHub releases webpage to find the latest version for this project # so we don't get rate-limited. - CHECKLATESTVERSION_REGEX="[0-9][A-Za-z0-9\.-]*" + CHECKLATESTVERSION_REGEX="v\?[0-9][A-Za-z0-9\.-]*" CHECKLATESTVERSION_LATEST_URL="https://github.com/${PROJECT_OWNER}/${PROJECT_NAME}/releases/latest" if [ "$DOWNLOAD_TOOL" = "curl" ]; then CHECKLATESTVERSION_TAG=$(curl -SsL $CHECKLATESTVERSION_LATEST_URL | grep -o "Release $CHECKLATESTVERSION_REGEX · ${PROJECT_OWNER}/${PROJECT_NAME}" | grep -o "$CHECKLATESTVERSION_REGEX") diff --git a/internal/cli/arguments/completion.go b/internal/cli/arguments/completion.go index c97ac72f064..2139e415fe1 100644 --- a/internal/cli/arguments/completion.go +++ b/internal/cli/arguments/completion.go @@ -83,15 +83,19 @@ func GetInstalledProgrammers() []string { func GetUninstallableCores() []string { inst := instance.CreateAndInit() - platforms, _ := core.PlatformList(&rpc.PlatformListRequest{ - Instance: inst, - UpdatableOnly: false, - All: false, + platforms, _ := core.PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: inst, + AllVersions: false, + ManuallyInstalled: true, }) + var res []string // transform the data structure for the completion - for _, i := range platforms.InstalledPlatforms { - res = append(res, i.Id+"\t"+i.Name) + for _, i := range platforms.GetSearchOutput() { + if i.InstalledVersion == "" { + continue + } + res = append(res, i.GetMetadata().GetId()+"\t"+i.GetInstalledRelease().GetName()) } return res } @@ -109,7 +113,7 @@ func GetInstallableCores() []string { var res []string // transform the data structure for the completion for _, i := range platforms.SearchOutput { - res = append(res, i.Id+"\t"+i.Name) + res = append(res, i.GetMetadata().GetId()+"\t"+i.GetReleases()[i.GetLatestVersion()].GetName()) } return res } diff --git a/internal/cli/arguments/port.go b/internal/cli/arguments/port.go index 14f5846d80d..80df4b5c22c 100644 --- a/internal/cli/arguments/port.go +++ b/internal/cli/arguments/port.go @@ -155,3 +155,8 @@ func (p *Port) DetectFQBN(inst *rpc.Instance) (string, *rpc.Port) { } return "", nil } + +// IsPortFlagSet returns true if the port address is provided +func (p *Port) IsPortFlagSet() bool { + return p.address != "" +} diff --git a/internal/cli/arguments/reference.go b/internal/cli/arguments/reference.go index a870a0616a2..f9d8737d415 100644 --- a/internal/cli/arguments/reference.go +++ b/internal/cli/arguments/reference.go @@ -66,6 +66,7 @@ func ParseReference(arg string) (*Reference, error) { if arg == "" { return nil, fmt.Errorf(tr("invalid empty core argument")) } + toks := strings.SplitN(arg, "@", 2) if toks[0] == "" { return nil, fmt.Errorf(tr("invalid empty core reference '%s'"), arg) @@ -85,23 +86,22 @@ func ParseReference(arg string) (*Reference, error) { if toks[0] == "" { return nil, fmt.Errorf(tr("invalid empty core name '%s'"), arg) } - ret.PackageName = toks[0] if toks[1] == "" { return nil, fmt.Errorf(tr("invalid empty core architecture '%s'"), arg) } + ret.PackageName = toks[0] ret.Architecture = toks[1] // Now that we have the required informations in `ret` we can // try to use core.PlatformList to optimize what the user typed // (by replacing the PackageName and Architecture in ret with the content of core.GetPlatform()) - platforms, _ := core.PlatformList(&rpc.PlatformListRequest{ - Instance: instance.CreateAndInit(), - UpdatableOnly: false, - All: true, // this is true because we want also the installable platforms + platforms, _ := core.PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: instance.CreateAndInit(), + AllVersions: false, }) foundPlatforms := []string{} - for _, platform := range platforms.InstalledPlatforms { - platformID := platform.GetId() + for _, platform := range platforms.GetSearchOutput() { + platformID := platform.GetMetadata().GetId() platformUser := ret.PackageName + ":" + ret.Architecture // At first we check if the platform the user is searching for matches an available one, // this way we do not need to adapt the casing and we can return it directly @@ -110,7 +110,6 @@ func ParseReference(arg string) (*Reference, error) { } if strings.EqualFold(platformUser, platformID) { logrus.Infof("Found possible match for reference %s -> %s", platformUser, platformID) - toks = strings.Split(platformID, ":") foundPlatforms = append(foundPlatforms, platformID) } } @@ -122,6 +121,7 @@ func ParseReference(arg string) (*Reference, error) { if len(foundPlatforms) > 1 { return nil, &arduino.MultiplePlatformsError{Platforms: foundPlatforms, UserPlatform: arg} } + toks = strings.Split(foundPlatforms[0], ":") ret.PackageName = toks[0] ret.Architecture = toks[1] return ret, nil diff --git a/internal/cli/board/search.go b/internal/cli/board/search.go index 102e9ea1dae..efa3f945662 100644 --- a/internal/cli/board/search.go +++ b/internal/cli/board/search.go @@ -85,7 +85,7 @@ func (r searchResults) String() string { if item.IsHidden { hidden = tr("(hidden)") } - t.AddRow(item.GetName(), item.GetFqbn(), item.Platform.Id, hidden) + t.AddRow(item.GetName(), item.GetFqbn(), item.Platform.Metadata.Id, hidden) } return t.Render() } diff --git a/internal/cli/core/list.go b/internal/cli/core/list.go index 4645295b063..4242fa6d7a9 100644 --- a/internal/cli/core/list.go +++ b/internal/cli/core/list.go @@ -21,6 +21,7 @@ import ( "github.com/arduino/arduino-cli/commands/core" "github.com/arduino/arduino-cli/internal/cli/feedback" + "github.com/arduino/arduino-cli/internal/cli/feedback/result" "github.com/arduino/arduino-cli/internal/cli/instance" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" "github.com/arduino/arduino-cli/table" @@ -55,44 +56,76 @@ func runListCommand(args []string, all bool, updatableOnly bool) { // List gets and prints a list of installed platforms. func List(inst *rpc.Instance, all bool, updatableOnly bool) { platforms := GetList(inst, all, updatableOnly) - feedback.PrintResult(installedResult{platforms}) + feedback.PrintResult(newCoreListResult(platforms)) } // GetList returns a list of installed platforms. -func GetList(inst *rpc.Instance, all bool, updatableOnly bool) []*rpc.Platform { - platforms, err := core.PlatformList(&rpc.PlatformListRequest{ - Instance: inst, - UpdatableOnly: updatableOnly, - All: all, +func GetList(inst *rpc.Instance, all bool, updatableOnly bool) []*rpc.PlatformSummary { + platforms, err := core.PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: inst, + AllVersions: true, + ManuallyInstalled: true, }) if err != nil { feedback.Fatal(tr("Error listing platforms: %v", err), feedback.ErrGeneric) } - return platforms.InstalledPlatforms + + // If both `all` and `updatableOnly` are set, `all` takes precedence. + if all { + return platforms.GetSearchOutput() + } + + result := []*rpc.PlatformSummary{} + for _, platform := range platforms.GetSearchOutput() { + if platform.InstalledVersion == "" && !platform.GetMetadata().ManuallyInstalled { + continue + } + if updatableOnly && platform.InstalledVersion == platform.LatestVersion { + continue + } + result = append(result, platform) + } + return result } -// output from this command requires special formatting, let's create a dedicated -// feedback.Result implementation -type installedResult struct { - platforms []*rpc.Platform +func newCoreListResult(in []*rpc.PlatformSummary) *coreListResult { + res := &coreListResult{} + for _, platformSummary := range in { + res.platforms = append(res.platforms, result.NewPlatformResult(platformSummary)) + } + return res +} + +type coreListResult struct { + platforms []*result.Platform } -func (ir installedResult) Data() interface{} { +// Data implements Result interface +func (ir coreListResult) Data() interface{} { return ir.platforms } -func (ir installedResult) String() string { +// String implements Result interface +func (ir coreListResult) String() string { if len(ir.platforms) == 0 { return tr("No platforms installed.") } t := table.New() t.SetHeader(tr("ID"), tr("Installed"), tr("Latest"), tr("Name")) - for _, p := range ir.platforms { - name := p.Name - if p.Deprecated { + for _, platform := range ir.platforms { + name := "" + if installed := platform.GetInstalledRelease(); installed != nil { + name = installed.Name + } + if name == "" { + if latest := platform.GetLatestRelease(); latest != nil { + name = latest.Name + } + } + if platform.Deprecated { name = fmt.Sprintf("[%s] %s", tr("DEPRECATED"), name) } - t.AddRow(p.Id, p.Installed, p.Latest, 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 0259d35bf44..78e02ddf400 100644 --- a/internal/cli/core/search.go +++ b/internal/cli/core/search.go @@ -29,6 +29,7 @@ import ( "github.com/arduino/arduino-cli/commands/core" "github.com/arduino/arduino-cli/configuration" "github.com/arduino/arduino-cli/internal/cli/feedback" + "github.com/arduino/arduino-cli/internal/cli/feedback/result" "github.com/arduino/arduino-cli/internal/cli/instance" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" "github.com/arduino/arduino-cli/table" @@ -81,13 +82,21 @@ func runSearchCommand(cmd *cobra.Command, args []string) { } coreslist := resp.GetSearchOutput() - feedback.PrintResult(searchResults{coreslist}) + feedback.PrintResult(newSearchResult(coreslist)) } // output from this command requires special formatting, let's create a dedicated // feedback.Result implementation type searchResults struct { - platforms []*rpc.Platform + platforms []*result.Platform +} + +func newSearchResult(in []*rpc.PlatformSummary) *searchResults { + res := &searchResults{} + for _, platformSummary := range in { + res.platforms = append(res.platforms, result.NewPlatformResult(platformSummary)) + } + return res } func (sr searchResults) Data() interface{} { @@ -98,12 +107,17 @@ func (sr searchResults) String() string { if len(sr.platforms) > 0 { t := table.New() t.SetHeader(tr("ID"), tr("Version"), tr("Name")) - for _, item := range sr.platforms { - name := item.GetName() - if item.Deprecated { + for _, platform := range sr.platforms { + name := "" + if latest := platform.GetLatestRelease(); latest != nil { + name = latest.Name + } + if platform.Deprecated { name = fmt.Sprintf("[%s] %s", tr("DEPRECATED"), name) } - t.AddRow(item.GetId(), item.GetLatest(), name) + for _, version := range platform.Releases.Keys() { + t.AddRow(platform.Id, version, name) + } } return t.Render() } diff --git a/internal/cli/core/upgrade.go b/internal/cli/core/upgrade.go index f8484dc985b..04045cc3bf6 100644 --- a/internal/cli/core/upgrade.go +++ b/internal/cli/core/upgrade.go @@ -60,21 +60,36 @@ func runUpgradeCommand(args []string, skipPostInstall bool, skipPreUninstall boo func Upgrade(inst *rpc.Instance, args []string, skipPostInstall bool, skipPreUninstall bool) { // if no platform was passed, upgrade allthethings if len(args) == 0 { - targets, err := core.PlatformList(&rpc.PlatformListRequest{ - Instance: inst, - UpdatableOnly: true, + platforms, err := core.PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: inst, + AllVersions: false, }) if err != nil { feedback.Fatal(tr("Error retrieving core list: %v", err), feedback.ErrGeneric) } - if len(targets.InstalledPlatforms) == 0 { + targets := []*rpc.Platform{} + for _, platform := range platforms.GetSearchOutput() { + if platform.InstalledVersion == "" { + continue + } + if platform.InstalledVersion == platform.LatestVersion { + // if it's not updatable, skip it + continue + } + targets = append(targets, &rpc.Platform{ + Metadata: platform.GetMetadata(), + Release: platform.GetLatestRelease(), + }) + } + + if len(targets) == 0 { feedback.Print(tr("All the cores are already at the latest version")) return } - for _, t := range targets.InstalledPlatforms { - args = append(args, t.Id) + for _, t := range targets { + args = append(args, t.GetMetadata().Id) } } @@ -82,8 +97,8 @@ func Upgrade(inst *rpc.Instance, args []string, skipPostInstall bool, skipPreUni if response == nil || response.Platform == nil { return } - if !response.Platform.Indexed { - feedback.Warning(tr("missing package index for %s, future updates cannot be guaranteed", response.Platform.Id)) + if !response.Platform.GetMetadata().Indexed { + feedback.Warning(tr("missing package index for %s, future updates cannot be guaranteed", response.Platform.GetMetadata().Id)) } } diff --git a/internal/cli/feedback/result/rpc.go b/internal/cli/feedback/result/rpc.go new file mode 100644 index 00000000000..b6bdb636706 --- /dev/null +++ b/internal/cli/feedback/result/rpc.go @@ -0,0 +1,121 @@ +// This file is part of arduino-cli. +// +// Copyright 2020 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to +// modify or otherwise use the software for commercial activities involving the +// Arduino software without disclosing the source code of your own applications. +// To purchase a commercial license, send an email to license@arduino.cc. + +package result + +import ( + "github.com/arduino/arduino-cli/internal/orderedmap" + rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" + semver "go.bug.st/relaxed-semver" +) + +// NewPlatformResult creates a new result.Platform from rpc.PlatformSummary +func NewPlatformResult(in *rpc.PlatformSummary) *Platform { + releases := orderedmap.NewWithConversionFunc[*semver.Version, *PlatformRelease, string]((*semver.Version).String) + for k, v := range in.Releases { + releases.Set(semver.MustParse(k), NewPlatformReleaseResult(v)) + } + releases.SortKeys((*semver.Version).CompareTo) + + return &Platform{ + Id: in.Metadata.Id, + Maintainer: in.Metadata.Maintainer, + Website: in.Metadata.Website, + Email: in.Metadata.Email, + ManuallyInstalled: in.Metadata.ManuallyInstalled, + Deprecated: in.Metadata.Deprecated, + Indexed: in.Metadata.Indexed, + Releases: releases, + InstalledVersion: semver.MustParse(in.InstalledVersion), + LatestVersion: semver.MustParse(in.LatestVersion), + } +} + +// Platform maps a rpc.Platform +type Platform struct { + Id string `json:"id,omitempty"` + Maintainer string `json:"maintainer,omitempty"` + Website string `json:"website,omitempty"` + Email string `json:"email,omitempty"` + ManuallyInstalled bool `json:"manually_installed,omitempty"` + Deprecated bool `json:"deprecated,omitempty"` + Indexed bool `json:"indexed,omitempty"` + + Releases orderedmap.Map[*semver.Version, *PlatformRelease] `json:"releases,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. +func (p *Platform) GetLatestRelease() *PlatformRelease { + return p.Releases.Get(p.LatestVersion) +} + +// GetInstalledRelease returns the installed relase of this platform or nil if none available. +func (p *Platform) GetInstalledRelease() *PlatformRelease { + return p.Releases.Get(p.InstalledVersion) +} + +// NewPlatformReleaseResult creates a new result.PlatformRelease from rpc.PlatformRelease +func NewPlatformReleaseResult(in *rpc.PlatformRelease) *PlatformRelease { + var boards []*Board + for _, board := range in.Boards { + boards = append(boards, &Board{ + Name: board.Name, + Fqbn: board.Fqbn, + }) + } + var help *HelpResource + if in.Help != nil { + help = &HelpResource{ + Online: in.Help.Online, + } + } + res := &PlatformRelease{ + Name: in.Name, + Version: in.Version, + Type: in.Type, + Installed: in.Installed, + Boards: boards, + Help: help, + MissingMetadata: in.MissingMetadata, + Deprecated: in.Deprecated, + } + return res +} + +// PlatformRelease maps a rpc.PlatformRelease +type PlatformRelease struct { + Name string `json:"name,omitempty"` + Version string `json:"version,omitempty"` + Type []string `json:"type,omitempty"` + Installed bool `json:"installed,omitempty"` + Boards []*Board `json:"boards,omitempty"` + Help *HelpResource `json:"help,omitempty"` + MissingMetadata bool `json:"missing_metadata,omitempty"` + Deprecated bool `json:"deprecated,omitempty"` +} + +// Board maps a rpc.Board +type Board struct { + Name string `json:"name,omitempty"` + Fqbn string `json:"fqbn,omitempty"` +} + +// HelpResource maps a rpc.HelpResource +type HelpResource struct { + Online string `json:"online,omitempty"` +} diff --git a/internal/cli/feedback/terminal.go b/internal/cli/feedback/terminal.go index 11c466bae8b..09dc0212f4a 100644 --- a/internal/cli/feedback/terminal.go +++ b/internal/cli/feedback/terminal.go @@ -35,9 +35,6 @@ func InteractiveStreams() (io.Reader, io.Writer, error) { if format != Text { return nil, nil, errors.New(tr("interactive terminal not supported for the '%s' output format", format)) } - if !isTerminal() { - return nil, nil, errors.New(tr("not running in a terminal")) - } return os.Stdin, stdOut, nil } @@ -45,11 +42,19 @@ var oldStateStdin *term.State // SetRawModeStdin sets the stdin stream in RAW mode (no buffering, echo disabled, // no terminal escape codes nor signals interpreted) -func SetRawModeStdin() { +func SetRawModeStdin() error { if oldStateStdin != nil { panic("terminal already in RAW mode") } - oldStateStdin, _ = term.MakeRaw(int(os.Stdin.Fd())) + if !IsTerminal() { + return errors.New(tr("not running in a terminal")) + } + old, err := term.MakeRaw(int(os.Stdin.Fd())) + if err != nil { + return err + } + oldStateStdin = old + return nil } // RestoreModeStdin restore the terminal settings to the normal non-RAW state. This @@ -63,7 +68,8 @@ func RestoreModeStdin() { oldStateStdin = nil } -func isTerminal() bool { +// IsTerminal returns true if there is an interactive terminal +func IsTerminal() bool { return term.IsTerminal(int(os.Stdin.Fd())) } @@ -72,7 +78,7 @@ func InputUserField(prompt string, secret bool) (string, error) { if format != Text { return "", errors.New(tr("user input not supported for the '%s' output format", format)) } - if !isTerminal() { + if !IsTerminal() { return "", errors.New(tr("user input not supported in non interactive mode")) } diff --git a/internal/cli/lib/search.go b/internal/cli/lib/search.go index c44ced3778b..9af3c7c1079 100644 --- a/internal/cli/lib/search.go +++ b/internal/cli/lib/search.go @@ -37,11 +37,60 @@ func initSearchCommand() *cobra.Command { var namesOnly bool var omitReleasesDetails bool searchCommand := &cobra.Command{ - Use: fmt.Sprintf("search [%s]", tr("LIBRARY_NAME")), - Short: tr("Searches for one or more libraries data."), - Long: tr("Search for one or more libraries data (case insensitive search)."), - Example: " " + os.Args[0] + " lib search audio", - Args: cobra.ArbitraryArgs, + Use: fmt.Sprintf("search [%s ...]", tr("SEARCH_TERM")), + Short: tr("Searches for one or more libraries matching a query."), + Long: tr(`Search for libraries matching zero or more search terms. + +All searches are performed in a case-insensitive fashion. Queries containing +multiple search terms will return only libraries that match all of the terms. + +Search terms that do not match the QV syntax described below are basic search +terms, and will match libraries that include the term anywhere in any of the +following fields: + - Author + - Name + - Paragraph + - Provides + - Sentence + +A special syntax, called qualifier-value (QV), indicates that a search term +should be compared against only one field of each library index entry. This +syntax uses the name of an index field (case-insensitive), an equals sign (=) +or a colon (:), and a value, e.g. 'name=ArduinoJson' or 'provides:tinyusb.h'. + +QV search terms that use a colon separator will match all libraries with the +value anywhere in the named field, and QV search terms that use an equals +separator will match only libraries with exactly the provided value in the +named field. + +QV search terms can include embedded spaces using double-quote (") characters +around the value or the entire term, e.g. 'category="Data Processing"' and +'"category=Data Processing"' are equivalent. A QV term can include a literal +double-quote character by preceding it with a backslash (\) character. + +NOTE: QV search terms using double-quote or backslash characters that are +passed as command-line arguments may require quoting or escaping to prevent +the shell from interpreting those characters. + +In addition to the fields listed above, QV terms can use these qualifiers: + - Architectures + - Category + - Dependencies + - License + - Maintainer + - Types + - Version + - Website + `), + Example: " " + os.Args[0] + " lib search audio # " + tr("basic search for \"audio\"") + "\n" + + " " + os.Args[0] + " lib search name:buzzer # " + tr("libraries with \"buzzer\" in the Name field") + "\n" + + " " + os.Args[0] + " lib search name=pcf8523 # " + tr("libraries with a Name exactly matching \"pcf8523\"") + "\n" + + " " + os.Args[0] + " lib search \"author:\\\"Daniel Garcia\\\"\" # " + tr("libraries authored by Daniel Garcia") + "\n" + + " " + os.Args[0] + " lib search author=Adafruit name:gfx # " + tr("libraries authored only by Adafruit with \"gfx\" in their Name") + "\n" + + " " + os.Args[0] + " lib search esp32 display maintainer=espressif # " + tr("basic search for \"esp32\" and \"display\" limited to official Maintainer") + "\n" + + " " + os.Args[0] + " lib search dependencies:IRremote # " + tr("libraries that depend on at least \"IRremote\"") + "\n" + + " " + os.Args[0] + " lib search dependencies=IRremote # " + tr("libraries that depend only on \"IRremote\"") + "\n", + Args: cobra.ArbitraryArgs, Run: func(cmd *cobra.Command, args []string) { runSearchCommand(args, namesOnly, omitReleasesDetails) }, diff --git a/internal/cli/monitor/monitor.go b/internal/cli/monitor/monitor.go index b15cd5bb436..0d203c5aed4 100644 --- a/internal/cli/monitor/monitor.go +++ b/internal/cli/monitor/monitor.go @@ -27,6 +27,7 @@ import ( "time" "github.com/arduino/arduino-cli/commands/monitor" + sk "github.com/arduino/arduino-cli/commands/sketch" "github.com/arduino/arduino-cli/configuration" "github.com/arduino/arduino-cli/i18n" "github.com/arduino/arduino-cli/internal/cli/arguments" @@ -45,13 +46,14 @@ var tr = i18n.Tr // NewCommand created a new `monitor` command func NewCommand() *cobra.Command { var ( - raw bool - portArgs arguments.Port - describe bool - configs []string - quiet bool - timestamp bool - fqbn arguments.Fqbn + portArgs arguments.Port + fqbnArg arguments.Fqbn + profileArg arguments.Profile + raw bool + describe bool + configs []string + quiet bool + timestamp bool ) monitorCommand := &cobra.Command{ Use: "monitor", @@ -61,38 +63,87 @@ func NewCommand() *cobra.Command { " " + os.Args[0] + " monitor -p /dev/ttyACM0\n" + " " + os.Args[0] + " monitor -p /dev/ttyACM0 --describe", Run: func(cmd *cobra.Command, args []string) { - runMonitorCmd(&portArgs, &fqbn, configs, describe, timestamp, quiet, raw) + sketchPath := "" + if len(args) > 0 { + sketchPath = args[0] + } + runMonitorCmd(&portArgs, &fqbnArg, &profileArg, sketchPath, configs, describe, timestamp, quiet, raw) }, } portArgs.AddToCommand(monitorCommand) + profileArg.AddToCommand(monitorCommand) monitorCommand.Flags().BoolVar(&raw, "raw", false, tr("Set terminal in raw mode (unbuffered).")) monitorCommand.Flags().BoolVar(&describe, "describe", false, tr("Show all the settings of the communication port.")) monitorCommand.Flags().StringSliceVarP(&configs, "config", "c", []string{}, tr("Configure communication port settings. The format is <ID>=<value>[,<ID>=<value>]...")) monitorCommand.Flags().BoolVarP(&quiet, "quiet", "q", false, tr("Run in silent mode, show only monitor input and output.")) monitorCommand.Flags().BoolVar(×tamp, "timestamp", false, tr("Timestamp each incoming line.")) - fqbn.AddToCommand(monitorCommand) - monitorCommand.MarkFlagRequired("port") + fqbnArg.AddToCommand(monitorCommand) return monitorCommand } -func runMonitorCmd(portArgs *arguments.Port, fqbn *arguments.Fqbn, configs []string, describe, timestamp, quiet, raw bool) { - instance := instance.CreateAndInit() +func runMonitorCmd( + portArgs *arguments.Port, fqbnArg *arguments.Fqbn, profileArg *arguments.Profile, sketchPathArg string, + configs []string, describe, timestamp, quiet, raw bool, +) { logrus.Info("Executing `arduino-cli monitor`") if !configuration.HasConsole { quiet = true } - // TODO: Should use sketch default_port/protocol? - portAddress, portProtocol, err := portArgs.GetPortAddressAndProtocol(instance, "", "") + var ( + inst *rpc.Instance + fqbn string + defaultPort, defaultProtocol string + ) + + if !portArgs.IsPortFlagSet() { + sketchPath := arguments.InitSketchPath(sketchPathArg) + sketch, err := sk.LoadSketch(context.Background(), &rpc.LoadSketchRequest{SketchPath: sketchPath.String()}) + if err != nil { + feedback.Fatal( + tr("Error getting default port from `sketch.yaml`. Check if you're in the correct sketch folder or provide the --port flag: %s", err), + feedback.ErrGeneric, + ) + } + defaultPort = sketch.GetDefaultPort() + defaultProtocol = sketch.GetDefaultProtocol() + + var profile *rpc.Profile + if profileArg.Get() == "" { + inst, profile = instance.CreateAndInitWithProfile(sketch.GetDefaultProfile().GetName(), sketchPath) + } else { + inst, profile = instance.CreateAndInitWithProfile(profileArg.Get(), sketchPath) + } + + // Priority on how to retrieve the fqbn + // 1. from flag + // 2. from profile + // 3. from default_fqbn specified in the sketch.yaml + // 4. try to detect from the port + switch { + case fqbnArg.String() != "": + fqbn = fqbnArg.String() + case profile.GetFqbn() != "": + fqbn = profile.GetFqbn() + case sketch.GetDefaultFqbn() != "": + fqbn = sketch.GetDefaultFqbn() + default: + fqbn, _ = portArgs.DetectFQBN(inst) + } + } else { + inst = instance.CreateAndInit() + fqbn = fqbnArg.String() + } + portAddress, portProtocol, err := portArgs.GetPortAddressAndProtocol(inst, defaultPort, defaultProtocol) if err != nil { feedback.FatalError(err, feedback.ErrGeneric) } enumerateResp, err := monitor.EnumerateMonitorPortSettings(context.Background(), &rpc.EnumerateMonitorPortSettingsRequest{ - Instance: instance, + Instance: inst, PortProtocol: portProtocol, - Fqbn: fqbn.String(), + Fqbn: fqbn, }) if err != nil { feedback.Fatal(tr("Error getting port settings details: %s", err), feedback.ErrGeneric) @@ -144,9 +195,9 @@ func runMonitorCmd(portArgs *arguments.Port, fqbn *arguments.Fqbn, configs []str } } portProxy, _, err := monitor.Monitor(context.Background(), &rpc.MonitorRequest{ - Instance: instance, + Instance: inst, Port: &rpc.Port{Address: portAddress, Protocol: portProtocol}, - Fqbn: fqbn.String(), + Fqbn: fqbn, PortConfiguration: configuration, }) if err != nil { @@ -169,10 +220,12 @@ func runMonitorCmd(portArgs *arguments.Port, fqbn *arguments.Fqbn, configs []str ctx, cancel := cleanup.InterruptableContext(context.Background()) if raw { - feedback.SetRawModeStdin() - defer func() { - feedback.RestoreModeStdin() - }() + if feedback.IsTerminal() { + if err := feedback.SetRawModeStdin(); err != nil { + feedback.Warning(tr("Error setting raw mode: %s", err.Error())) + } + defer feedback.RestoreModeStdin() + } // In RAW mode CTRL-C is not converted into an Interrupt by // the terminal, we must intercept ASCII 3 (CTRL-C) on our own... diff --git a/internal/cli/outdated/outdated.go b/internal/cli/outdated/outdated.go index 8a56f21b36a..5b2b6ac6309 100644 --- a/internal/cli/outdated/outdated.go +++ b/internal/cli/outdated/outdated.go @@ -24,6 +24,7 @@ import ( "github.com/arduino/arduino-cli/i18n" "github.com/arduino/arduino-cli/internal/cli/core" "github.com/arduino/arduino-cli/internal/cli/feedback" + "github.com/arduino/arduino-cli/internal/cli/feedback/result" "github.com/arduino/arduino-cli/internal/cli/instance" "github.com/arduino/arduino-cli/internal/cli/lib" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" @@ -57,17 +58,26 @@ func runOutdatedCommand(cmd *cobra.Command, args []string) { // Outdated prints a list of outdated platforms and libraries func Outdated(inst *rpc.Instance) { feedback.PrintResult( - outdatedResult{core.GetList(inst, false, true), lib.GetList(inst, []string{}, false, true)}, + newOutdatedResult(core.GetList(inst, false, true), lib.GetList(inst, []string{}, false, true)), ) } // output from this command requires special formatting, let's create a dedicated // feedback.Result implementation type outdatedResult struct { - Platforms []*rpc.Platform `json:"platforms,omitempty"` + Platforms []*result.Platform `json:"platforms,omitempty"` InstalledLibs []*rpc.InstalledLibrary `json:"libraries,omitempty"` } +func newOutdatedResult(inPlatforms []*rpc.PlatformSummary, inLibraries []*rpc.InstalledLibrary) *outdatedResult { + res := &outdatedResult{} + for _, platformSummary := range inPlatforms { + res.Platforms = append(res.Platforms, result.NewPlatformResult(platformSummary)) + } + res.InstalledLibs = inLibraries + return res +} + func (ir outdatedResult) Data() interface{} { return &ir } @@ -93,11 +103,14 @@ func (ir outdatedResult) String() string { // Based on internal/cli/core/list.go for _, p := range ir.Platforms { - name := p.Name + 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.Installed, p.Latest, "", "") + t.AddRow(p.Id, name, p.InstalledVersion, p.LatestVersion, "", "") } // Based on internal/cli/lib/list.go diff --git a/internal/integrationtest/arduino-cli.go b/internal/integrationtest/arduino-cli.go index 45620ee4c71..17003c01723 100644 --- a/internal/integrationtest/arduino-cli.go +++ b/internal/integrationtest/arduino-cli.go @@ -23,6 +23,7 @@ import ( "fmt" "io" "os" + "runtime" "strings" "sync" "testing" @@ -201,8 +202,101 @@ func (cli *ArduinoCLI) convertEnvForExecutils(env map[string]string) []string { return envVars } +// InstallMockedSerialDiscovery will replace the already installed serial-discovery +// with a mocked one. +func (cli *ArduinoCLI) InstallMockedSerialDiscovery(t *testing.T) { + fmt.Println(color.BlueString("<<< Install mocked serial-discovery")) + + // Build mocked serial-discovery + mockDir := FindRepositoryRootPath(t).Join("internal", "mock_serial_discovery") + gobuild, err := executils.NewProcess(nil, "go", "build") + require.NoError(t, err) + gobuild.SetDirFromPath(mockDir) + require.NoError(t, gobuild.Run(), "Building mocked serial-discovery") + ext := "" + if runtime.GOOS == "windows" { + ext = ".exe" + } + mockBin := mockDir.Join("mock_serial_discovery" + ext) + require.True(t, mockBin.Exist()) + fmt.Println(color.HiBlackString(" Build of mocked serial-discovery succeeded.")) + + // Install it replacing the current serial discovery + dataDir := cli.DataDir() + require.NotNil(t, dataDir, "data dir missing") + serialDiscoveries, err := dataDir.Join("packages", "builtin", "tools", "serial-discovery").ReadDirRecursiveFiltered( + nil, paths.AndFilter( + paths.FilterNames("serial-discovery"+ext), + paths.FilterOutDirectories(), + ), + ) + require.NoError(t, err, "scanning data dir for serial-discoveries") + require.NotEmpty(t, serialDiscoveries, "no serial-discoveries found in data dir") + for _, serialDiscovery := range serialDiscoveries { + require.NoError(t, mockBin.CopyTo(serialDiscovery), "installing mocked serial discovery to %s", serialDiscovery) + fmt.Println(color.HiBlackString(" Discovery installed in " + serialDiscovery.String())) + } +} + +// InstallMockedSerialMonitor will replace the already installed serial-monitor +// with a mocked one. +func (cli *ArduinoCLI) InstallMockedSerialMonitor(t *testing.T) { + fmt.Println(color.BlueString("<<< Install mocked serial-monitor")) + + // Build mocked serial-monitor + mockDir := FindRepositoryRootPath(t).Join("internal", "mock_serial_monitor") + gobuild, err := executils.NewProcess(nil, "go", "build") + require.NoError(t, err) + gobuild.SetDirFromPath(mockDir) + require.NoError(t, gobuild.Run(), "Building mocked serial-monitor") + ext := "" + if runtime.GOOS == "windows" { + ext = ".exe" + } + mockBin := mockDir.Join("mock_serial_monitor" + ext) + require.True(t, mockBin.Exist()) + fmt.Println(color.HiBlackString(" Build of mocked serial-monitor succeeded.")) + + // Install it replacing the current serial monitor + dataDir := cli.DataDir() + require.NotNil(t, dataDir, "data dir missing") + serialMonitors, err := dataDir.Join("packages", "builtin", "tools", "serial-monitor").ReadDirRecursiveFiltered( + nil, paths.AndFilter( + paths.FilterNames("serial-monitor"+ext), + paths.FilterOutDirectories(), + ), + ) + require.NoError(t, err, "scanning data dir for serial-monitor") + require.NotEmpty(t, serialMonitors, "no serial-monitor found in data dir") + for _, serialMonitor := range serialMonitors { + require.NoError(t, mockBin.CopyTo(serialMonitor), "installing mocked serial monitor to %s", serialMonitor) + fmt.Println(color.HiBlackString(" Monitor installed in " + serialMonitor.String())) + } +} + // RunWithCustomEnv executes the given arduino-cli command with the given custom env and returns the output. func (cli *ArduinoCLI) RunWithCustomEnv(env map[string]string, args ...string) ([]byte, []byte, error) { + var stdoutBuf, stderrBuf bytes.Buffer + err := cli.run(&stdoutBuf, &stderrBuf, nil, env, args...) + + errBuf := stderrBuf.Bytes() + cli.t.NotContains(string(errBuf), "panic: runtime error:", "arduino-cli panicked") + + return stdoutBuf.Bytes(), errBuf, err +} + +// RunWithCustomInput executes the given arduino-cli command pushing the given input stream and returns the output. +func (cli *ArduinoCLI) RunWithCustomInput(in io.Reader, args ...string) ([]byte, []byte, error) { + var stdoutBuf, stderrBuf bytes.Buffer + err := cli.run(&stdoutBuf, &stderrBuf, in, cli.cliEnvVars, args...) + + errBuf := stderrBuf.Bytes() + cli.t.NotContains(string(errBuf), "panic: runtime error:", "arduino-cli panicked") + + return stdoutBuf.Bytes(), errBuf, err +} + +func (cli *ArduinoCLI) run(stdoutBuff, stderrBuff io.Writer, stdinBuff io.Reader, env map[string]string, args ...string) error { if cli.cliConfigPath != nil { args = append([]string{"--config-file", cli.cliConfigPath.String()}, args...) } @@ -213,35 +307,44 @@ func (cli *ArduinoCLI) RunWithCustomEnv(env map[string]string, args ...string) ( cli.t.NoError(err) stderr, err := cliProc.StderrPipe() cli.t.NoError(err) - _, err = cliProc.StdinPipe() + stdin, err := cliProc.StdinPipe() cli.t.NoError(err) cliProc.SetDir(cli.WorkingDir().String()) cli.t.NoError(cliProc.Start()) - var stdoutBuf, stderrBuf bytes.Buffer var wg sync.WaitGroup wg.Add(2) go func() { defer wg.Done() - if _, err := io.Copy(&stdoutBuf, io.TeeReader(stdout, os.Stdout)); err != nil { + if stdoutBuff == nil { + stdoutBuff = io.Discard + } + if _, err := io.Copy(stdoutBuff, io.TeeReader(stdout, os.Stdout)); err != nil { fmt.Println(color.HiBlackString("<<< stdout copy error:"), err) } }() go func() { defer wg.Done() - if _, err := io.Copy(&stderrBuf, io.TeeReader(stderr, os.Stderr)); err != nil { + if stderrBuff == nil { + stderrBuff = io.Discard + } + if _, err := io.Copy(stderrBuff, io.TeeReader(stderr, os.Stderr)); err != nil { fmt.Println(color.HiBlackString("<<< stderr copy error:"), err) } }() + if stdinBuff != nil { + go func() { + if _, err := io.Copy(stdin, stdinBuff); err != nil { + fmt.Println(color.HiBlackString("<<< stdin copy error:"), err) + } + }() + } wg.Wait() cliErr := cliProc.Wait() fmt.Println(color.HiBlackString("<<< Run completed (err = %v)", cliErr)) - errBuf := stderrBuf.Bytes() - cli.t.NotContains(string(errBuf), "panic: runtime error:", "arduino-cli panicked") - - return stdoutBuf.Bytes(), errBuf, cliErr + return cliErr } // StartDaemon starts the Arduino CLI daemon. It returns the address of the daemon. @@ -473,10 +576,14 @@ func (inst *ArduinoCLIInstance) PlatformUpgrade(ctx context.Context, packager, a return installCl, err } -// PlatformList calls the "PlatformList" gRPC method. -func (inst *ArduinoCLIInstance) PlatformList(ctx context.Context) (*commands.PlatformListResponse, error) { - req := &commands.PlatformListRequest{Instance: inst.instance} - logCallf(">>> PlatformList(%+v)\n", req) - resp, err := inst.cli.daemonClient.PlatformList(ctx, req) +// PlatformSearch calls the "PlatformSearch" gRPC method. +func (inst *ArduinoCLIInstance) PlatformSearch(ctx context.Context, args string, all bool) (*commands.PlatformSearchResponse, error) { + req := &commands.PlatformSearchRequest{ + Instance: inst.instance, + SearchArgs: args, + AllVersions: all, + } + logCallf(">>> PlatformSearch(%+v)\n", req) + resp, err := inst.cli.daemonClient.PlatformSearch(ctx, req) return resp, err } diff --git a/internal/integrationtest/board/board_test.go b/internal/integrationtest/board/board_test.go index a74434c5d97..70c53de9039 100644 --- a/internal/integrationtest/board/board_test.go +++ b/internal/integrationtest/board/board_test.go @@ -91,6 +91,44 @@ func TestBoardList(t *testing.T) { MustBeEmpty() } +func TestBoardListMock(t *testing.T) { + env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t) + defer env.CleanUp() + + _, _, err := cli.Run("core", "update-index") + require.NoError(t, err) + + cli.InstallMockedSerialDiscovery(t) + + stdout, _, err := cli.Run("board", "list", "--format", "json") + require.NoError(t, err) + + // check is a valid json and contains a list of ports + requirejson.Contains(t, stdout, `[ + { + "matching_boards": [ + { + "name": "Arduino Yún", + "fqbn": "arduino:avr:yun" + } + ], + "port": { + "address": "/dev/ttyCIAO", + "label": "Mocked Serial port", + "protocol": "serial", + "protocol_label": "Serial", + "properties": { + "pid": "0x0041", + "serial": "123456", + "vid": "0x2341" + }, + "hardware_id": "123456" + } + } + ] + `) +} + func TestBoardListWithFqbnFilter(t *testing.T) { if os.Getenv("CI") != "" { t.Skip("VMs have no serial ports") diff --git a/internal/integrationtest/board/hardware_loading_test.go b/internal/integrationtest/board/hardware_loading_test.go index 54bf8cffa14..9b2a6d44e10 100644 --- a/internal/integrationtest/board/hardware_loading_test.go +++ b/internal/integrationtest/board/hardware_loading_test.go @@ -50,18 +50,22 @@ func TestHardwareLoading(t *testing.T) { jsonOut.MustContain(`[ { "id": "arduino:avr", - "installed": "1.8.6", - "name": "Arduino AVR Boards", - "boards": [ - { - "name": "Arduino Uno", - "fqbn": "arduino:avr:uno" - }, - { - "name": "Arduino Yún", - "fqbn": "arduino:avr:yun" + "installed_version": "1.8.6", + "releases": { + "1.8.6": { + "name": "Arduino AVR Boards", + "boards": [ + { + "name": "Arduino Uno", + "fqbn": "arduino:avr:uno" + }, + { + "name": "Arduino Yún", + "fqbn": "arduino:avr:yun" + } + ] } - ] + } } ]`) } @@ -90,7 +94,7 @@ func TestHardwareLoading(t *testing.T) { "id": "avrispmkii", "name": "AVRISP mkII" } - ] + ] }`) } @@ -159,33 +163,40 @@ func TestHardwareLoading(t *testing.T) { jsonOut.MustContain(`[ { "id": "arduino:avr", - "installed": "1.8.6", - "name": "Arduino AVR Boards", - "boards": [ - { - "name": "Arduino Uno", - "fqbn": "arduino:avr:uno" - }, - { - "name": "Arduino Yún", - "fqbn": "arduino:avr:yun" + "installed_version": "1.8.6", + "releases": { + "1.8.6": { + "name": "Arduino AVR Boards", + "boards": [ + { + "name": "Arduino Uno", + "fqbn": "arduino:avr:uno" + }, + { + "name": "Arduino Yún", + "fqbn": "arduino:avr:yun" + } + ] } - ] + } } ]`) jsonOut.MustContain(`[ { "id": "my_avr_platform:avr", - "installed": "9.9.9", - "name": "My AVR Boards", - "boards": [ - { - "name": "Arduino Yún", - "fqbn": "my_avr_platform:avr:custom_yun" + "installed_version": "9.9.9", + "releases": { + "9.9.9": { + "name": "My AVR Boards", + "boards": [ + { + "name": "Arduino Yún", + "fqbn": "my_avr_platform:avr:custom_yun" + } + ] } - ], - "manually_installed": true, - "missing_metadata": true + }, + "manually_installed": true } ]`) @@ -196,7 +207,10 @@ func TestHardwareLoading(t *testing.T) { { "id": "my_symlinked_avr_platform:avr", "manually_installed": true, - "missing_metadata": true + "releases": { + "9.9.9": { + } + } } ]`) } @@ -226,7 +240,7 @@ func TestHardwareLoading(t *testing.T) { "id": "avrispmkii", "name": "AVRISP mkII" } - ] + ] }`) } diff --git a/internal/integrationtest/core/core_test.go b/internal/integrationtest/core/core_test.go index 89e8ecc2a87..c5762d3beb6 100644 --- a/internal/integrationtest/core/core_test.go +++ b/internal/integrationtest/core/core_test.go @@ -48,7 +48,17 @@ func TestCorrectHandlingOfPlatformVersionProperty(t *testing.T) { // Trigger problematic call out, _, err := cli.Run("core", "list", "--format", "json") require.NoError(t, err) - requirejson.Contains(t, out, `[{"id":"DxCore-dev:megaavr","installed":"1.4.10","name":"DxCore"}]`) + requirejson.Contains(t, out, `[ + { + "id":"DxCore-dev:megaavr", + "installed_version":"1.4.10", + "releases": { + "1.4.10": { + "name":"DxCore" + } + } + } + ]`) } func TestCoreSearch(t *testing.T) { @@ -73,8 +83,8 @@ func TestCoreSearch(t *testing.T) { out, _, err = cli.Run("core", "search", "avr", "--format", "json") require.NoError(t, err) requirejson.NotEmpty(t, out) - // Verify that "installed" is set - requirejson.Contains(t, out, `[{installed: "1.8.6"}]`) + // Verify that "installed_version" is set + requirejson.Contains(t, out, `[{installed_version: "1.8.6"}]`) // additional URL out, _, err = cli.Run("core", "search", "test_core", "--format", "json", "--additional-urls="+url.String()) @@ -84,10 +94,10 @@ func TestCoreSearch(t *testing.T) { // show all versions out, _, err = cli.Run("core", "search", "test_core", "--all", "--format", "json", "--additional-urls="+url.String()) require.NoError(t, err) - requirejson.Len(t, out, 3) + requirejson.Query(t, out, `.[].releases | length`, "3") checkPlatformIsInJSONOutput := func(stdout []byte, id, version string) { - jqquery := fmt.Sprintf(`[{id:"%s", latest:"%s"}]`, id, version) + jqquery := fmt.Sprintf(`[{id:"%s", releases:{"%s":{}}}]`, id, version) requirejson.Contains(t, out, jqquery, "platform %s@%s is missing from the output", id, version) } @@ -171,7 +181,7 @@ 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") require.NoError(t, err) - requirejson.Contains(t, stdout, `[ { "name":"test_core" } ]`) + requirejson.Contains(t, stdout, `[{"id": "test:x86", "releases": { "2.0.0": {"name":"test_core"}}}]`) requirejson.Query(t, stdout, "length", fmt.Sprint(numPlatforms)) // list all with additional urls, check the test core is there @@ -188,8 +198,10 @@ 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, `[ { "name":"test_core" } ]`) - requirejson.Query(t, stdout, "length", fmt.Sprint(numPlatforms)) + requirejson.Contains(t, stdout, `[{"id": "test:x86", "releases": { "3.0.0": {"name":"test_core"}}}]`) + // A platform could contain multiple releases, we get the length of how many releases are present for each platform + // and we sum them to see if the expected numers matches. + requirejson.Query(t, stdout, `[.[].releases | length] | add`, fmt.Sprint(numPlatforms)) } func TestCoreUpdateIndexUrlNotFound(t *testing.T) { @@ -303,7 +315,7 @@ func TestCoreInstall(t *testing.T) { require.NoError(t, err) stdout, _, err := cli.Run("core", "list", "--format", "json") require.NoError(t, err) - requirejson.Query(t, stdout, `.[] | select(.id == "arduino:avr") | .installed`, `"1.6.16"`) + requirejson.Query(t, stdout, `.[] | select(.id == "arduino:avr") | .installed_version`, `"1.6.16"`) // Replace it with the same with --no-overwrite (should NOT fail) _, _, err = cli.Run("core", "install", "arduino:avr@1.6.16", "--no-overwrite") @@ -318,22 +330,22 @@ func TestCoreInstall(t *testing.T) { require.NoError(t, err) stdout, _, err = cli.Run("core", "list", "--format", "json") require.NoError(t, err) - requirejson.Query(t, stdout, `.[] | select(.id == "arduino:avr") | .installed`, `"1.6.17"`) + requirejson.Query(t, stdout, `.[] | select(.id == "arduino:avr") | .installed_version`, `"1.6.17"`) // Confirm core is listed as "updatable" stdout, _, err = cli.Run("core", "list", "--updatable", "--format", "json") require.NoError(t, err) jsonout := requirejson.Parse(t, stdout) q := jsonout.Query(`.[] | select(.id == "arduino:avr")`) - q.Query(".installed").MustEqual(`"1.6.17"`) - latest := q.Query(".latest") + q.Query(".installed_version").MustEqual(`"1.6.17"`) + latest := q.Query(".latest_version") // Upgrade the core to latest version _, _, err = cli.Run("core", "upgrade", "arduino:avr") require.NoError(t, err) stdout, _, err = cli.Run("core", "list", "--format", "json") require.NoError(t, err) - requirejson.Query(t, stdout, `.[] | select(.id == "arduino:avr") | .installed`, latest.String()) + requirejson.Query(t, stdout, `.[] | select(.id == "arduino:avr") | .installed_version`, latest.String()) // double check the core isn't updatable anymore stdout, _, err = cli.Run("core", "list", "--updatable", "--format", "json") @@ -483,10 +495,14 @@ func TestCoreListAllManuallyInstalledCore(t *testing.T) { requirejson.Contains(t, stdout, `[ { "id": "arduino-beta-development:avr", - "latest": "1.8.3", - "name": "Arduino AVR Boards" + "latest_version": "1.8.3", + "releases": { + "1.8.3": { + "name": "Arduino AVR Boards" + } } - ]`) + } + ]`) } func TestCoreListUpdatableAllFlags(t *testing.T) { @@ -519,10 +535,14 @@ func TestCoreListUpdatableAllFlags(t *testing.T) { requirejson.Contains(t, stdout, `[ { "id": "arduino-beta-development:avr", - "latest": "1.8.3", - "name": "Arduino AVR Boards" + "latest_version": "1.8.3", + "releases": { + "1.8.3": { + "name": "Arduino AVR Boards" + } } - ]`) + } + ]`) } func TestCoreUpgradeRemovesUnusedTools(t *testing.T) { @@ -592,7 +612,11 @@ func TestCoreListWithInstalledJson(t *testing.T) { requirejson.Contains(t, stdout, `[ { "id": "adafruit:avr", - "name": "Adafruit AVR Boards" + "releases": { + "1.4.13": { + "name": "Adafruit AVR Boards" + } + } } ]`) @@ -614,7 +638,11 @@ func TestCoreListWithInstalledJson(t *testing.T) { requirejson.Contains(t, stdout, `[ { "id": "adafruit:avr", - "name": "Adafruit Boards" + "releases": { + "1.4.13": { + "name": "Adafruit Boards" + } + } } ]`) } @@ -699,20 +727,20 @@ func TestCoreSearchSortedResults(t *testing.T) { // verify that results are already sorted correctly sortedDeprecated := requirejson.Parse(t, stdout).Query( - "[ .[] | select(.deprecated == true) | .name |=ascii_downcase | .name ] | sort").String() + "[ .[] | select(.deprecated == true) | {name: .releases[.latest_version].name} | .name |=ascii_downcase | .name] | sort").String() notSortedDeprecated := requirejson.Parse(t, stdout).Query( - "[.[] | select(.deprecated == true) | .name |=ascii_downcase | .name]").String() + "[ .[] | select(.deprecated == true) | {name: .releases[.latest_version].name} | .name |=ascii_downcase | .name]").String() require.Equal(t, sortedDeprecated, notSortedDeprecated) sortedNotDeprecated := requirejson.Parse(t, stdout).Query( - "[ .[] | select(.deprecated != true) | .name |=ascii_downcase | .name ] | sort").String() + "[ .[] | select(.deprecated != true) | {name: .releases[.latest_version].name} | .name |=ascii_downcase | .name] | sort").String() notSortedNotDeprecated := requirejson.Parse(t, stdout).Query( - "[.[] | select(.deprecated != true) | .name |=ascii_downcase | .name]").String() + "[ .[] | select(.deprecated != true) | {name: .releases[.latest_version].name} | .name |=ascii_downcase | .name]").String() require.Equal(t, sortedNotDeprecated, notSortedNotDeprecated) // verify that deprecated platforms are the last ones platform := requirejson.Parse(t, stdout).Query( - "[.[] | .name |=ascii_downcase | .name]").String() + "[ .[] | {name: .releases[.latest_version].name} | .name |=ascii_downcase | .name]").String() require.Equal(t, platform, strings.TrimRight(notSortedNotDeprecated, "]")+","+strings.TrimLeft(notSortedDeprecated, "[")) } @@ -771,20 +799,20 @@ func TestCoreListSortedResults(t *testing.T) { // verify that results are already sorted correctly sortedDeprecated := requirejson.Parse(t, stdout).Query( - "[ .[] | select(.deprecated == true) | .name |=ascii_downcase | .name ] | sort").String() + "[ .[] | select(.deprecated == true) | {name: .releases[.latest_version].name} | .name |=ascii_downcase | .name] | sort").String() notSortedDeprecated := requirejson.Parse(t, stdout).Query( - "[.[] | select(.deprecated == true) | .name |=ascii_downcase | .name]").String() + "[ .[] | select(.deprecated == true) | {name: .releases[.latest_version].name} | .name |=ascii_downcase | .name]").String() require.Equal(t, sortedDeprecated, notSortedDeprecated) sortedNotDeprecated := requirejson.Parse(t, stdout).Query( - "[ .[] | select(.deprecated != true) | .name |=ascii_downcase | .name ] | sort").String() + "[ .[] | select(.deprecated != true) | {name: .releases[.latest_version].name} | .name |=ascii_downcase | .name] | sort").String() notSortedNotDeprecated := requirejson.Parse(t, stdout).Query( - "[.[] | select(.deprecated != true) | .name |=ascii_downcase | .name]").String() + "[ .[] | select(.deprecated != true) | {name: .releases[.latest_version].name} | .name |=ascii_downcase | .name]").String() require.Equal(t, sortedNotDeprecated, notSortedNotDeprecated) // verify that deprecated platforms are the last ones platform := requirejson.Parse(t, stdout).Query( - "[.[] | .name |=ascii_downcase | .name]").String() + "[ .[] | {name: .releases[.latest_version].name} | .name |=ascii_downcase | .name]").String() require.Equal(t, platform, strings.TrimRight(notSortedNotDeprecated, "]")+","+strings.TrimLeft(notSortedDeprecated, "[")) } @@ -842,8 +870,8 @@ func TestCoreListPlatformWithoutPlatformTxt(t *testing.T) { stdout, _, err = cli.Run("core", "list", "--format", "json") require.NoError(t, err) requirejson.Len(t, stdout, 1) - requirejson.Query(t, stdout, ".[] | .id", "\"some-packager:some-arch\"") - requirejson.Query(t, stdout, ".[] | .name", "\"some-packager-some-arch\"") + requirejson.Query(t, stdout, ".[] | .id", `"some-packager:some-arch"`) + requirejson.Query(t, stdout, ".[] | .releases[.installed_version].name", `"some-packager-some-arch"`) } func TestCoreDownloadMultiplePlatforms(t *testing.T) { @@ -903,25 +931,25 @@ func TestCoreWithMissingCustomBoardOptionsIsLoaded(t *testing.T) { require.NoError(t, err) requirejson.Len(t, stdout, 1) // Verifies platform is loaded except excluding board with missing options - requirejson.Contains(t, stdout, `[ - { - "id": "arduino-beta-dev:platform_with_missing_custom_board_options" - } - ]`) - requirejson.Query(t, stdout, ".[] | select(.id == \"arduino-beta-dev:platform_with_missing_custom_board_options\") | .boards | length", "2") + requirejson.Contains(t, stdout, `[{"id": "arduino-beta-dev:platform_with_missing_custom_board_options"}]`) + requirejson.Query(t, stdout, ".[] | select(.id == \"arduino-beta-dev:platform_with_missing_custom_board_options\") | .releases[.installed_version].boards | length", "2") // Verify board with malformed options is not loaded // while other board is loaded requirejson.Contains(t, stdout, `[ { "id": "arduino-beta-dev:platform_with_missing_custom_board_options", - "boards": [ - { - "fqbn": "arduino-beta-dev:platform_with_missing_custom_board_options:nessuno" - }, - { - "fqbn": "arduino-beta-dev:platform_with_missing_custom_board_options:altra" + "releases": { + "4.2.0": { + "boards": [ + { + "fqbn": "arduino-beta-dev:platform_with_missing_custom_board_options:nessuno" + }, + { + "fqbn": "arduino-beta-dev:platform_with_missing_custom_board_options:altra" + } + ] } - ] + } } ]`) } @@ -940,10 +968,10 @@ func TestCoreListOutdatedCore(t *testing.T) { stdout, _, err := cli.Run("core", "list", "--format", "json") require.NoError(t, err) requirejson.Len(t, stdout, 1) - requirejson.Query(t, stdout, ".[0] | .installed", "\"1.8.6\"") - installedVersion, err := semver.Parse(strings.Trim(requirejson.Parse(t, stdout).Query(".[0] | .installed").String(), "\"")) + requirejson.Query(t, stdout, ".[0] | .installed_version", "\"1.8.6\"") + installedVersion, err := semver.Parse(strings.Trim(requirejson.Parse(t, stdout).Query(".[0] | .installed_version").String(), "\"")) require.NoError(t, err) - latestVersion, err := semver.Parse(strings.Trim(requirejson.Parse(t, stdout).Query(".[0] | .latest").String(), "\"")) + latestVersion, err := semver.Parse(strings.Trim(requirejson.Parse(t, stdout).Query(".[0] | .latest_version").String(), "\"")) require.NoError(t, err) // Installed version must be older than latest require.True(t, installedVersion.LessThan(latestVersion)) diff --git a/internal/integrationtest/daemon/daemon_test.go b/internal/integrationtest/daemon/daemon_test.go index 7e49db88111..6c02b5f3b22 100644 --- a/internal/integrationtest/daemon/daemon_test.go +++ b/internal/integrationtest/daemon/daemon_test.go @@ -104,7 +104,7 @@ func TestDaemonAutoUpdateIndexOnFirstInit(t *testing.T) { fmt.Printf("INIT> %v\n", ir.GetMessage()) })) - _, err := grpcInst.PlatformList(context.Background()) + _, err := grpcInst.PlatformSearch(context.Background(), "", true) require.NoError(t, err) require.FileExists(t, cli.DataDir().Join("package_index.json").String()) @@ -477,8 +477,8 @@ func TestDaemonCoreUpgradePlatform(t *testing.T) { platform, upgradeError := analyzePlatformUpgradeClient(plUpgrade) require.NoError(t, upgradeError) require.NotNil(t, platform) - require.True(t, platform.Indexed) // the esp866 is present in the additional-urls - require.False(t, platform.MissingMetadata) // install.json is present + require.True(t, platform.Metadata.Indexed) // the esp866 is present in the additional-urls + require.False(t, platform.Release.MissingMetadata) // install.json is present }) t.Run("and install.json is missing", func(t *testing.T) { env, cli := createEnvForDaemon(t) @@ -497,9 +497,8 @@ func TestDaemonCoreUpgradePlatform(t *testing.T) { platform, upgradeError := analyzePlatformUpgradeClient(plUpgrade) require.NoError(t, upgradeError) require.NotNil(t, platform) - require.True(t, platform.Indexed) // the esp866 is not present in the additional-urls - require.False(t, platform.MissingMetadata) // install.json is present because the old version got upgraded - + require.True(t, platform.Metadata.Indexed) // the esp866 is not present in the additional-urls + require.False(t, platform.Release.MissingMetadata) // install.json is present because the old version got upgraded }) }) @@ -521,8 +520,8 @@ func TestDaemonCoreUpgradePlatform(t *testing.T) { platform, upgradeError := analyzePlatformUpgradeClient(plUpgrade) require.ErrorIs(t, upgradeError, (&arduino.PlatformAlreadyAtTheLatestVersionError{Platform: "esp8266:esp8266"}).ToRPCStatus().Err()) require.NotNil(t, platform) - require.False(t, platform.Indexed) // the esp866 is not present in the additional-urls - require.False(t, platform.MissingMetadata) // install.json is present + require.False(t, platform.Metadata.Indexed) // the esp866 is not present in the additional-urls + require.False(t, platform.Release.MissingMetadata) // install.json is present }) t.Run("missing both additional URLs and install.json", func(t *testing.T) { env, cli := createEnvForDaemon(t) @@ -546,8 +545,8 @@ func TestDaemonCoreUpgradePlatform(t *testing.T) { platform, upgradeError := analyzePlatformUpgradeClient(plUpgrade) require.ErrorIs(t, upgradeError, (&arduino.PlatformAlreadyAtTheLatestVersionError{Platform: "esp8266:esp8266"}).ToRPCStatus().Err()) require.NotNil(t, platform) - require.False(t, platform.Indexed) // the esp866 is not present in the additional-urls - require.True(t, platform.MissingMetadata) // install.json is present + require.False(t, platform.Metadata.Indexed) // the esp866 is not present in the additional-urls + require.True(t, platform.Release.MissingMetadata) // install.json is present }) }) } diff --git a/internal/integrationtest/lib/lib_test.go b/internal/integrationtest/lib/lib_test.go index f064f32e741..b00948a0c4c 100644 --- a/internal/integrationtest/lib/lib_test.go +++ b/internal/integrationtest/lib/lib_test.go @@ -788,6 +788,29 @@ func TestSearch(t *testing.T) { runSearch("json", []string{"ArduinoJson", "Arduino_JSON"}) } +func TestQualifiedSearch(t *testing.T) { + env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t) + defer env.CleanUp() + + runSearch := func(args string, expectedLibs []string) { + stdout, _, err := cli.Run("lib", "search", "--names", "--format", "json", args) + require.NoError(t, err) + libraries := requirejson.Parse(t, stdout).Query("[ .libraries | .[] | .name ]").String() + for _, l := range expectedLibs { + require.Contains(t, libraries, l) + } + } + runSearch("name:MKRIoTCarrier", []string{"Arduino_MKRIoTCarrier"}) + runSearch("name=Arduino_MKRIoTCarrier", []string{"Arduino_MKRIoTCarrier"}) + // Embedded space in double-quoted string + runSearch("name=\"dht sensor library\"", []string{"DHT sensor library"}) + // No closing double-quote + runSearch("name=\"dht sensor library", []string{"DHT sensor library"}) + runSearch("name:\"sensor dht\"", []string{}) + // Literal double-quote + runSearch("sentence:\\\"", []string{"RTCtime"}) +} + func TestSearchParagraph(t *testing.T) { env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t) defer env.CleanUp() diff --git a/internal/integrationtest/monitor/monitor_test.go b/internal/integrationtest/monitor/monitor_test.go new file mode 100644 index 00000000000..0f5593cb9aa --- /dev/null +++ b/internal/integrationtest/monitor/monitor_test.go @@ -0,0 +1,90 @@ +// This file is part of arduino-cli. +// +// Copyright 2023 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to +// modify or otherwise use the software for commercial activities involving the +// Arduino software without disclosing the source code of your own applications. +// To purchase a commercial license, send an email to license@arduino.cc. + +package monitor_test + +import ( + "bytes" + "io" + "testing" + + "github.com/arduino/arduino-cli/internal/integrationtest" + "github.com/stretchr/testify/require" +) + +func TestMonitorConfigFlags(t *testing.T) { + env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t) + defer env.CleanUp() + + // Install AVR platform (this is required to enable the 'serial' monitor...) + // TODO: maybe this is worth opening an issue? + _, _, err := cli.Run("core", "install", "arduino:avr@1.8.6") + require.NoError(t, err) + + // Install mocked discovery and monitor for testing + require.NoError(t, err) + cli.InstallMockedSerialDiscovery(t) + cli.InstallMockedSerialMonitor(t) + + // Test monitor command + quit := func() io.Reader { + // tells mocked monitor to exit + return bytes.NewBufferString("QUIT\n") + } + + t.Run("NoArgs", func(t *testing.T) { + stdout, _, err := cli.RunWithCustomInput(quit(), "monitor", "-p", "/dev/ttyARG", "--raw") + require.NoError(t, err) + require.Contains(t, string(stdout), "Opened port: /dev/ttyARG") + require.Contains(t, string(stdout), "Configuration baudrate = 9600") + require.Contains(t, string(stdout), "Configuration rts = on") + require.Contains(t, string(stdout), "Configuration dtr = on") + }) + + t.Run("BaudConfig", func(t *testing.T) { + stdout, _, err := cli.RunWithCustomInput(quit(), "monitor", "-p", "/dev/ttyARG", "-c", "baudrate=115200", "--raw") + require.NoError(t, err) + require.Contains(t, string(stdout), "Opened port: /dev/ttyARG") + require.Contains(t, string(stdout), "Configuration baudrate = 115200") + require.Contains(t, string(stdout), "Configuration parity = none") + require.Contains(t, string(stdout), "Configuration rts = on") + require.Contains(t, string(stdout), "Configuration dtr = on") + }) + + t.Run("BaudAndParitfyConfig", func(t *testing.T) { + stdout, _, err := cli.RunWithCustomInput(quit(), "monitor", "-p", "/dev/ttyARG", + "-c", "baudrate=115200", "-c", "parity=even", "--raw") + require.NoError(t, err) + require.Contains(t, string(stdout), "Opened port: /dev/ttyARG") + require.Contains(t, string(stdout), "Configuration baudrate = 115200") + require.Contains(t, string(stdout), "Configuration parity = even") + require.Contains(t, string(stdout), "Configuration rts = on") + require.Contains(t, string(stdout), "Configuration dtr = on") + }) + + t.Run("InvalidConfigKey", func(t *testing.T) { + _, stderr, err := cli.RunWithCustomInput(quit(), "monitor", "-p", "/dev/ttyARG", + "-c", "baud=115200", "-c", "parity=even", "--raw") + require.Error(t, err) + require.Contains(t, string(stderr), "invalid port configuration: baud=115200") + }) + + t.Run("InvalidConfigValue", func(t *testing.T) { + _, stderr, err := cli.RunWithCustomInput(quit(), "monitor", "-p", "/dev/ttyARG", + "-c", "parity=9600", "--raw") + require.Error(t, err) + require.Contains(t, string(stderr), "invalid port configuration value for parity: 9600") + }) +} diff --git a/internal/mock_serial_discovery/.gitignore b/internal/mock_serial_discovery/.gitignore new file mode 100644 index 00000000000..4eb3daf49c9 --- /dev/null +++ b/internal/mock_serial_discovery/.gitignore @@ -0,0 +1 @@ +mock_serial_discovery diff --git a/internal/mock_serial_discovery/main.go b/internal/mock_serial_discovery/main.go new file mode 100644 index 00000000000..af25b448331 --- /dev/null +++ b/internal/mock_serial_discovery/main.go @@ -0,0 +1,100 @@ +// +// This file is part arduino-cli. +// +// Copyright 2023 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to modify or +// otherwise use the software for commercial activities involving the Arduino +// software without disclosing the source code of your own applications. To purchase +// a commercial license, send an email to license@arduino.cc. +// + +package main + +import ( + "errors" + "os" + "time" + + "github.com/arduino/go-properties-orderedmap" + discovery "github.com/arduino/pluggable-discovery-protocol-handler/v2" +) + +type mockSerialDiscovery struct { + startSyncCount int + closeChan chan<- bool +} + +func main() { + dummy := &mockSerialDiscovery{} + server := discovery.NewServer(dummy) + if err := server.Run(os.Stdin, os.Stdout); err != nil { + os.Exit(1) + } +} + +// Hello does nothing here... +func (d *mockSerialDiscovery) Hello(userAgent string, protocol int) error { + return nil +} + +// Quit does nothing here... +func (d *mockSerialDiscovery) Quit() {} + +// Stop terminates the discovery loop +func (d *mockSerialDiscovery) Stop() error { + if d.closeChan != nil { + d.closeChan <- true + close(d.closeChan) + d.closeChan = nil + } + return nil +} + +// StartSync starts the goroutine that generates fake Ports. +func (d *mockSerialDiscovery) StartSync(eventCB discovery.EventCallback, errorCB discovery.ErrorCallback) error { + // Every 5 starts produce an error + d.startSyncCount++ + if d.startSyncCount%5 == 0 { + return errors.New("could not start_sync every 5 times") + } + + c := make(chan bool) + d.closeChan = c + + // Start asynchronous event emitter + go func() { + var closeChan <-chan bool = c + + // Output initial port state + eventCB("add", &discovery.Port{ + Address: "/dev/ttyCIAO", + AddressLabel: "Mocked Serial port", + Protocol: "serial", + ProtocolLabel: "Serial", + HardwareID: "123456", + Properties: properties.NewFromHashmap(map[string]string{ + "vid": "0x2341", + "pid": "0x0041", + "serial": "123456", + }), + }) + + select { + case <-closeChan: + return + case <-time.After(5 * time.Second): + errorCB("unrecoverable error, cannot send more events") + } + + <-closeChan + }() + + return nil +} diff --git a/internal/mock_serial_monitor/.gitignore b/internal/mock_serial_monitor/.gitignore new file mode 100644 index 00000000000..eae1d555aab --- /dev/null +++ b/internal/mock_serial_monitor/.gitignore @@ -0,0 +1 @@ +mock_serial_monitor diff --git a/internal/mock_serial_monitor/main.go b/internal/mock_serial_monitor/main.go new file mode 100644 index 00000000000..4dc9c4da159 --- /dev/null +++ b/internal/mock_serial_monitor/main.go @@ -0,0 +1,193 @@ +// +// This file is part of arduino-cli. +// +// Copyright 2023 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to modify or +// otherwise use the software for commercial activities involving the Arduino +// software without disclosing the source code of your own applications. To purchase +// a commercial license, send an email to license@arduino.cc. +// + +package main + +import ( + "errors" + "fmt" + "io" + "os" + "slices" + "strings" + + monitor "github.com/arduino/pluggable-monitor-protocol-handler" +) + +func main() { + monitorServer := monitor.NewServer(NewSerialMonitor()) + if err := monitorServer.Run(os.Stdin, os.Stdout); err != nil { + fmt.Fprintf(os.Stderr, "Error: %s\n", err.Error()) + os.Exit(1) + } +} + +// SerialMonitor is the implementation of the serial ports pluggable-monitor +type SerialMonitor struct { + mockedSerialPort io.ReadWriteCloser + serialSettings *monitor.PortDescriptor + openedPort bool +} + +// NewSerialMonitor will initialize and return a SerialMonitor +func NewSerialMonitor() *SerialMonitor { + return &SerialMonitor{ + serialSettings: &monitor.PortDescriptor{ + Protocol: "serial", + ConfigurationParameter: map[string]*monitor.PortParameterDescriptor{ + "baudrate": { + Label: "Baudrate", + Type: "enum", + Values: []string{ + "300", "600", "750", + "1200", "2400", "4800", "9600", + "19200", "31250", "38400", "57600", "74880", + "115200", "230400", "250000", "460800", "500000", "921600", + "1000000", "2000000"}, + Selected: "9600", + }, + "parity": { + Label: "Parity", + Type: "enum", + Values: []string{"none", "even", "odd", "mark", "space"}, + Selected: "none", + }, + "bits": { + Label: "Data bits", + Type: "enum", + Values: []string{"5", "6", "7", "8", "9"}, + Selected: "8", + }, + "stop_bits": { + Label: "Stop bits", + Type: "enum", + Values: []string{"1", "1.5", "2"}, + Selected: "1", + }, + "rts": { + Label: "RTS", + Type: "enum", + Values: []string{"on", "off"}, + Selected: "on", + }, + "dtr": { + Label: "DTR", + Type: "enum", + Values: []string{"on", "off"}, + Selected: "on", + }, + }, + }, + openedPort: false, + } +} + +// Hello is the handler for the pluggable-monitor HELLO command +func (d *SerialMonitor) Hello(userAgent string, protocol int) error { + return nil +} + +// Describe is the handler for the pluggable-monitor DESCRIBE command +func (d *SerialMonitor) Describe() (*monitor.PortDescriptor, error) { + return d.serialSettings, nil +} + +// Configure is the handler for the pluggable-monitor CONFIGURE command +func (d *SerialMonitor) Configure(parameterName string, value string) error { + parameter, ok := d.serialSettings.ConfigurationParameter[parameterName] + if !ok { + return fmt.Errorf("could not find parameter named %s", parameterName) + } + if !slices.Contains(parameter.Values, value) { + return fmt.Errorf("invalid value for parameter %s: %s", parameterName, value) + } + // Set configuration + parameter.Selected = value + + return nil +} + +// Open is the handler for the pluggable-monitor OPEN command +func (d *SerialMonitor) Open(boardPort string) (io.ReadWriter, error) { + if d.openedPort { + return nil, fmt.Errorf("port already opened: %s", boardPort) + } + d.openedPort = true + sideA, sideB := newBidirectionalPipe() + d.mockedSerialPort = sideA + go func() { + buff := make([]byte, 1024) + d.mockedSerialPort.Write([]byte("Opened port: " + boardPort + "\n")) + for parameter, descriptor := range d.serialSettings.ConfigurationParameter { + d.mockedSerialPort.Write([]byte( + fmt.Sprintf("Configuration %s = %s\n", parameter, descriptor.Selected))) + } + for { + n, err := d.mockedSerialPort.Read(buff) + if err != nil { + d.mockedSerialPort.Close() + return + } + if strings.Contains(string(buff[:n]), "QUIT") { + d.mockedSerialPort.Close() + return + } + d.mockedSerialPort.Write([]byte("Received: >")) + d.mockedSerialPort.Write(buff[:n]) + d.mockedSerialPort.Write([]byte("<\n")) + } + }() + return sideB, nil +} + +func newBidirectionalPipe() (io.ReadWriteCloser, io.ReadWriteCloser) { + in1, out1 := io.Pipe() + in2, out2 := io.Pipe() + a := &bidirectionalPipe{in: in1, out: out2} + b := &bidirectionalPipe{in: in2, out: out1} + return a, b +} + +type bidirectionalPipe struct { + in io.Reader + out io.WriteCloser +} + +func (p *bidirectionalPipe) Read(buff []byte) (int, error) { + return p.in.Read(buff) +} + +func (p *bidirectionalPipe) Write(buff []byte) (int, error) { + return p.out.Write(buff) +} + +func (p *bidirectionalPipe) Close() error { + return p.out.Close() +} + +// Close is the handler for the pluggable-monitor CLOSE command +func (d *SerialMonitor) Close() error { + if !d.openedPort { + return errors.New("port already closed") + } + d.mockedSerialPort.Close() + d.openedPort = false + return nil +} + +// Quit is the handler for the pluggable-monitor QUIT command +func (d *SerialMonitor) Quit() {} diff --git a/internal/orderedmap/orderedmap.go b/internal/orderedmap/orderedmap.go new file mode 100644 index 00000000000..0dce816863d --- /dev/null +++ b/internal/orderedmap/orderedmap.go @@ -0,0 +1,184 @@ +// This file is part of arduino-cli. +// +// Copyright 2023 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to +// modify or otherwise use the software for commercial activities involving the +// Arduino software without disclosing the source code of your own applications. +// To purchase a commercial license, send an email to license@arduino.cc. + +package orderedmap + +import ( + "bytes" + "encoding/json" + "fmt" + "slices" +) + +// Map is a map that keeps ordering insertion. +type Map[K any, V any] interface { + Get(K) V + GetOk(key K) (V, bool) + Set(K, V) + Size() int + ContainsKey(key K) bool + Keys() []K + Merge(...Map[K, V]) Map[K, V] + SortKeys(f func(x, y K) int) + SortStableKeys(f func(x, y K) int) + Values() []V + Clone() Map[K, V] + Remove(key K) + MarshalJSON() ([]byte, error) +} + +type scalars interface { + ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | + ~uint16 | ~uint32 | ~uint64 | ~uintptr | ~float32 | ~float64 | ~string +} + +// NewWithConversionFunc creates a map using the given conversion function +// to convert non-comparable key type to comparable items. +// The conversion function must be bijective. +func NewWithConversionFunc[K any, V any, C scalars](conv func(K) C) Map[K, V] { + return &mapImpl[K, V, C]{ + conv: conv, + kv: map[C]V{}, + o: []K{}, + } +} + +// New creates a map +func New[K scalars, V any]() Map[K, V] { + return &mapImpl[K, V, K]{ + conv: func(in K) K { return in }, // identity + kv: map[K]V{}, + o: []K{}, + } +} + +type mapImpl[K any, V any, C scalars] struct { + conv func(K) C + kv map[C]V + o []K +} + +// Get retrieves the value corresponding to key +func (m *mapImpl[K, V, C]) Get(key K) V { + return m.kv[m.conv(key)] +} + +// GetOk retrieves the value corresponding to key and returns a true/false indicator +// to check if the key is present in the map (true if the key is present) +func (m *mapImpl[K, V, C]) GetOk(key K) (V, bool) { + v, ok := m.kv[m.conv(key)] + return v, ok +} + +// ContainsKey returns true if the map contains the specified key +func (m *mapImpl[K, V, C]) ContainsKey(key K) bool { + _, has := m.kv[m.conv(key)] + return has +} + +// MarshalJSON marshal the map into json mantaining the order of the key +func (m *mapImpl[K, V, C]) MarshalJSON() ([]byte, error) { + if m.Size() == 0 { + return []byte("{}"), nil + } + var buf bytes.Buffer + buf.WriteByte('{') + encoder := json.NewEncoder(&buf) + for _, k := range m.o { + // Here we convert non string keys in string. + if err := encoder.Encode(fmt.Sprintf("%v", m.conv(k))); err != nil { + return nil, err + } + buf.WriteByte(':') + if err := encoder.Encode(m.kv[m.conv(k)]); err != nil { + return nil, err + } + buf.WriteByte(',') + } + buf.Truncate(buf.Len() - 1) // remove last `,` + buf.WriteByte('}') + return buf.Bytes(), nil +} + +// Set inserts or replaces an existing key-value pair in the map +func (m *mapImpl[K, V, C]) Set(key K, value V) { + compKey := m.conv(key) + if _, has := m.kv[compKey]; has { + m.Remove(key) + } + m.kv[compKey] = value + m.o = append(m.o, key) +} + +// Size returns the number of elements in the map +func (m *mapImpl[K, V, C]) Size() int { + return len(m.kv) +} + +// Remove removes the key from the map +func (m *mapImpl[K, V, C]) Remove(key K) { + compKey := m.conv(key) + delete(m.kv, compKey) + for i, k := range m.o { + if m.conv(k) == compKey { + m.o = append(m.o[:i], m.o[i+1:]...) + return + } + } +} + +// Merge merges other Maps into this one. Each key/value of the merged Maps replaces +// the key/value present in the original Map. +func (m *mapImpl[K, V, C]) Merge(sources ...Map[K, V]) Map[K, V] { + for _, source := range sources { + for _, key := range source.Keys() { + value := source.Get(key) + m.Set(key, value) + } + } + return m +} + +// Keys returns an array of the keys contained in the Map +func (m *mapImpl[K, V, C]) Keys() []K { + keys := make([]K, len(m.o)) + copy(keys, m.o) + return keys +} + +func (m *mapImpl[K, V, C]) SortKeys(f func(x, y K) int) { + slices.SortFunc(m.o, f) +} + +func (m *mapImpl[K, V, C]) SortStableKeys(f func(x, y K) int) { + slices.SortStableFunc(m.o, f) +} + +// Values returns an array of the values contained in the Map. Duplicated +// values are repeated in the list accordingly. +func (m *mapImpl[K, V, C]) Values() []V { + values := make([]V, len(m.o)) + for i, key := range m.o { + values[i] = m.kv[m.conv(key)] + } + return values +} + +// Clone makes a copy of the Map +func (m *mapImpl[K, V, C]) Clone() Map[K, V] { + clone := NewWithConversionFunc[K, V, C](m.conv) + clone.Merge(m) + return clone +} diff --git a/internal/orderedmap/orderedmap_test.go b/internal/orderedmap/orderedmap_test.go new file mode 100644 index 00000000000..bd7975f1949 --- /dev/null +++ b/internal/orderedmap/orderedmap_test.go @@ -0,0 +1,361 @@ +// This file is part of arduino-cli. +// +// Copyright 2023 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to +// modify or otherwise use the software for commercial activities involving the +// Arduino software without disclosing the source code of your own applications. +// To purchase a commercial license, send an email to license@arduino.cc. + +package orderedmap_test + +import ( + "testing" + + "github.com/arduino/arduino-cli/internal/orderedmap" + "github.com/stretchr/testify/require" +) + +func TestGet(t *testing.T) { + t.Run("the key is a string", func(t *testing.T) { + m := orderedmap.New[string, int]() + + require.Zero(t, m.Get("not-existing-key")) + v, ok := m.GetOk("not-existing-key") + require.Zero(t, v) + require.False(t, ok) + + m.Set("existing-key", 1) + require.Equal(t, 1, m.Get("existing-key")) + v, ok = m.GetOk("existing-key") + require.Equal(t, 1, v) + require.True(t, ok) + + // test empty key + m.Set("", 2) + require.Equal(t, 2, m.Get("")) + v, ok = m.GetOk("") + require.Equal(t, 2, v) + require.True(t, ok) + }) + + t.Run("the key is int", func(t *testing.T) { + m := orderedmap.New[int, int]() + + require.Equal(t, 0, m.Get(1)) + v, ok := m.GetOk(1) + require.Zero(t, v) + require.False(t, ok) + + m.Set(1, 1) + require.Equal(t, 1, m.Get(1)) + v, ok = m.GetOk(1) + require.Equal(t, 1, v) + require.True(t, ok) + + // test empty key + m.Set(0, 2) + require.Equal(t, 2, m.Get(0)) + v, ok = m.GetOk(0) + require.Equal(t, 2, v) + require.True(t, ok) + }) + + t.Run("custom comparable key", func(t *testing.T) { + type A struct { + b []byte + } + m := orderedmap.NewWithConversionFunc[*A, int, string]( + func(a *A) string { + if a == nil { + return "" + } + return string(a.b) + }, + ) + require.Zero(t, m.Get(&A{})) + require.Zero(t, m.Get(nil)) + + // Here we're using the conversion function to set the key, using a different + // pointer to retrieve the value works. + m.Set(&A{b: []byte{60, 61, 62}}, 1) + require.Equal(t, 1, m.Get(&A{b: []byte{60, 61, 62}})) + + m.Set(nil, 2) + require.Equal(t, 2, m.Get(nil)) + }) +} + +func TestSet(t *testing.T) { + t.Run("insert 3 different keys", func(t *testing.T) { + m := orderedmap.New[string, int]() + m.Set("a", 1) + m.Set("b", 2) + m.Set("c", 3) + require.Equal(t, 1, m.Get("a")) + require.Equal(t, 2, m.Get("b")) + require.Equal(t, 3, m.Get("c")) + }) + t.Run("insert equal keys", func(t *testing.T) { + m := orderedmap.New[string, int]() + m.Set("a", 1) + m.Set("a", 2) + require.Equal(t, 2, m.Get("a")) + }) +} + +func TestSize(t *testing.T) { + t.Run("empty map", func(t *testing.T) { + m := orderedmap.New[string, bool]() + require.Zero(t, m.Size()) + }) + t.Run("one element", func(t *testing.T) { + m := orderedmap.New[string, bool]() + m.Set("a", true) + require.Equal(t, 1, m.Size()) + }) + t.Run("three elements", func(t *testing.T) { + m := orderedmap.New[string, bool]() + m.Set("a", true) + m.Set("b", true) + m.Set("c", true) + require.Equal(t, 3, m.Size()) + }) + t.Run("insert same keys result in size 1", func(t *testing.T) { + m := orderedmap.New[string, bool]() + m.Set("a", true) + m.Set("a", false) + m.Set("a", true) + require.Equal(t, 1, m.Size()) + }) +} + +func TestKeys(t *testing.T) { + t.Run("empty map", func(t *testing.T) { + m := orderedmap.New[string, bool]() + require.Empty(t, m.Keys()) + }) + t.Run("one element", func(t *testing.T) { + m := orderedmap.New[string, bool]() + m.Set("a", true) + require.Len(t, m.Keys(), 1) + }) + t.Run("keys respect order of insertion", func(t *testing.T) { + m := orderedmap.New[string, bool]() + m.Set("a", true) + m.Set("b", true) + m.Set("c", true) + require.Equal(t, []string{"a", "b", "c"}, m.Keys()) + }) + t.Run("replacing a key changes the ordering", func(t *testing.T) { + m := orderedmap.New[string, bool]() + m.Set("a", true) + m.Set("b", true) + m.Set("a", false) + require.Equal(t, []string{"b", "a"}, m.Keys()) + }) + t.Run("delete a key", func(t *testing.T) { + m := orderedmap.New[string, bool]() + m.Set("a", true) + m.Set("b", true) + m.Remove("a") + require.Equal(t, []string{"b"}, m.Keys()) + }) +} + +func TestRemove(t *testing.T) { + t.Run("key doesn't exist", func(t *testing.T) { + m := orderedmap.New[string, bool]() + require.Zero(t, m.Get("not-existing-key")) + m.Remove("not-existing-key") + require.Zero(t, m.Get("not-existing-key")) + }) + t.Run("key exist", func(t *testing.T) { + m := orderedmap.New[string, bool]() + m.Set("a", true) + require.True(t, m.Get("a")) + + m.Remove("a") + require.False(t, m.Get("a")) + }) + t.Run("key deletion doesn't affect other keys", func(t *testing.T) { + m := orderedmap.New[string, bool]() + m.Set("a", true) + m.Set("b", true) + m.Remove("a") + require.True(t, m.Get("b")) + _, ok := m.GetOk("a") + require.False(t, ok) + }) +} + +func TestMerge(t *testing.T) { + t.Run("merge empty maps", func(t *testing.T) { + m1 := orderedmap.New[string, int]() + m2 := orderedmap.New[string, int]() + + merged := m1.Merge(m2) + require.Equal(t, m1, merged) + require.Len(t, m1.Keys(), 0) + }) + + t.Run("merge multiple elements", func(t *testing.T) { + m1 := orderedmap.New[string, int]() + m1.Set("a", 1) + m1.Set("b", 2) + m1.Set("c", 3) + + m2 := orderedmap.New[string, int]() + m2.Set("d", 4) + m2.Set("e", 5) + + // assert that the Merge return is m1 + merged := m1.Merge(m2) + require.Equal(t, m1, merged) + + // assert we find the merged elements in the map + require.Equal(t, 5, m1.Size()) + require.Equal(t, 4, m1.Get("d")) + require.Equal(t, 5, m1.Get("e")) + require.Equal(t, []string{"a", "b", "c", "d", "e"}, m1.Keys()) + + require.Equal(t, []string{"d", "e"}, m2.Keys()) + }) +} + +func TestSortKeys(t *testing.T) { + t.Run("empty map", func(t *testing.T) { + m1 := orderedmap.New[string, int]() + require.Equal(t, []string{}, m1.Keys()) + m1.SortKeys(func(x, y string) int { + if x < y { + return -1 + } + return 1 + }) + require.Equal(t, []string{}, m1.Keys()) + }) + t.Run("sort ascending", func(t *testing.T) { + m1 := orderedmap.New[string, int]() + m1.Set("c", 3) + m1.Set("b", 2) + m1.Set("a", 1) + m1.Set("z", 4) + + require.Equal(t, []string{"c", "b", "a", "z"}, m1.Keys()) + m1.SortKeys(func(x, y string) int { + if x < y { + return -1 + } + return 1 + }) + require.Equal(t, []string{"a", "b", "c", "z"}, m1.Keys()) + }) +} + +func TestValues(t *testing.T) { + t.Run("empty map", func(t *testing.T) { + m1 := orderedmap.New[string, int]() + require.Empty(t, m1.Values()) + }) + t.Run("values respect order of insertion", func(t *testing.T) { + m1 := orderedmap.New[string, int]() + m1.Set("a", 1) + m1.Set("b", 2) + m1.Set("c", 3) + require.Equal(t, []int{1, 2, 3}, m1.Values()) + }) + t.Run("after a key sort values respect the new order", func(t *testing.T) { + m1 := orderedmap.New[string, int]() + m1.Set("c", 3) + m1.Set("b", 2) + m1.Set("a", 1) + m1.Set("z", 4) + require.Equal(t, []int{3, 2, 1, 4}, m1.Values()) + m1.SortKeys(func(x, y string) int { + if x < y { + return -1 + } + return 1 + }) + require.Equal(t, []int{1, 2, 3, 4}, m1.Values()) + }) +} + +func TestClone(t *testing.T) { + t.Run("empty map", func(t *testing.T) { + m1 := orderedmap.New[string, int]() + clone := m1.Clone() + require.NotEqual(t, m1, clone) + require.Equal(t, m1.Keys(), clone.Keys()) + require.Equal(t, m1.Values(), clone.Values()) + }) + t.Run("clone doesn't affect the original map", func(t *testing.T) { + m1 := orderedmap.New[string, int]() + m1.Set("a", 1) + m1.Set("b", 2) + m1.Set("c", 3) + + clone := m1.Clone() + + require.NotEqual(t, m1, clone) + require.Equal(t, m1.Keys(), clone.Keys()) + require.Equal(t, m1.Values(), clone.Values()) + + clone.Set("d", 4) + require.Equal(t, 4, clone.Get("d")) + _, ok := m1.GetOk("d") + require.False(t, ok) + }) +} + +func TestMarshallJSON(t *testing.T) { + t.Run("empty map", func(t *testing.T) { + m := orderedmap.New[string, int]() + mapJSON, err := m.MarshalJSON() + require.NoError(t, err) + require.JSONEq(t, `{}`, string(mapJSON)) + }) + t.Run("respect the order of insertion", func(t *testing.T) { + m := orderedmap.New[string, int]() + m.Set("a", 1) + m.Set("b", 2) + m.Set("c", 3) + mapJSON, err := m.MarshalJSON() + require.NoError(t, err) + require.JSONEq(t, `{"a":1,"b":2,"c":3}`, string(mapJSON)) + }) + t.Run("can serialize int keys", func(t *testing.T) { + m := orderedmap.New[int, bool]() + m.Set(1, true) + m.Set(2, true) + m.Set(3, true) + mapJSON, err := m.MarshalJSON() + require.NoError(t, err) + require.JSONEq(t, `{"1":true,"2":true,"3":true}`, string(mapJSON)) + }) + t.Run("can serialize pointer keys", func(t *testing.T) { + m := orderedmap.NewWithConversionFunc[*int, bool, int](func(i *int) int { + if i == nil { + return 0 + } + return *i + }) + m.Set(toPtr(1), true) + m.Set(toPtr(2), true) + m.Set(toPtr(3), true) + mapJSON, err := m.MarshalJSON() + require.NoError(t, err) + require.JSONEq(t, `{"1":true,"2":true,"3":true}`, string(mapJSON)) + }) +} + +func toPtr[V any](v V) *V { + return &v +} diff --git a/rpc/cc/arduino/cli/commands/v1/commands.pb.go b/rpc/cc/arduino/cli/commands/v1/commands.pb.go index 67afa35e70b..059e6b238de 100644 --- a/rpc/cc/arduino/cli/commands/v1/commands.pb.go +++ b/rpc/cc/arduino/cli/commands/v1/commands.pb.go @@ -1664,7 +1664,7 @@ var file_cc_arduino_cli_commands_v1_commands_proto_rawDesc = []byte{ 0x49, 0x4c, 0x45, 0x44, 0x5f, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x49, 0x4e, 0x49, 0x54, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x49, 0x4e, 0x44, 0x45, 0x58, 0x5f, 0x44, 0x4f, 0x57, 0x4e, 0x4c, 0x4f, 0x41, 0x44, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, - 0x32, 0xab, 0x27, 0x0a, 0x12, 0x41, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x43, 0x6f, 0x72, 0x65, + 0x32, 0xb8, 0x26, 0x0a, 0x12, 0x41, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x43, 0x6f, 0x72, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x61, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 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, 0x43, @@ -1860,130 +1860,123 @@ var file_cc_arduino_cli_commands_v1_commands_proto_rawDesc = []byte{ 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 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, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x71, 0x0a, 0x0c, 0x50, 0x6c, 0x61, 0x74, - 0x66, 0x6f, 0x72, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2f, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7c, 0x0a, 0x0f, 0x4c, 0x69, 0x62, 0x72, + 0x61, 0x72, 0x79, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x32, 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, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, + 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x33, 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, 0x4c, 0x69, 0x62, + 0x72, 0x61, 0x72, 0x79, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x79, 0x0a, 0x0e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, + 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x31, 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, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 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, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7c, 0x0a, 0x0f, 0x4c, - 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x32, - 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, 0x4c, 0x69, 0x62, 0x72, - 0x61, 0x72, 0x79, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x33, 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, - 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x79, 0x0a, 0x0e, 0x4c, 0x69, 0x62, - 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x31, 0x2e, 0x63, 0x63, + 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 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, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, - 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, - 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, 0x4c, 0x69, 0x62, 0x72, - 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x30, 0x01, 0x12, 0x79, 0x0a, 0x0e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, - 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x12, 0x31, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, + 0x01, 0x12, 0x79, 0x0a, 0x0e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, + 0x61, 0x64, 0x65, 0x12, 0x31, 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, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 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, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, - 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 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, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x70, - 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, - 0x82, 0x01, 0x0a, 0x11, 0x5a, 0x69, 0x70, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, - 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x34, 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, 0x5a, 0x69, 0x70, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, - 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 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, 0x5a, 0x69, 0x70, 0x4c, 0x69, 0x62, 0x72, - 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x30, 0x01, 0x12, 0x82, 0x01, 0x0a, 0x11, 0x47, 0x69, 0x74, 0x4c, 0x69, 0x62, 0x72, - 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x34, 0x2e, 0x63, 0x63, 0x2e, + 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x82, 0x01, 0x0a, + 0x11, 0x5a, 0x69, 0x70, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, + 0x6c, 0x6c, 0x12, 0x34, 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, + 0x5a, 0x69, 0x70, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 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, 0x5a, 0x69, 0x70, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, + 0x01, 0x12, 0x82, 0x01, 0x0a, 0x11, 0x47, 0x69, 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x34, 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, 0x47, 0x69, 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 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, 0x47, 0x69, 0x74, 0x4c, 0x69, + 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x7f, 0x0a, 0x10, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, + 0x79, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x33, 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, 0x47, 0x69, 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, - 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x35, 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, 0x47, 0x69, - 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x7f, 0x0a, 0x10, 0x4c, 0x69, 0x62, - 0x72, 0x61, 0x72, 0x79, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x33, 0x2e, + 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, + 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x34, 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, 0x4c, 0x69, 0x62, + 0x72, 0x61, 0x72, 0x79, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x82, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x62, 0x72, + 0x61, 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x41, 0x6c, 0x6c, 0x12, 0x34, 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, 0x4c, 0x69, 0x62, 0x72, 0x61, - 0x72, 0x79, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x34, 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, - 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x82, 0x01, 0x0a, 0x11, 0x4c, - 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x41, 0x6c, 0x6c, - 0x12, 0x34, 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, 0x4c, 0x69, - 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x41, 0x6c, 0x6c, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 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, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, - 0x64, 0x65, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, - 0x9b, 0x01, 0x0a, 0x1a, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, - 0x76, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x3d, - 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, 0x4c, 0x69, 0x62, 0x72, - 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, - 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, + 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x35, 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, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x41, + 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x9b, 0x01, 0x0a, + 0x1a, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x44, + 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x3d, 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, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, + 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, + 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 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, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, + 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x74, 0x0a, 0x0d, 0x4c, 0x69, + 0x62, 0x72, 0x61, 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x30, 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, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, + 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 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, 0x4c, 0x69, 0x62, 0x72, 0x61, - 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, - 0x6e, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x74, 0x0a, - 0x0d, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x30, - 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, 0x4c, 0x69, 0x62, 0x72, - 0x61, 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x31, 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, 0x4c, 0x69, - 0x62, 0x72, 0x61, 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x6e, 0x0a, 0x0b, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x69, - 0x73, 0x74, 0x12, 0x2e, 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, - 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2f, 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, - 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x07, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x12, 0x2a, - 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, 0x4d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x63, 0x63, 0x2e, + 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x6e, 0x0a, 0x0b, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x2e, 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, 0x4c, 0x69, 0x62, + 0x72, 0x61, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2f, 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, 0x4c, 0x69, 0x62, + 0x72, 0x61, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x66, 0x0a, 0x07, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x12, 0x2a, 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, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 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, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0xa1, 0x01, 0x0a, 0x1c, 0x45, 0x6e, 0x75, + 0x6d, 0x65, 0x72, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x50, 0x6f, 0x72, + 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3f, 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, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x65, + 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 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, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0xa1, 0x01, 0x0a, 0x1c, - 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x50, 0x6f, 0x72, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3f, 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, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, - 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 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, 0x45, 0x6e, 0x75, 0x6d, 0x65, - 0x72, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x62, 0x0a, 0x05, 0x44, 0x65, 0x62, 0x75, 0x67, 0x12, 0x28, 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, 0x44, 0x65, 0x62, 0x75, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, + 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x53, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x05, + 0x44, 0x65, 0x62, 0x75, 0x67, 0x12, 0x28, 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, 0x44, 0x65, 0x62, 0x75, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 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, 0x44, 0x65, 0x62, + 0x75, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, + 0x12, 0x79, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x31, 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, - 0x44, 0x65, 0x62, 0x75, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, - 0x01, 0x30, 0x01, 0x12, 0x79, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x31, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, + 0x47, 0x65, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 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, 0x47, 0x65, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 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, 0x47, 0x65, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 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, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 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 ( @@ -2046,52 +2039,50 @@ var file_cc_arduino_cli_commands_v1_commands_proto_goTypes = []interface{}{ (*ListProgrammersAvailableForUploadRequest)(nil), // 42: cc.arduino.cli.commands.v1.ListProgrammersAvailableForUploadRequest (*BurnBootloaderRequest)(nil), // 43: cc.arduino.cli.commands.v1.BurnBootloaderRequest (*PlatformSearchRequest)(nil), // 44: cc.arduino.cli.commands.v1.PlatformSearchRequest - (*PlatformListRequest)(nil), // 45: cc.arduino.cli.commands.v1.PlatformListRequest - (*LibraryDownloadRequest)(nil), // 46: cc.arduino.cli.commands.v1.LibraryDownloadRequest - (*LibraryInstallRequest)(nil), // 47: cc.arduino.cli.commands.v1.LibraryInstallRequest - (*LibraryUpgradeRequest)(nil), // 48: cc.arduino.cli.commands.v1.LibraryUpgradeRequest - (*ZipLibraryInstallRequest)(nil), // 49: cc.arduino.cli.commands.v1.ZipLibraryInstallRequest - (*GitLibraryInstallRequest)(nil), // 50: cc.arduino.cli.commands.v1.GitLibraryInstallRequest - (*LibraryUninstallRequest)(nil), // 51: cc.arduino.cli.commands.v1.LibraryUninstallRequest - (*LibraryUpgradeAllRequest)(nil), // 52: cc.arduino.cli.commands.v1.LibraryUpgradeAllRequest - (*LibraryResolveDependenciesRequest)(nil), // 53: cc.arduino.cli.commands.v1.LibraryResolveDependenciesRequest - (*LibrarySearchRequest)(nil), // 54: cc.arduino.cli.commands.v1.LibrarySearchRequest - (*LibraryListRequest)(nil), // 55: cc.arduino.cli.commands.v1.LibraryListRequest - (*MonitorRequest)(nil), // 56: cc.arduino.cli.commands.v1.MonitorRequest - (*EnumerateMonitorPortSettingsRequest)(nil), // 57: cc.arduino.cli.commands.v1.EnumerateMonitorPortSettingsRequest - (*DebugRequest)(nil), // 58: cc.arduino.cli.commands.v1.DebugRequest - (*GetDebugConfigRequest)(nil), // 59: cc.arduino.cli.commands.v1.GetDebugConfigRequest - (*BoardDetailsResponse)(nil), // 60: cc.arduino.cli.commands.v1.BoardDetailsResponse - (*BoardListResponse)(nil), // 61: cc.arduino.cli.commands.v1.BoardListResponse - (*BoardListAllResponse)(nil), // 62: cc.arduino.cli.commands.v1.BoardListAllResponse - (*BoardSearchResponse)(nil), // 63: cc.arduino.cli.commands.v1.BoardSearchResponse - (*BoardListWatchResponse)(nil), // 64: cc.arduino.cli.commands.v1.BoardListWatchResponse - (*CompileResponse)(nil), // 65: cc.arduino.cli.commands.v1.CompileResponse - (*PlatformInstallResponse)(nil), // 66: cc.arduino.cli.commands.v1.PlatformInstallResponse - (*PlatformDownloadResponse)(nil), // 67: cc.arduino.cli.commands.v1.PlatformDownloadResponse - (*PlatformUninstallResponse)(nil), // 68: cc.arduino.cli.commands.v1.PlatformUninstallResponse - (*PlatformUpgradeResponse)(nil), // 69: cc.arduino.cli.commands.v1.PlatformUpgradeResponse - (*UploadResponse)(nil), // 70: cc.arduino.cli.commands.v1.UploadResponse - (*UploadUsingProgrammerResponse)(nil), // 71: cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse - (*SupportedUserFieldsResponse)(nil), // 72: cc.arduino.cli.commands.v1.SupportedUserFieldsResponse - (*ListProgrammersAvailableForUploadResponse)(nil), // 73: cc.arduino.cli.commands.v1.ListProgrammersAvailableForUploadResponse - (*BurnBootloaderResponse)(nil), // 74: cc.arduino.cli.commands.v1.BurnBootloaderResponse - (*PlatformSearchResponse)(nil), // 75: cc.arduino.cli.commands.v1.PlatformSearchResponse - (*PlatformListResponse)(nil), // 76: cc.arduino.cli.commands.v1.PlatformListResponse - (*LibraryDownloadResponse)(nil), // 77: cc.arduino.cli.commands.v1.LibraryDownloadResponse - (*LibraryInstallResponse)(nil), // 78: cc.arduino.cli.commands.v1.LibraryInstallResponse - (*LibraryUpgradeResponse)(nil), // 79: cc.arduino.cli.commands.v1.LibraryUpgradeResponse - (*ZipLibraryInstallResponse)(nil), // 80: cc.arduino.cli.commands.v1.ZipLibraryInstallResponse - (*GitLibraryInstallResponse)(nil), // 81: cc.arduino.cli.commands.v1.GitLibraryInstallResponse - (*LibraryUninstallResponse)(nil), // 82: cc.arduino.cli.commands.v1.LibraryUninstallResponse - (*LibraryUpgradeAllResponse)(nil), // 83: cc.arduino.cli.commands.v1.LibraryUpgradeAllResponse - (*LibraryResolveDependenciesResponse)(nil), // 84: cc.arduino.cli.commands.v1.LibraryResolveDependenciesResponse - (*LibrarySearchResponse)(nil), // 85: cc.arduino.cli.commands.v1.LibrarySearchResponse - (*LibraryListResponse)(nil), // 86: cc.arduino.cli.commands.v1.LibraryListResponse - (*MonitorResponse)(nil), // 87: cc.arduino.cli.commands.v1.MonitorResponse - (*EnumerateMonitorPortSettingsResponse)(nil), // 88: cc.arduino.cli.commands.v1.EnumerateMonitorPortSettingsResponse - (*DebugResponse)(nil), // 89: cc.arduino.cli.commands.v1.DebugResponse - (*GetDebugConfigResponse)(nil), // 90: cc.arduino.cli.commands.v1.GetDebugConfigResponse + (*LibraryDownloadRequest)(nil), // 45: cc.arduino.cli.commands.v1.LibraryDownloadRequest + (*LibraryInstallRequest)(nil), // 46: cc.arduino.cli.commands.v1.LibraryInstallRequest + (*LibraryUpgradeRequest)(nil), // 47: cc.arduino.cli.commands.v1.LibraryUpgradeRequest + (*ZipLibraryInstallRequest)(nil), // 48: cc.arduino.cli.commands.v1.ZipLibraryInstallRequest + (*GitLibraryInstallRequest)(nil), // 49: cc.arduino.cli.commands.v1.GitLibraryInstallRequest + (*LibraryUninstallRequest)(nil), // 50: cc.arduino.cli.commands.v1.LibraryUninstallRequest + (*LibraryUpgradeAllRequest)(nil), // 51: cc.arduino.cli.commands.v1.LibraryUpgradeAllRequest + (*LibraryResolveDependenciesRequest)(nil), // 52: cc.arduino.cli.commands.v1.LibraryResolveDependenciesRequest + (*LibrarySearchRequest)(nil), // 53: cc.arduino.cli.commands.v1.LibrarySearchRequest + (*LibraryListRequest)(nil), // 54: cc.arduino.cli.commands.v1.LibraryListRequest + (*MonitorRequest)(nil), // 55: cc.arduino.cli.commands.v1.MonitorRequest + (*EnumerateMonitorPortSettingsRequest)(nil), // 56: cc.arduino.cli.commands.v1.EnumerateMonitorPortSettingsRequest + (*DebugRequest)(nil), // 57: cc.arduino.cli.commands.v1.DebugRequest + (*GetDebugConfigRequest)(nil), // 58: cc.arduino.cli.commands.v1.GetDebugConfigRequest + (*BoardDetailsResponse)(nil), // 59: cc.arduino.cli.commands.v1.BoardDetailsResponse + (*BoardListResponse)(nil), // 60: cc.arduino.cli.commands.v1.BoardListResponse + (*BoardListAllResponse)(nil), // 61: cc.arduino.cli.commands.v1.BoardListAllResponse + (*BoardSearchResponse)(nil), // 62: cc.arduino.cli.commands.v1.BoardSearchResponse + (*BoardListWatchResponse)(nil), // 63: cc.arduino.cli.commands.v1.BoardListWatchResponse + (*CompileResponse)(nil), // 64: cc.arduino.cli.commands.v1.CompileResponse + (*PlatformInstallResponse)(nil), // 65: cc.arduino.cli.commands.v1.PlatformInstallResponse + (*PlatformDownloadResponse)(nil), // 66: cc.arduino.cli.commands.v1.PlatformDownloadResponse + (*PlatformUninstallResponse)(nil), // 67: cc.arduino.cli.commands.v1.PlatformUninstallResponse + (*PlatformUpgradeResponse)(nil), // 68: cc.arduino.cli.commands.v1.PlatformUpgradeResponse + (*UploadResponse)(nil), // 69: cc.arduino.cli.commands.v1.UploadResponse + (*UploadUsingProgrammerResponse)(nil), // 70: cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse + (*SupportedUserFieldsResponse)(nil), // 71: cc.arduino.cli.commands.v1.SupportedUserFieldsResponse + (*ListProgrammersAvailableForUploadResponse)(nil), // 72: cc.arduino.cli.commands.v1.ListProgrammersAvailableForUploadResponse + (*BurnBootloaderResponse)(nil), // 73: cc.arduino.cli.commands.v1.BurnBootloaderResponse + (*PlatformSearchResponse)(nil), // 74: cc.arduino.cli.commands.v1.PlatformSearchResponse + (*LibraryDownloadResponse)(nil), // 75: cc.arduino.cli.commands.v1.LibraryDownloadResponse + (*LibraryInstallResponse)(nil), // 76: cc.arduino.cli.commands.v1.LibraryInstallResponse + (*LibraryUpgradeResponse)(nil), // 77: cc.arduino.cli.commands.v1.LibraryUpgradeResponse + (*ZipLibraryInstallResponse)(nil), // 78: cc.arduino.cli.commands.v1.ZipLibraryInstallResponse + (*GitLibraryInstallResponse)(nil), // 79: cc.arduino.cli.commands.v1.GitLibraryInstallResponse + (*LibraryUninstallResponse)(nil), // 80: cc.arduino.cli.commands.v1.LibraryUninstallResponse + (*LibraryUpgradeAllResponse)(nil), // 81: cc.arduino.cli.commands.v1.LibraryUpgradeAllResponse + (*LibraryResolveDependenciesResponse)(nil), // 82: cc.arduino.cli.commands.v1.LibraryResolveDependenciesResponse + (*LibrarySearchResponse)(nil), // 83: cc.arduino.cli.commands.v1.LibrarySearchResponse + (*LibraryListResponse)(nil), // 84: cc.arduino.cli.commands.v1.LibraryListResponse + (*MonitorResponse)(nil), // 85: cc.arduino.cli.commands.v1.MonitorResponse + (*EnumerateMonitorPortSettingsResponse)(nil), // 86: cc.arduino.cli.commands.v1.EnumerateMonitorPortSettingsResponse + (*DebugResponse)(nil), // 87: cc.arduino.cli.commands.v1.DebugResponse + (*GetDebugConfigResponse)(nil), // 88: cc.arduino.cli.commands.v1.GetDebugConfigResponse } var file_cc_arduino_cli_commands_v1_commands_proto_depIdxs = []int32{ 24, // 0: cc.arduino.cli.commands.v1.CreateResponse.instance:type_name -> cc.arduino.cli.commands.v1.Instance @@ -2135,64 +2126,62 @@ var file_cc_arduino_cli_commands_v1_commands_proto_depIdxs = []int32{ 42, // 38: cc.arduino.cli.commands.v1.ArduinoCoreService.ListProgrammersAvailableForUpload:input_type -> cc.arduino.cli.commands.v1.ListProgrammersAvailableForUploadRequest 43, // 39: cc.arduino.cli.commands.v1.ArduinoCoreService.BurnBootloader:input_type -> cc.arduino.cli.commands.v1.BurnBootloaderRequest 44, // 40: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformSearch:input_type -> cc.arduino.cli.commands.v1.PlatformSearchRequest - 45, // 41: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformList:input_type -> cc.arduino.cli.commands.v1.PlatformListRequest - 46, // 42: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryDownload:input_type -> cc.arduino.cli.commands.v1.LibraryDownloadRequest - 47, // 43: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryInstall:input_type -> cc.arduino.cli.commands.v1.LibraryInstallRequest - 48, // 44: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUpgrade:input_type -> cc.arduino.cli.commands.v1.LibraryUpgradeRequest - 49, // 45: cc.arduino.cli.commands.v1.ArduinoCoreService.ZipLibraryInstall:input_type -> cc.arduino.cli.commands.v1.ZipLibraryInstallRequest - 50, // 46: cc.arduino.cli.commands.v1.ArduinoCoreService.GitLibraryInstall:input_type -> cc.arduino.cli.commands.v1.GitLibraryInstallRequest - 51, // 47: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUninstall:input_type -> cc.arduino.cli.commands.v1.LibraryUninstallRequest - 52, // 48: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUpgradeAll:input_type -> cc.arduino.cli.commands.v1.LibraryUpgradeAllRequest - 53, // 49: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryResolveDependencies:input_type -> cc.arduino.cli.commands.v1.LibraryResolveDependenciesRequest - 54, // 50: cc.arduino.cli.commands.v1.ArduinoCoreService.LibrarySearch:input_type -> cc.arduino.cli.commands.v1.LibrarySearchRequest - 55, // 51: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryList:input_type -> cc.arduino.cli.commands.v1.LibraryListRequest - 56, // 52: cc.arduino.cli.commands.v1.ArduinoCoreService.Monitor:input_type -> cc.arduino.cli.commands.v1.MonitorRequest - 57, // 53: cc.arduino.cli.commands.v1.ArduinoCoreService.EnumerateMonitorPortSettings:input_type -> cc.arduino.cli.commands.v1.EnumerateMonitorPortSettingsRequest - 58, // 54: cc.arduino.cli.commands.v1.ArduinoCoreService.Debug:input_type -> cc.arduino.cli.commands.v1.DebugRequest - 59, // 55: cc.arduino.cli.commands.v1.ArduinoCoreService.GetDebugConfig:input_type -> cc.arduino.cli.commands.v1.GetDebugConfigRequest - 2, // 56: cc.arduino.cli.commands.v1.ArduinoCoreService.Create:output_type -> cc.arduino.cli.commands.v1.CreateResponse - 4, // 57: cc.arduino.cli.commands.v1.ArduinoCoreService.Init:output_type -> cc.arduino.cli.commands.v1.InitResponse - 7, // 58: cc.arduino.cli.commands.v1.ArduinoCoreService.Destroy:output_type -> cc.arduino.cli.commands.v1.DestroyResponse - 9, // 59: cc.arduino.cli.commands.v1.ArduinoCoreService.UpdateIndex:output_type -> cc.arduino.cli.commands.v1.UpdateIndexResponse - 11, // 60: cc.arduino.cli.commands.v1.ArduinoCoreService.UpdateLibrariesIndex:output_type -> cc.arduino.cli.commands.v1.UpdateLibrariesIndexResponse - 13, // 61: cc.arduino.cli.commands.v1.ArduinoCoreService.Version:output_type -> cc.arduino.cli.commands.v1.VersionResponse - 15, // 62: cc.arduino.cli.commands.v1.ArduinoCoreService.NewSketch:output_type -> cc.arduino.cli.commands.v1.NewSketchResponse - 18, // 63: cc.arduino.cli.commands.v1.ArduinoCoreService.LoadSketch:output_type -> cc.arduino.cli.commands.v1.LoadSketchResponse - 20, // 64: cc.arduino.cli.commands.v1.ArduinoCoreService.ArchiveSketch:output_type -> cc.arduino.cli.commands.v1.ArchiveSketchResponse - 22, // 65: cc.arduino.cli.commands.v1.ArduinoCoreService.SetSketchDefaults:output_type -> cc.arduino.cli.commands.v1.SetSketchDefaultsResponse - 60, // 66: cc.arduino.cli.commands.v1.ArduinoCoreService.BoardDetails:output_type -> cc.arduino.cli.commands.v1.BoardDetailsResponse - 61, // 67: cc.arduino.cli.commands.v1.ArduinoCoreService.BoardList:output_type -> cc.arduino.cli.commands.v1.BoardListResponse - 62, // 68: cc.arduino.cli.commands.v1.ArduinoCoreService.BoardListAll:output_type -> cc.arduino.cli.commands.v1.BoardListAllResponse - 63, // 69: cc.arduino.cli.commands.v1.ArduinoCoreService.BoardSearch:output_type -> cc.arduino.cli.commands.v1.BoardSearchResponse - 64, // 70: cc.arduino.cli.commands.v1.ArduinoCoreService.BoardListWatch:output_type -> cc.arduino.cli.commands.v1.BoardListWatchResponse - 65, // 71: cc.arduino.cli.commands.v1.ArduinoCoreService.Compile:output_type -> cc.arduino.cli.commands.v1.CompileResponse - 66, // 72: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformInstall:output_type -> cc.arduino.cli.commands.v1.PlatformInstallResponse - 67, // 73: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformDownload:output_type -> cc.arduino.cli.commands.v1.PlatformDownloadResponse - 68, // 74: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformUninstall:output_type -> cc.arduino.cli.commands.v1.PlatformUninstallResponse - 69, // 75: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformUpgrade:output_type -> cc.arduino.cli.commands.v1.PlatformUpgradeResponse - 70, // 76: cc.arduino.cli.commands.v1.ArduinoCoreService.Upload:output_type -> cc.arduino.cli.commands.v1.UploadResponse - 71, // 77: cc.arduino.cli.commands.v1.ArduinoCoreService.UploadUsingProgrammer:output_type -> cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse - 72, // 78: cc.arduino.cli.commands.v1.ArduinoCoreService.SupportedUserFields:output_type -> cc.arduino.cli.commands.v1.SupportedUserFieldsResponse - 73, // 79: cc.arduino.cli.commands.v1.ArduinoCoreService.ListProgrammersAvailableForUpload:output_type -> cc.arduino.cli.commands.v1.ListProgrammersAvailableForUploadResponse - 74, // 80: cc.arduino.cli.commands.v1.ArduinoCoreService.BurnBootloader:output_type -> cc.arduino.cli.commands.v1.BurnBootloaderResponse - 75, // 81: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformSearch:output_type -> cc.arduino.cli.commands.v1.PlatformSearchResponse - 76, // 82: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformList:output_type -> cc.arduino.cli.commands.v1.PlatformListResponse - 77, // 83: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryDownload:output_type -> cc.arduino.cli.commands.v1.LibraryDownloadResponse - 78, // 84: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryInstall:output_type -> cc.arduino.cli.commands.v1.LibraryInstallResponse - 79, // 85: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUpgrade:output_type -> cc.arduino.cli.commands.v1.LibraryUpgradeResponse - 80, // 86: cc.arduino.cli.commands.v1.ArduinoCoreService.ZipLibraryInstall:output_type -> cc.arduino.cli.commands.v1.ZipLibraryInstallResponse - 81, // 87: cc.arduino.cli.commands.v1.ArduinoCoreService.GitLibraryInstall:output_type -> cc.arduino.cli.commands.v1.GitLibraryInstallResponse - 82, // 88: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUninstall:output_type -> cc.arduino.cli.commands.v1.LibraryUninstallResponse - 83, // 89: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUpgradeAll:output_type -> cc.arduino.cli.commands.v1.LibraryUpgradeAllResponse - 84, // 90: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryResolveDependencies:output_type -> cc.arduino.cli.commands.v1.LibraryResolveDependenciesResponse - 85, // 91: cc.arduino.cli.commands.v1.ArduinoCoreService.LibrarySearch:output_type -> cc.arduino.cli.commands.v1.LibrarySearchResponse - 86, // 92: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryList:output_type -> cc.arduino.cli.commands.v1.LibraryListResponse - 87, // 93: cc.arduino.cli.commands.v1.ArduinoCoreService.Monitor:output_type -> cc.arduino.cli.commands.v1.MonitorResponse - 88, // 94: cc.arduino.cli.commands.v1.ArduinoCoreService.EnumerateMonitorPortSettings:output_type -> cc.arduino.cli.commands.v1.EnumerateMonitorPortSettingsResponse - 89, // 95: cc.arduino.cli.commands.v1.ArduinoCoreService.Debug:output_type -> cc.arduino.cli.commands.v1.DebugResponse - 90, // 96: cc.arduino.cli.commands.v1.ArduinoCoreService.GetDebugConfig:output_type -> cc.arduino.cli.commands.v1.GetDebugConfigResponse - 56, // [56:97] is the sub-list for method output_type - 15, // [15:56] is the sub-list for method input_type + 45, // 41: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryDownload:input_type -> cc.arduino.cli.commands.v1.LibraryDownloadRequest + 46, // 42: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryInstall:input_type -> cc.arduino.cli.commands.v1.LibraryInstallRequest + 47, // 43: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUpgrade:input_type -> cc.arduino.cli.commands.v1.LibraryUpgradeRequest + 48, // 44: cc.arduino.cli.commands.v1.ArduinoCoreService.ZipLibraryInstall:input_type -> cc.arduino.cli.commands.v1.ZipLibraryInstallRequest + 49, // 45: cc.arduino.cli.commands.v1.ArduinoCoreService.GitLibraryInstall:input_type -> cc.arduino.cli.commands.v1.GitLibraryInstallRequest + 50, // 46: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUninstall:input_type -> cc.arduino.cli.commands.v1.LibraryUninstallRequest + 51, // 47: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUpgradeAll:input_type -> cc.arduino.cli.commands.v1.LibraryUpgradeAllRequest + 52, // 48: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryResolveDependencies:input_type -> cc.arduino.cli.commands.v1.LibraryResolveDependenciesRequest + 53, // 49: cc.arduino.cli.commands.v1.ArduinoCoreService.LibrarySearch:input_type -> cc.arduino.cli.commands.v1.LibrarySearchRequest + 54, // 50: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryList:input_type -> cc.arduino.cli.commands.v1.LibraryListRequest + 55, // 51: cc.arduino.cli.commands.v1.ArduinoCoreService.Monitor:input_type -> cc.arduino.cli.commands.v1.MonitorRequest + 56, // 52: cc.arduino.cli.commands.v1.ArduinoCoreService.EnumerateMonitorPortSettings:input_type -> cc.arduino.cli.commands.v1.EnumerateMonitorPortSettingsRequest + 57, // 53: cc.arduino.cli.commands.v1.ArduinoCoreService.Debug:input_type -> cc.arduino.cli.commands.v1.DebugRequest + 58, // 54: cc.arduino.cli.commands.v1.ArduinoCoreService.GetDebugConfig:input_type -> cc.arduino.cli.commands.v1.GetDebugConfigRequest + 2, // 55: cc.arduino.cli.commands.v1.ArduinoCoreService.Create:output_type -> cc.arduino.cli.commands.v1.CreateResponse + 4, // 56: cc.arduino.cli.commands.v1.ArduinoCoreService.Init:output_type -> cc.arduino.cli.commands.v1.InitResponse + 7, // 57: cc.arduino.cli.commands.v1.ArduinoCoreService.Destroy:output_type -> cc.arduino.cli.commands.v1.DestroyResponse + 9, // 58: cc.arduino.cli.commands.v1.ArduinoCoreService.UpdateIndex:output_type -> cc.arduino.cli.commands.v1.UpdateIndexResponse + 11, // 59: cc.arduino.cli.commands.v1.ArduinoCoreService.UpdateLibrariesIndex:output_type -> cc.arduino.cli.commands.v1.UpdateLibrariesIndexResponse + 13, // 60: cc.arduino.cli.commands.v1.ArduinoCoreService.Version:output_type -> cc.arduino.cli.commands.v1.VersionResponse + 15, // 61: cc.arduino.cli.commands.v1.ArduinoCoreService.NewSketch:output_type -> cc.arduino.cli.commands.v1.NewSketchResponse + 18, // 62: cc.arduino.cli.commands.v1.ArduinoCoreService.LoadSketch:output_type -> cc.arduino.cli.commands.v1.LoadSketchResponse + 20, // 63: cc.arduino.cli.commands.v1.ArduinoCoreService.ArchiveSketch:output_type -> cc.arduino.cli.commands.v1.ArchiveSketchResponse + 22, // 64: cc.arduino.cli.commands.v1.ArduinoCoreService.SetSketchDefaults:output_type -> cc.arduino.cli.commands.v1.SetSketchDefaultsResponse + 59, // 65: cc.arduino.cli.commands.v1.ArduinoCoreService.BoardDetails:output_type -> cc.arduino.cli.commands.v1.BoardDetailsResponse + 60, // 66: cc.arduino.cli.commands.v1.ArduinoCoreService.BoardList:output_type -> cc.arduino.cli.commands.v1.BoardListResponse + 61, // 67: cc.arduino.cli.commands.v1.ArduinoCoreService.BoardListAll:output_type -> cc.arduino.cli.commands.v1.BoardListAllResponse + 62, // 68: cc.arduino.cli.commands.v1.ArduinoCoreService.BoardSearch:output_type -> cc.arduino.cli.commands.v1.BoardSearchResponse + 63, // 69: cc.arduino.cli.commands.v1.ArduinoCoreService.BoardListWatch:output_type -> cc.arduino.cli.commands.v1.BoardListWatchResponse + 64, // 70: cc.arduino.cli.commands.v1.ArduinoCoreService.Compile:output_type -> cc.arduino.cli.commands.v1.CompileResponse + 65, // 71: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformInstall:output_type -> cc.arduino.cli.commands.v1.PlatformInstallResponse + 66, // 72: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformDownload:output_type -> cc.arduino.cli.commands.v1.PlatformDownloadResponse + 67, // 73: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformUninstall:output_type -> cc.arduino.cli.commands.v1.PlatformUninstallResponse + 68, // 74: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformUpgrade:output_type -> cc.arduino.cli.commands.v1.PlatformUpgradeResponse + 69, // 75: cc.arduino.cli.commands.v1.ArduinoCoreService.Upload:output_type -> cc.arduino.cli.commands.v1.UploadResponse + 70, // 76: cc.arduino.cli.commands.v1.ArduinoCoreService.UploadUsingProgrammer:output_type -> cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse + 71, // 77: cc.arduino.cli.commands.v1.ArduinoCoreService.SupportedUserFields:output_type -> cc.arduino.cli.commands.v1.SupportedUserFieldsResponse + 72, // 78: cc.arduino.cli.commands.v1.ArduinoCoreService.ListProgrammersAvailableForUpload:output_type -> cc.arduino.cli.commands.v1.ListProgrammersAvailableForUploadResponse + 73, // 79: cc.arduino.cli.commands.v1.ArduinoCoreService.BurnBootloader:output_type -> cc.arduino.cli.commands.v1.BurnBootloaderResponse + 74, // 80: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformSearch:output_type -> cc.arduino.cli.commands.v1.PlatformSearchResponse + 75, // 81: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryDownload:output_type -> cc.arduino.cli.commands.v1.LibraryDownloadResponse + 76, // 82: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryInstall:output_type -> cc.arduino.cli.commands.v1.LibraryInstallResponse + 77, // 83: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUpgrade:output_type -> cc.arduino.cli.commands.v1.LibraryUpgradeResponse + 78, // 84: cc.arduino.cli.commands.v1.ArduinoCoreService.ZipLibraryInstall:output_type -> cc.arduino.cli.commands.v1.ZipLibraryInstallResponse + 79, // 85: cc.arduino.cli.commands.v1.ArduinoCoreService.GitLibraryInstall:output_type -> cc.arduino.cli.commands.v1.GitLibraryInstallResponse + 80, // 86: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUninstall:output_type -> cc.arduino.cli.commands.v1.LibraryUninstallResponse + 81, // 87: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUpgradeAll:output_type -> cc.arduino.cli.commands.v1.LibraryUpgradeAllResponse + 82, // 88: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryResolveDependencies:output_type -> cc.arduino.cli.commands.v1.LibraryResolveDependenciesResponse + 83, // 89: cc.arduino.cli.commands.v1.ArduinoCoreService.LibrarySearch:output_type -> cc.arduino.cli.commands.v1.LibrarySearchResponse + 84, // 90: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryList:output_type -> cc.arduino.cli.commands.v1.LibraryListResponse + 85, // 91: cc.arduino.cli.commands.v1.ArduinoCoreService.Monitor:output_type -> cc.arduino.cli.commands.v1.MonitorResponse + 86, // 92: cc.arduino.cli.commands.v1.ArduinoCoreService.EnumerateMonitorPortSettings:output_type -> cc.arduino.cli.commands.v1.EnumerateMonitorPortSettingsResponse + 87, // 93: cc.arduino.cli.commands.v1.ArduinoCoreService.Debug:output_type -> cc.arduino.cli.commands.v1.DebugResponse + 88, // 94: cc.arduino.cli.commands.v1.ArduinoCoreService.GetDebugConfig:output_type -> cc.arduino.cli.commands.v1.GetDebugConfigResponse + 55, // [55:95] is the sub-list for method output_type + 15, // [15:55] is the sub-list for method input_type 15, // [15:15] is the sub-list for extension type_name 15, // [15:15] is the sub-list for extension extendee 0, // [0:15] is the sub-list for field type_name diff --git a/rpc/cc/arduino/cli/commands/v1/commands.proto b/rpc/cc/arduino/cli/commands/v1/commands.proto index d16aab2c5a5..294f91d7742 100644 --- a/rpc/cc/arduino/cli/commands/v1/commands.proto +++ b/rpc/cc/arduino/cli/commands/v1/commands.proto @@ -131,9 +131,6 @@ service ArduinoCoreService { // Search for a platform in the platforms indexes. rpc PlatformSearch(PlatformSearchRequest) returns (PlatformSearchResponse); - // List all installed platforms. - rpc PlatformList(PlatformListRequest) returns (PlatformListResponse); - // Download the archive file of an Arduino library in the libraries index to // the staging directory. rpc LibraryDownload(LibraryDownloadRequest) diff --git a/rpc/cc/arduino/cli/commands/v1/commands_grpc.pb.go b/rpc/cc/arduino/cli/commands/v1/commands_grpc.pb.go index 454d07dd5d2..2c7ce7dfd42 100644 --- a/rpc/cc/arduino/cli/commands/v1/commands_grpc.pb.go +++ b/rpc/cc/arduino/cli/commands/v1/commands_grpc.pb.go @@ -60,7 +60,6 @@ const ( ArduinoCoreService_ListProgrammersAvailableForUpload_FullMethodName = "/cc.arduino.cli.commands.v1.ArduinoCoreService/ListProgrammersAvailableForUpload" ArduinoCoreService_BurnBootloader_FullMethodName = "/cc.arduino.cli.commands.v1.ArduinoCoreService/BurnBootloader" ArduinoCoreService_PlatformSearch_FullMethodName = "/cc.arduino.cli.commands.v1.ArduinoCoreService/PlatformSearch" - ArduinoCoreService_PlatformList_FullMethodName = "/cc.arduino.cli.commands.v1.ArduinoCoreService/PlatformList" ArduinoCoreService_LibraryDownload_FullMethodName = "/cc.arduino.cli.commands.v1.ArduinoCoreService/LibraryDownload" ArduinoCoreService_LibraryInstall_FullMethodName = "/cc.arduino.cli.commands.v1.ArduinoCoreService/LibraryInstall" ArduinoCoreService_LibraryUpgrade_FullMethodName = "/cc.arduino.cli.commands.v1.ArduinoCoreService/LibraryUpgrade" @@ -139,8 +138,6 @@ type ArduinoCoreServiceClient interface { BurnBootloader(ctx context.Context, in *BurnBootloaderRequest, opts ...grpc.CallOption) (ArduinoCoreService_BurnBootloaderClient, error) // Search for a platform in the platforms indexes. PlatformSearch(ctx context.Context, in *PlatformSearchRequest, opts ...grpc.CallOption) (*PlatformSearchResponse, error) - // List all installed platforms. - PlatformList(ctx context.Context, in *PlatformListRequest, opts ...grpc.CallOption) (*PlatformListResponse, error) // Download the archive file of an Arduino library in the libraries index to // the staging directory. LibraryDownload(ctx context.Context, in *LibraryDownloadRequest, opts ...grpc.CallOption) (ArduinoCoreService_LibraryDownloadClient, error) @@ -690,15 +687,6 @@ func (c *arduinoCoreServiceClient) PlatformSearch(ctx context.Context, in *Platf return out, nil } -func (c *arduinoCoreServiceClient) PlatformList(ctx context.Context, in *PlatformListRequest, opts ...grpc.CallOption) (*PlatformListResponse, error) { - out := new(PlatformListResponse) - err := c.cc.Invoke(ctx, ArduinoCoreService_PlatformList_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *arduinoCoreServiceClient) LibraryDownload(ctx context.Context, in *LibraryDownloadRequest, opts ...grpc.CallOption) (ArduinoCoreService_LibraryDownloadClient, error) { stream, err := c.cc.NewStream(ctx, &ArduinoCoreService_ServiceDesc.Streams[12], ArduinoCoreService_LibraryDownload_FullMethodName, opts...) if err != nil { @@ -1092,8 +1080,6 @@ type ArduinoCoreServiceServer interface { BurnBootloader(*BurnBootloaderRequest, ArduinoCoreService_BurnBootloaderServer) error // Search for a platform in the platforms indexes. PlatformSearch(context.Context, *PlatformSearchRequest) (*PlatformSearchResponse, error) - // List all installed platforms. - PlatformList(context.Context, *PlatformListRequest) (*PlatformListResponse, error) // Download the archive file of an Arduino library in the libraries index to // the staging directory. LibraryDownload(*LibraryDownloadRequest, ArduinoCoreService_LibraryDownloadServer) error @@ -1208,9 +1194,6 @@ func (UnimplementedArduinoCoreServiceServer) BurnBootloader(*BurnBootloaderReque func (UnimplementedArduinoCoreServiceServer) PlatformSearch(context.Context, *PlatformSearchRequest) (*PlatformSearchResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PlatformSearch not implemented") } -func (UnimplementedArduinoCoreServiceServer) PlatformList(context.Context, *PlatformListRequest) (*PlatformListResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PlatformList not implemented") -} func (UnimplementedArduinoCoreServiceServer) LibraryDownload(*LibraryDownloadRequest, ArduinoCoreService_LibraryDownloadServer) error { return status.Errorf(codes.Unimplemented, "method LibraryDownload not implemented") } @@ -1770,24 +1753,6 @@ func _ArduinoCoreService_PlatformSearch_Handler(srv interface{}, ctx context.Con return interceptor(ctx, in, info, handler) } -func _ArduinoCoreService_PlatformList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PlatformListRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ArduinoCoreServiceServer).PlatformList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ArduinoCoreService_PlatformList_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ArduinoCoreServiceServer).PlatformList(ctx, req.(*PlatformListRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _ArduinoCoreService_LibraryDownload_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(LibraryDownloadRequest) if err := stream.RecvMsg(m); err != nil { @@ -2140,10 +2105,6 @@ var ArduinoCoreService_ServiceDesc = grpc.ServiceDesc{ MethodName: "PlatformSearch", Handler: _ArduinoCoreService_PlatformSearch_Handler, }, - { - MethodName: "PlatformList", - Handler: _ArduinoCoreService_PlatformList_Handler, - }, { MethodName: "LibraryResolveDependencies", Handler: _ArduinoCoreService_LibraryResolveDependencies_Handler, diff --git a/rpc/cc/arduino/cli/commands/v1/common.go b/rpc/cc/arduino/cli/commands/v1/common.go index 9ef27da3e58..a04ebff193f 100644 --- a/rpc/cc/arduino/cli/commands/v1/common.go +++ b/rpc/cc/arduino/cli/commands/v1/common.go @@ -15,6 +15,12 @@ package commands +import ( + "sort" + + semver "go.bug.st/relaxed-semver" +) + // DownloadProgressCB is a callback to get updates on download progress type DownloadProgressCB func(curr *DownloadProgress) @@ -56,3 +62,39 @@ func (d DownloadProgressCB) End(success bool, message string) { // TaskProgressCB is a callback to receive progress messages type TaskProgressCB func(msg *TaskProgress) + +// InstanceCommand is an interface that represents a gRPC command with +// a gRPC Instance. +type InstanceCommand interface { + GetInstance() *Instance +} + +// GetLatestRelease returns the latest release in this PlatformSummary, +// or nil if not available. +func (s *PlatformSummary) GetLatestRelease() *PlatformRelease { + if s.LatestVersion == "" { + return nil + } + return s.Releases[s.LatestVersion] +} + +// GetInstalledRelease returns the latest release in this PlatformSummary, +// or nil if not available. +func (s *PlatformSummary) GetInstalledRelease() *PlatformRelease { + if s.InstalledVersion == "" { + return nil + } + return s.Releases[s.InstalledVersion] +} + +// GetSortedReleases returns the releases in order of version. +func (s *PlatformSummary) GetSortedReleases() []*PlatformRelease { + res := []*PlatformRelease{} + for _, release := range s.GetReleases() { + res = append(res, release) + } + sort.SliceStable(res, func(i, j int) bool { + return semver.ParseRelaxed(res[i].Version).LessThan(semver.ParseRelaxed(res[j].Version)) + }) + return res +} diff --git a/rpc/cc/arduino/cli/commands/v1/common.pb.go b/rpc/cc/arduino/cli/commands/v1/common.pb.go index 90453bd45ea..fe1f4e1f700 100644 --- a/rpc/cc/arduino/cli/commands/v1/common.pb.go +++ b/rpc/cc/arduino/cli/commands/v1/common.pb.go @@ -488,47 +488,17 @@ func (x *Programmer) GetName() string { return "" } +// Platform is a structure containing all the information about a single +// platform release. type Platform struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Platform ID (e.g., `arduino:avr`). - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Version of the platform. - Installed string `protobuf:"bytes,2,opt,name=installed,proto3" json:"installed,omitempty"` - // Newest available version of the platform. - Latest string `protobuf:"bytes,3,opt,name=latest,proto3" json:"latest,omitempty"` - // Name used to identify the platform to humans (e.g., "Arduino AVR Boards"). - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - // Maintainer of the platform's package. - Maintainer string `protobuf:"bytes,5,opt,name=maintainer,proto3" json:"maintainer,omitempty"` - // A URL provided by the author of the platform's package, intended to point - // to their website. - Website string `protobuf:"bytes,6,opt,name=website,proto3" json:"website,omitempty"` - // Email of the maintainer of the platform's package. - Email string `protobuf:"bytes,7,opt,name=email,proto3" json:"email,omitempty"` - // List of boards provided by the platform. If the platform is installed, - // this is the boards listed in the platform's boards.txt. If the platform is - // not installed, this is an arbitrary list of board names provided by the - // platform author for display and may not match boards.txt. - Boards []*Board `protobuf:"bytes,8,rep,name=boards,proto3" json:"boards,omitempty"` - // If true this Platform has been installed manually in the user' sketchbook - // hardware folder - ManuallyInstalled bool `protobuf:"varint,9,opt,name=manually_installed,json=manuallyInstalled,proto3" json:"manually_installed,omitempty"` - // If true this Platform has been deprecated - Deprecated bool `protobuf:"varint,10,opt,name=deprecated,proto3" json:"deprecated,omitempty"` - // Type of the platform. - Type []string `protobuf:"bytes,11,rep,name=type,proto3" json:"type,omitempty"` - // A URL provided by the author of the platform's package, intended to point - // to their online help service. - Help *HelpResources `protobuf:"bytes,12,opt,name=help,proto3" json:"help,omitempty"` - // If true the platform is indexed - Indexed bool `protobuf:"varint,13,opt,name=indexed,proto3" json:"indexed,omitempty"` - // This field is true when the platform is installed with the Arduino IDE 1.8. - // If the platform is also not indexed it may fail to work correctly in some - // circumstances, and it may need to be re-installed. - MissingMetadata bool `protobuf:"varint,14,opt,name=missing_metadata,json=missingMetadata,proto3" json:"missing_metadata,omitempty"` + // Generic information about a platform + Metadata *PlatformMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Information about a specific release of a platform + Release *PlatformRelease `protobuf:"bytes,2,opt,name=release,proto3" json:"release,omitempty"` } func (x *Platform) Reset() { @@ -563,100 +533,320 @@ func (*Platform) Descriptor() ([]byte, []int) { return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{7} } -func (x *Platform) GetId() string { +func (x *Platform) GetMetadata() *PlatformMetadata { if x != nil { - return x.Id + return x.Metadata } - return "" + return nil } -func (x *Platform) GetInstalled() string { +func (x *Platform) GetRelease() *PlatformRelease { if x != nil { - return x.Installed + return x.Release + } + return nil +} + +// PlatformSummary is a structure containing all the information about +// a platform and all its available releases. +type PlatformSummary struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Generic information about a platform + Metadata *PlatformMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Maps version to the corresponding PlatformRelease + 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 + LatestVersion string `protobuf:"bytes,4,opt,name=latest_version,json=latestVersion,proto3" json:"latest_version,omitempty"` +} + +func (x *PlatformSummary) Reset() { + *x = PlatformSummary{} + if protoimpl.UnsafeEnabled { + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlatformSummary) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlatformSummary) ProtoMessage() {} + +func (x *PlatformSummary) ProtoReflect() protoreflect.Message { + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PlatformSummary.ProtoReflect.Descriptor instead. +func (*PlatformSummary) Descriptor() ([]byte, []int) { + return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{8} +} + +func (x *PlatformSummary) GetMetadata() *PlatformMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *PlatformSummary) GetReleases() map[string]*PlatformRelease { + if x != nil { + return x.Releases + } + return nil +} + +func (x *PlatformSummary) GetInstalledVersion() string { + if x != nil { + return x.InstalledVersion } return "" } -func (x *Platform) GetLatest() string { +func (x *PlatformSummary) GetLatestVersion() string { if x != nil { - return x.Latest + return x.LatestVersion } return "" } -func (x *Platform) GetName() string { +// PlatformMetadata contains generic information about a platform (not +// correlated to a specific release). +type PlatformMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Platform ID (e.g., `arduino:avr`). + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Maintainer of the platform's package. + Maintainer string `protobuf:"bytes,2,opt,name=maintainer,proto3" json:"maintainer,omitempty"` + // A URL provided by the author of the platform's package, intended to point + // to their website. + Website string `protobuf:"bytes,3,opt,name=website,proto3" json:"website,omitempty"` + // Email of the maintainer of the platform's package. + Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` + // If true this Platform has been installed manually in the user' sketchbook + // hardware folder + ManuallyInstalled bool `protobuf:"varint,5,opt,name=manually_installed,json=manuallyInstalled,proto3" json:"manually_installed,omitempty"` + // True if the latest release of this Platform has been deprecated + Deprecated bool `protobuf:"varint,6,opt,name=deprecated,proto3" json:"deprecated,omitempty"` + // If true the platform is indexed + Indexed bool `protobuf:"varint,7,opt,name=indexed,proto3" json:"indexed,omitempty"` +} + +func (x *PlatformMetadata) Reset() { + *x = PlatformMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlatformMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlatformMetadata) ProtoMessage() {} + +func (x *PlatformMetadata) ProtoReflect() protoreflect.Message { + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PlatformMetadata.ProtoReflect.Descriptor instead. +func (*PlatformMetadata) Descriptor() ([]byte, []int) { + return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{9} +} + +func (x *PlatformMetadata) GetId() string { if x != nil { - return x.Name + return x.Id } return "" } -func (x *Platform) GetMaintainer() string { +func (x *PlatformMetadata) GetMaintainer() string { if x != nil { return x.Maintainer } return "" } -func (x *Platform) GetWebsite() string { +func (x *PlatformMetadata) GetWebsite() string { if x != nil { return x.Website } return "" } -func (x *Platform) GetEmail() string { +func (x *PlatformMetadata) GetEmail() string { if x != nil { return x.Email } return "" } -func (x *Platform) GetBoards() []*Board { +func (x *PlatformMetadata) GetManuallyInstalled() bool { if x != nil { - return x.Boards + return x.ManuallyInstalled } - return nil + return false } -func (x *Platform) GetManuallyInstalled() bool { +func (x *PlatformMetadata) GetDeprecated() bool { if x != nil { - return x.ManuallyInstalled + return x.Deprecated } return false } -func (x *Platform) GetDeprecated() bool { +func (x *PlatformMetadata) GetIndexed() bool { if x != nil { - return x.Deprecated + return x.Indexed } return false } -func (x *Platform) GetType() []string { +// PlatformRelease contains information about a specific release of a platform. +type PlatformRelease struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name used to identify the platform to humans (e.g., "Arduino AVR Boards"). + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Version of the platform release + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + // Type of the platform. + Type []string `protobuf:"bytes,3,rep,name=type,proto3" json:"type,omitempty"` + // True if the platform is installed + Installed bool `protobuf:"varint,4,opt,name=installed,proto3" json:"installed,omitempty"` + // List of boards provided by the platform. If the platform is installed, + // this is the boards listed in the platform's boards.txt. If the platform is + // not installed, this is an arbitrary list of board names provided by the + // platform author for display and may not match boards.txt. + Boards []*Board `protobuf:"bytes,5,rep,name=boards,proto3" json:"boards,omitempty"` + // A URL provided by the author of the platform's package, intended to point + // to their online help service. + Help *HelpResources `protobuf:"bytes,6,opt,name=help,proto3" json:"help,omitempty"` + // This field is true if the platform is missing installation metadata (this + // happens if the platform has been installed with the legacy Arduino IDE + // <=1.8.x). If the platform miss metadata and it's not indexed through a + // package index, it may fail to work correctly in some circumstances, and it + // may need to be reinstalled. This should be evaluated only when the + // PlatformRelease is `Installed` otherwise is an undefined behaviour. + 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"` +} + +func (x *PlatformRelease) Reset() { + *x = PlatformRelease{} + if protoimpl.UnsafeEnabled { + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlatformRelease) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlatformRelease) ProtoMessage() {} + +func (x *PlatformRelease) ProtoReflect() protoreflect.Message { + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PlatformRelease.ProtoReflect.Descriptor instead. +func (*PlatformRelease) Descriptor() ([]byte, []int) { + return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{10} +} + +func (x *PlatformRelease) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PlatformRelease) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *PlatformRelease) GetType() []string { if x != nil { return x.Type } return nil } -func (x *Platform) GetHelp() *HelpResources { +func (x *PlatformRelease) GetInstalled() bool { + if x != nil { + return x.Installed + } + return false +} + +func (x *PlatformRelease) GetBoards() []*Board { + if x != nil { + return x.Boards + } + return nil +} + +func (x *PlatformRelease) GetHelp() *HelpResources { if x != nil { return x.Help } return nil } -func (x *Platform) GetIndexed() bool { +func (x *PlatformRelease) GetMissingMetadata() bool { if x != nil { - return x.Indexed + return x.MissingMetadata } return false } -func (x *Platform) GetMissingMetadata() bool { +func (x *PlatformRelease) GetDeprecated() bool { if x != nil { - return x.MissingMetadata + return x.Deprecated } return false } @@ -679,7 +869,7 @@ type InstalledPlatformReference struct { func (x *InstalledPlatformReference) Reset() { *x = InstalledPlatformReference{} if protoimpl.UnsafeEnabled { - mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[8] + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -692,7 +882,7 @@ func (x *InstalledPlatformReference) String() string { func (*InstalledPlatformReference) ProtoMessage() {} func (x *InstalledPlatformReference) ProtoReflect() protoreflect.Message { - mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[8] + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -705,7 +895,7 @@ func (x *InstalledPlatformReference) ProtoReflect() protoreflect.Message { // Deprecated: Use InstalledPlatformReference.ProtoReflect.Descriptor instead. func (*InstalledPlatformReference) Descriptor() ([]byte, []int) { - return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{8} + return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{11} } func (x *InstalledPlatformReference) GetId() string { @@ -751,7 +941,7 @@ type Board struct { func (x *Board) Reset() { *x = Board{} if protoimpl.UnsafeEnabled { - mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[9] + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -764,7 +954,7 @@ func (x *Board) String() string { func (*Board) ProtoMessage() {} func (x *Board) ProtoReflect() protoreflect.Message { - mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[9] + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -777,7 +967,7 @@ func (x *Board) ProtoReflect() protoreflect.Message { // Deprecated: Use Board.ProtoReflect.Descriptor instead. func (*Board) Descriptor() ([]byte, []int) { - return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{9} + return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{12} } func (x *Board) GetName() string { @@ -808,7 +998,7 @@ type Profile struct { func (x *Profile) Reset() { *x = Profile{} if protoimpl.UnsafeEnabled { - mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[10] + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -821,7 +1011,7 @@ func (x *Profile) String() string { func (*Profile) ProtoMessage() {} func (x *Profile) ProtoReflect() protoreflect.Message { - mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[10] + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -834,7 +1024,7 @@ func (x *Profile) ProtoReflect() protoreflect.Message { // Deprecated: Use Profile.ProtoReflect.Descriptor instead. func (*Profile) Descriptor() ([]byte, []int) { - return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{10} + return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{13} } func (x *Profile) GetName() string { @@ -864,7 +1054,7 @@ type HelpResources struct { func (x *HelpResources) Reset() { *x = HelpResources{} if protoimpl.UnsafeEnabled { - mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[11] + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -877,7 +1067,7 @@ func (x *HelpResources) String() string { func (*HelpResources) ProtoMessage() {} func (x *HelpResources) ProtoReflect() protoreflect.Message { - mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[11] + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -890,7 +1080,7 @@ func (x *HelpResources) ProtoReflect() protoreflect.Message { // Deprecated: Use HelpResources.ProtoReflect.Descriptor instead. func (*HelpResources) Descriptor() ([]byte, []int) { - return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{11} + return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{14} } func (x *HelpResources) GetOnline() string { @@ -951,59 +1141,96 @@ var file_cc_arduino_cli_commands_v1_common_proto_rawDesc = []byte{ 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xd6, 0x03, 0x0a, 0x08, 0x50, 0x6c, 0x61, - 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, - 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, - 0x6c, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x1e, 0x0a, 0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x05, 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, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, - 0x69, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, - 0x39, 0x0a, 0x06, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x73, 0x18, 0x08, 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, 0x2d, 0x0a, 0x12, 0x6d, 0x61, - 0x6e, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, - 0x18, 0x09, 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, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, - 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x3d, 0x0a, - 0x04, 0x68, 0x65, 0x6c, 0x70, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x63, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x9b, 0x01, 0x0a, 0x08, 0x50, 0x6c, 0x61, + 0x74, 0x66, 0x6f, 0x72, 0x6d, 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, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x45, 0x0a, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 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, 0x07, 0x72, + 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, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, + 0x72, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x55, 0x0a, 0x08, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 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, 0x53, 0x75, 0x6d, 0x6d, + 0x61, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x08, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 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, 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, 0xb6, 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, 0x48, 0x65, 0x6c, 0x70, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x12, 0x18, 0x0a, 0x07, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, - 0x67, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 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, + 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, + 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 ( @@ -1018,7 +1245,7 @@ func file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP() []byte { return file_cc_arduino_cli_commands_v1_common_proto_rawDescData } -var file_cc_arduino_cli_commands_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_cc_arduino_cli_commands_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 16) var file_cc_arduino_cli_commands_v1_common_proto_goTypes = []interface{}{ (*Instance)(nil), // 0: cc.arduino.cli.commands.v1.Instance (*DownloadProgress)(nil), // 1: cc.arduino.cli.commands.v1.DownloadProgress @@ -1028,22 +1255,31 @@ var file_cc_arduino_cli_commands_v1_common_proto_goTypes = []interface{}{ (*TaskProgress)(nil), // 5: cc.arduino.cli.commands.v1.TaskProgress (*Programmer)(nil), // 6: cc.arduino.cli.commands.v1.Programmer (*Platform)(nil), // 7: cc.arduino.cli.commands.v1.Platform - (*InstalledPlatformReference)(nil), // 8: cc.arduino.cli.commands.v1.InstalledPlatformReference - (*Board)(nil), // 9: cc.arduino.cli.commands.v1.Board - (*Profile)(nil), // 10: cc.arduino.cli.commands.v1.Profile - (*HelpResources)(nil), // 11: cc.arduino.cli.commands.v1.HelpResources + (*PlatformSummary)(nil), // 8: cc.arduino.cli.commands.v1.PlatformSummary + (*PlatformMetadata)(nil), // 9: cc.arduino.cli.commands.v1.PlatformMetadata + (*PlatformRelease)(nil), // 10: cc.arduino.cli.commands.v1.PlatformRelease + (*InstalledPlatformReference)(nil), // 11: cc.arduino.cli.commands.v1.InstalledPlatformReference + (*Board)(nil), // 12: cc.arduino.cli.commands.v1.Board + (*Profile)(nil), // 13: cc.arduino.cli.commands.v1.Profile + (*HelpResources)(nil), // 14: cc.arduino.cli.commands.v1.HelpResources + nil, // 15: cc.arduino.cli.commands.v1.PlatformSummary.ReleasesEntry } var file_cc_arduino_cli_commands_v1_common_proto_depIdxs = []int32{ 2, // 0: cc.arduino.cli.commands.v1.DownloadProgress.start:type_name -> cc.arduino.cli.commands.v1.DownloadProgressStart 3, // 1: cc.arduino.cli.commands.v1.DownloadProgress.update:type_name -> cc.arduino.cli.commands.v1.DownloadProgressUpdate 4, // 2: cc.arduino.cli.commands.v1.DownloadProgress.end:type_name -> cc.arduino.cli.commands.v1.DownloadProgressEnd - 9, // 3: cc.arduino.cli.commands.v1.Platform.boards:type_name -> cc.arduino.cli.commands.v1.Board - 11, // 4: cc.arduino.cli.commands.v1.Platform.help:type_name -> cc.arduino.cli.commands.v1.HelpResources - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 9, // 3: cc.arduino.cli.commands.v1.Platform.metadata:type_name -> cc.arduino.cli.commands.v1.PlatformMetadata + 10, // 4: cc.arduino.cli.commands.v1.Platform.release:type_name -> cc.arduino.cli.commands.v1.PlatformRelease + 9, // 5: cc.arduino.cli.commands.v1.PlatformSummary.metadata:type_name -> cc.arduino.cli.commands.v1.PlatformMetadata + 15, // 6: cc.arduino.cli.commands.v1.PlatformSummary.releases:type_name -> cc.arduino.cli.commands.v1.PlatformSummary.ReleasesEntry + 12, // 7: cc.arduino.cli.commands.v1.PlatformRelease.boards:type_name -> cc.arduino.cli.commands.v1.Board + 14, // 8: cc.arduino.cli.commands.v1.PlatformRelease.help:type_name -> cc.arduino.cli.commands.v1.HelpResources + 10, // 9: cc.arduino.cli.commands.v1.PlatformSummary.ReleasesEntry.value:type_name -> cc.arduino.cli.commands.v1.PlatformRelease + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_cc_arduino_cli_commands_v1_common_proto_init() } @@ -1149,7 +1385,7 @@ func file_cc_arduino_cli_commands_v1_common_proto_init() { } } file_cc_arduino_cli_commands_v1_common_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InstalledPlatformReference); i { + switch v := v.(*PlatformSummary); i { case 0: return &v.state case 1: @@ -1161,7 +1397,7 @@ func file_cc_arduino_cli_commands_v1_common_proto_init() { } } file_cc_arduino_cli_commands_v1_common_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Board); i { + switch v := v.(*PlatformMetadata); i { case 0: return &v.state case 1: @@ -1173,7 +1409,7 @@ func file_cc_arduino_cli_commands_v1_common_proto_init() { } } file_cc_arduino_cli_commands_v1_common_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Profile); i { + switch v := v.(*PlatformRelease); i { case 0: return &v.state case 1: @@ -1185,6 +1421,42 @@ func file_cc_arduino_cli_commands_v1_common_proto_init() { } } file_cc_arduino_cli_commands_v1_common_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InstalledPlatformReference); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cc_arduino_cli_commands_v1_common_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Board); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cc_arduino_cli_commands_v1_common_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Profile); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cc_arduino_cli_commands_v1_common_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HelpResources); i { case 0: return &v.state @@ -1208,7 +1480,7 @@ func file_cc_arduino_cli_commands_v1_common_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cc_arduino_cli_commands_v1_common_proto_rawDesc, NumEnums: 0, - NumMessages: 12, + NumMessages: 16, NumExtensions: 0, NumServices: 0, }, diff --git a/rpc/cc/arduino/cli/commands/v1/common.proto b/rpc/cc/arduino/cli/commands/v1/common.proto index 3cb0425872f..fae80bab09b 100644 --- a/rpc/cc/arduino/cli/commands/v1/common.proto +++ b/rpc/cc/arduino/cli/commands/v1/common.proto @@ -71,43 +71,76 @@ message Programmer { string name = 3; } +// Platform is a structure containing all the information about a single +// platform release. message Platform { + // Generic information about a platform + PlatformMetadata metadata = 1; + // Information about a specific release of a platform + PlatformRelease release = 2; +} + +// PlatformSummary is a structure containing all the information about +// a platform and all its available releases. +message PlatformSummary { + // Generic information about a platform + PlatformMetadata metadata = 1; + // Maps version to the corresponding PlatformRelease + map<string, PlatformRelease> 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 + string latest_version = 4; +} + +// PlatformMetadata contains generic information about a platform (not +// correlated to a specific release). +message PlatformMetadata { // Platform ID (e.g., `arduino:avr`). string id = 1; - // Version of the platform. - string installed = 2; - // Newest available version of the platform. - string latest = 3; - // Name used to identify the platform to humans (e.g., "Arduino AVR Boards"). - string name = 4; // Maintainer of the platform's package. - string maintainer = 5; + string maintainer = 2; // A URL provided by the author of the platform's package, intended to point // to their website. - string website = 6; + string website = 3; // Email of the maintainer of the platform's package. - string email = 7; + string email = 4; + // If true this Platform has been installed manually in the user' sketchbook + // hardware folder + bool manually_installed = 5; + // True if the latest release of this Platform has been deprecated + bool deprecated = 6; + // If true the platform is indexed + bool indexed = 7; +} + +// PlatformRelease contains information about a specific release of a platform. +message PlatformRelease { + // Name used to identify the platform to humans (e.g., "Arduino AVR Boards"). + string name = 1; + // Version of the platform release + string version = 2; + // Type of the platform. + repeated string type = 3; + // True if the platform is installed + bool installed = 4; // List of boards provided by the platform. If the platform is installed, // this is the boards listed in the platform's boards.txt. If the platform is // not installed, this is an arbitrary list of board names provided by the // platform author for display and may not match boards.txt. - repeated Board boards = 8; - // If true this Platform has been installed manually in the user' sketchbook - // hardware folder - bool manually_installed = 9; - // If true this Platform has been deprecated - bool deprecated = 10; - // Type of the platform. - repeated string type = 11; + repeated Board boards = 5; // A URL provided by the author of the platform's package, intended to point // to their online help service. - HelpResources help = 12; - // If true the platform is indexed - bool indexed = 13; - // This field is true when the platform is installed with the Arduino IDE 1.8. - // If the platform is also not indexed it may fail to work correctly in some - // circumstances, and it may need to be re-installed. - bool missing_metadata = 14; + HelpResources help = 6; + // This field is true if the platform is missing installation metadata (this + // happens if the platform has been installed with the legacy Arduino IDE + // <=1.8.x). If the platform miss metadata and it's not indexed through a + // package index, it may fail to work correctly in some circumstances, and it + // may need to be reinstalled. This should be evaluated only when the + // PlatformRelease is `Installed` otherwise is an undefined behaviour. + bool missing_metadata = 7; + // True this release is deprecated + bool deprecated = 8; } message InstalledPlatformReference { diff --git a/rpc/cc/arduino/cli/commands/v1/core.pb.go b/rpc/cc/arduino/cli/commands/v1/core.pb.go index c12b21374d0..dca289c80fd 100644 --- a/rpc/cc/arduino/cli/commands/v1/core.pb.go +++ b/rpc/cc/arduino/cli/commands/v1/core.pb.go @@ -685,6 +685,9 @@ type PlatformSearchRequest struct { // Whether to show all available versions. `false` causes only the newest // versions of the cores to be listed in the search results. AllVersions bool `protobuf:"varint,3,opt,name=all_versions,json=allVersions,proto3" json:"all_versions,omitempty"` + // Whether to show manually installed platforms. `false` causes to skip + // manually installed platforms. + ManuallyInstalled bool `protobuf:"varint,4,opt,name=manually_installed,json=manuallyInstalled,proto3" json:"manually_installed,omitempty"` } func (x *PlatformSearchRequest) Reset() { @@ -740,13 +743,20 @@ func (x *PlatformSearchRequest) GetAllVersions() bool { return false } +func (x *PlatformSearchRequest) GetManuallyInstalled() bool { + if x != nil { + return x.ManuallyInstalled + } + return false +} + type PlatformSearchResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Results of the search. - SearchOutput []*Platform `protobuf:"bytes,1,rep,name=search_output,json=searchOutput,proto3" json:"search_output,omitempty"` + SearchOutput []*PlatformSummary `protobuf:"bytes,1,rep,name=search_output,json=searchOutput,proto3" json:"search_output,omitempty"` } func (x *PlatformSearchResponse) Reset() { @@ -781,130 +791,13 @@ func (*PlatformSearchResponse) Descriptor() ([]byte, []int) { return file_cc_arduino_cli_commands_v1_core_proto_rawDescGZIP(), []int{11} } -func (x *PlatformSearchResponse) GetSearchOutput() []*Platform { +func (x *PlatformSearchResponse) GetSearchOutput() []*PlatformSummary { if x != nil { return x.SearchOutput } return nil } -type PlatformListRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Arduino Core Service instance from the `Init` response. - Instance *Instance `protobuf:"bytes,1,opt,name=instance,proto3" json:"instance,omitempty"` - // Set to true to only list platforms which have a newer version available - // than the one currently installed. - UpdatableOnly bool `protobuf:"varint,2,opt,name=updatable_only,json=updatableOnly,proto3" json:"updatable_only,omitempty"` - // Set to true to list platforms installed manually in the user' sketchbook - // hardware folder, installed with the PlatformManager through the CLI or - // IDE and that are available to install - All bool `protobuf:"varint,3,opt,name=all,proto3" json:"all,omitempty"` -} - -func (x *PlatformListRequest) Reset() { - *x = PlatformListRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_cc_arduino_cli_commands_v1_core_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PlatformListRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PlatformListRequest) ProtoMessage() {} - -func (x *PlatformListRequest) ProtoReflect() protoreflect.Message { - mi := &file_cc_arduino_cli_commands_v1_core_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PlatformListRequest.ProtoReflect.Descriptor instead. -func (*PlatformListRequest) Descriptor() ([]byte, []int) { - return file_cc_arduino_cli_commands_v1_core_proto_rawDescGZIP(), []int{12} -} - -func (x *PlatformListRequest) GetInstance() *Instance { - if x != nil { - return x.Instance - } - return nil -} - -func (x *PlatformListRequest) GetUpdatableOnly() bool { - if x != nil { - return x.UpdatableOnly - } - return false -} - -func (x *PlatformListRequest) GetAll() bool { - if x != nil { - return x.All - } - return false -} - -type PlatformListResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The installed platforms. - InstalledPlatforms []*Platform `protobuf:"bytes,1,rep,name=installed_platforms,json=installedPlatforms,proto3" json:"installed_platforms,omitempty"` -} - -func (x *PlatformListResponse) Reset() { - *x = PlatformListResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cc_arduino_cli_commands_v1_core_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PlatformListResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PlatformListResponse) ProtoMessage() {} - -func (x *PlatformListResponse) ProtoReflect() protoreflect.Message { - mi := &file_cc_arduino_cli_commands_v1_core_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PlatformListResponse.ProtoReflect.Descriptor instead. -func (*PlatformListResponse) Descriptor() ([]byte, []int) { - return file_cc_arduino_cli_commands_v1_core_proto_rawDescGZIP(), []int{13} -} - -func (x *PlatformListResponse) GetInstalledPlatforms() []*Platform { - if x != nil { - return x.InstalledPlatforms - } - return nil -} - var File_cc_arduino_cli_commands_v1_core_proto protoreflect.FileDescriptor var file_cc_arduino_cli_commands_v1_core_proto_rawDesc = []byte{ @@ -1020,7 +913,7 @@ var file_cc_arduino_cli_commands_v1_core_proto_rawDesc = []byte{ 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 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, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x22, 0x9d, 0x01, + 0x6f, 0x72, 0x6d, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x22, 0xcc, 0x01, 0x0a, 0x15, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x63, 0x2e, 0x61, @@ -1030,35 +923,22 @@ var file_cc_arduino_cli_commands_v1_core_proto_rawDesc = []byte{ 0x72, 0x63, 0x68, 0x5f, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x72, 0x67, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x6c, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0b, 0x61, 0x6c, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x63, 0x0a, - 0x16, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0d, 0x73, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, - 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, 0x0c, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x75, 0x74, 0x70, - 0x75, 0x74, 0x22, 0x90, 0x01, 0x0a, 0x13, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x08, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 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, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, - 0x63, 0x65, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4f, - 0x6e, 0x6c, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x22, 0x6d, 0x0a, 0x14, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, - 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, - 0x13, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 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, 0x12, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x50, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x73, 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, 0x0b, 0x61, 0x6c, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2d, 0x0a, + 0x12, 0x6d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x6d, 0x61, 0x6e, 0x75, 0x61, + 0x6c, 0x6c, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x22, 0x6a, 0x0a, 0x16, + 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0d, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x03, 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, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x0c, 0x73, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 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 ( @@ -1073,7 +953,7 @@ func file_cc_arduino_cli_commands_v1_core_proto_rawDescGZIP() []byte { return file_cc_arduino_cli_commands_v1_core_proto_rawDescData } -var file_cc_arduino_cli_commands_v1_core_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_cc_arduino_cli_commands_v1_core_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_cc_arduino_cli_commands_v1_core_proto_goTypes = []interface{}{ (*PlatformInstallRequest)(nil), // 0: cc.arduino.cli.commands.v1.PlatformInstallRequest (*PlatformInstallResponse)(nil), // 1: cc.arduino.cli.commands.v1.PlatformInstallResponse @@ -1087,34 +967,31 @@ var file_cc_arduino_cli_commands_v1_core_proto_goTypes = []interface{}{ (*PlatformUpgradeResponse)(nil), // 9: cc.arduino.cli.commands.v1.PlatformUpgradeResponse (*PlatformSearchRequest)(nil), // 10: cc.arduino.cli.commands.v1.PlatformSearchRequest (*PlatformSearchResponse)(nil), // 11: cc.arduino.cli.commands.v1.PlatformSearchResponse - (*PlatformListRequest)(nil), // 12: cc.arduino.cli.commands.v1.PlatformListRequest - (*PlatformListResponse)(nil), // 13: cc.arduino.cli.commands.v1.PlatformListResponse - (*Instance)(nil), // 14: cc.arduino.cli.commands.v1.Instance - (*DownloadProgress)(nil), // 15: cc.arduino.cli.commands.v1.DownloadProgress - (*TaskProgress)(nil), // 16: cc.arduino.cli.commands.v1.TaskProgress - (*Platform)(nil), // 17: cc.arduino.cli.commands.v1.Platform + (*Instance)(nil), // 12: cc.arduino.cli.commands.v1.Instance + (*DownloadProgress)(nil), // 13: cc.arduino.cli.commands.v1.DownloadProgress + (*TaskProgress)(nil), // 14: cc.arduino.cli.commands.v1.TaskProgress + (*Platform)(nil), // 15: cc.arduino.cli.commands.v1.Platform + (*PlatformSummary)(nil), // 16: cc.arduino.cli.commands.v1.PlatformSummary } var file_cc_arduino_cli_commands_v1_core_proto_depIdxs = []int32{ - 14, // 0: cc.arduino.cli.commands.v1.PlatformInstallRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 15, // 1: cc.arduino.cli.commands.v1.PlatformInstallResponse.progress:type_name -> cc.arduino.cli.commands.v1.DownloadProgress - 16, // 2: cc.arduino.cli.commands.v1.PlatformInstallResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress - 14, // 3: cc.arduino.cli.commands.v1.PlatformDownloadRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 15, // 4: cc.arduino.cli.commands.v1.PlatformDownloadResponse.progress:type_name -> cc.arduino.cli.commands.v1.DownloadProgress - 14, // 5: cc.arduino.cli.commands.v1.PlatformUninstallRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 16, // 6: cc.arduino.cli.commands.v1.PlatformUninstallResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress - 14, // 7: cc.arduino.cli.commands.v1.PlatformUpgradeRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 15, // 8: cc.arduino.cli.commands.v1.PlatformUpgradeResponse.progress:type_name -> cc.arduino.cli.commands.v1.DownloadProgress - 16, // 9: cc.arduino.cli.commands.v1.PlatformUpgradeResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress - 17, // 10: cc.arduino.cli.commands.v1.PlatformUpgradeResponse.platform:type_name -> cc.arduino.cli.commands.v1.Platform - 14, // 11: cc.arduino.cli.commands.v1.PlatformSearchRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 17, // 12: cc.arduino.cli.commands.v1.PlatformSearchResponse.search_output:type_name -> cc.arduino.cli.commands.v1.Platform - 14, // 13: cc.arduino.cli.commands.v1.PlatformListRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 17, // 14: cc.arduino.cli.commands.v1.PlatformListResponse.installed_platforms:type_name -> cc.arduino.cli.commands.v1.Platform - 15, // [15:15] is the sub-list for method output_type - 15, // [15:15] is the sub-list for method input_type - 15, // [15:15] is the sub-list for extension type_name - 15, // [15:15] is the sub-list for extension extendee - 0, // [0:15] is the sub-list for field type_name + 12, // 0: cc.arduino.cli.commands.v1.PlatformInstallRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 13, // 1: cc.arduino.cli.commands.v1.PlatformInstallResponse.progress:type_name -> cc.arduino.cli.commands.v1.DownloadProgress + 14, // 2: cc.arduino.cli.commands.v1.PlatformInstallResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress + 12, // 3: cc.arduino.cli.commands.v1.PlatformDownloadRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 13, // 4: cc.arduino.cli.commands.v1.PlatformDownloadResponse.progress:type_name -> cc.arduino.cli.commands.v1.DownloadProgress + 12, // 5: cc.arduino.cli.commands.v1.PlatformUninstallRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 14, // 6: cc.arduino.cli.commands.v1.PlatformUninstallResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress + 12, // 7: cc.arduino.cli.commands.v1.PlatformUpgradeRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 13, // 8: cc.arduino.cli.commands.v1.PlatformUpgradeResponse.progress:type_name -> cc.arduino.cli.commands.v1.DownloadProgress + 14, // 9: cc.arduino.cli.commands.v1.PlatformUpgradeResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress + 15, // 10: cc.arduino.cli.commands.v1.PlatformUpgradeResponse.platform:type_name -> cc.arduino.cli.commands.v1.Platform + 12, // 11: cc.arduino.cli.commands.v1.PlatformSearchRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 16, // 12: cc.arduino.cli.commands.v1.PlatformSearchResponse.search_output:type_name -> cc.arduino.cli.commands.v1.PlatformSummary + 13, // [13:13] is the sub-list for method output_type + 13, // [13:13] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_cc_arduino_cli_commands_v1_core_proto_init() } @@ -1268,30 +1145,6 @@ func file_cc_arduino_cli_commands_v1_core_proto_init() { return nil } } - file_cc_arduino_cli_commands_v1_core_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PlatformListRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cc_arduino_cli_commands_v1_core_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PlatformListResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } type x struct{} out := protoimpl.TypeBuilder{ @@ -1299,7 +1152,7 @@ func file_cc_arduino_cli_commands_v1_core_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cc_arduino_cli_commands_v1_core_proto_rawDesc, NumEnums: 0, - NumMessages: 14, + NumMessages: 12, NumExtensions: 0, NumServices: 0, }, diff --git a/rpc/cc/arduino/cli/commands/v1/core.proto b/rpc/cc/arduino/cli/commands/v1/core.proto index 70ec4d46886..67aa0b214c7 100644 --- a/rpc/cc/arduino/cli/commands/v1/core.proto +++ b/rpc/cc/arduino/cli/commands/v1/core.proto @@ -118,26 +118,12 @@ message PlatformSearchRequest { // Whether to show all available versions. `false` causes only the newest // versions of the cores to be listed in the search results. bool all_versions = 3; + // Whether to show manually installed platforms. `false` causes to skip + // manually installed platforms. + bool manually_installed = 4; } message PlatformSearchResponse { // Results of the search. - repeated Platform search_output = 1; -} - -message PlatformListRequest { - // Arduino Core Service instance from the `Init` response. - Instance instance = 1; - // Set to true to only list platforms which have a newer version available - // than the one currently installed. - bool updatable_only = 2; - // Set to true to list platforms installed manually in the user' sketchbook - // hardware folder, installed with the PlatformManager through the CLI or - // IDE and that are available to install - bool all = 3; -} - -message PlatformListResponse { - // The installed platforms. - repeated Platform installed_platforms = 1; + repeated PlatformSummary search_output = 1; }