8000 [breaking] Updated gRPC Platform API by cmaglie · Pull Request #2357 · arduino/arduino-cli · GitHub
[go: up one dir, main page]

Skip to content

[breaking] Updated gRPC Platform API #2357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Oct 23, 2023
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
28f1f71
Updated gRPC Pltform API, regenerated API
cmaglie Oct 6, 2023
86b171d
Adapted cores.Platform and PlatformRelease to the new gRPC API
cmaglie Oct 16, 2023
2031172
Fixed search_test.go
cmaglie Oct 16, 2023
28cc496
Removed gRPC PlatformList command
cmaglie Oct 16, 2023
24a1dd3
Other adaptation of platform structures
cmaglie Oct 16, 2023
9d2fd89
Adapt arguuments completion to use PlatformSearch instead of Platform…
cmaglie Oct 16, 2023
c80d0ff
Adapt 'core list' to use PlatformSearch instead of PlatformList
cmaglie Oct 16, 2023
175a6d2
Adapt 'core upgrade' command to use PlatformSearch instead of Platfor…
cmaglie Oct 16, 2023
3b41351
Adapted some integration tests
cmaglie Oct 16, 2023
3c7bc1a
Fix integreation test
cmaglie Oct 9, 2023
0a055a6
apply changes to search vidpid
alessio-perugini Oct 10, 2023
f11b45d
Better handling of 'core list' results
cmaglie Oct 10, 2023
abe05fa
Better handling of 'core search' results
cmaglie Oct 10, 2023
7f3a6cb
Better handling of 'core outdated' results
cmaglie Oct 10, 2023
aca91e6
add 'orderedmap' data structure
alessio-perugini Oct 10, 2023
b8ae4f3
Made orderedmap more generic
cmaglie Oct 11, 2023
8c98f74
fix regression on 'ParseReference'
alessio-perugini Oct 11, 2023
6a6897b
wip: fix 'core' integrationtests
alessio-perugini Oct 11, 2023
7ad2ca4
wip: fix 'core' sorting tests
alessio-perugini Oct 11, 2023
cccf397
fix regression which skipped mannually instaled core in core list
alessio-perugini Oct 12, 2023
8b8ce96
wip: add more 'core' integration tests
alessio-perugini Oct 12, 2023
3cee33b
regression: all flag takes precedence above updatable in core list
alessio-perugini Oct 12, 2023
064f57f
lint: ignore unexported-return (revive)
alessio-perugini Oct 12, 2023
ea0854e
license: regenerate and add missin headers
alessio-perugini Oct 12, 2023 8000
64a2631
tests: fix 'board' integrations
alessio-perugini Oct 12, 2023
d010385
fix: regression not showing manually installed platform in 'core list'
alessio-perugini Oct 12, 2023
1d4b9e2
wip: add test to orderedmap
alessio-perugini Oct 12, 2023
87ea190
add more orderdmap tests
alessio-perugini Oct 13, 2023
655a5af
orderdmap: add json tests
alessio-perugini Oct 13, 2023
5fd313c
update DOCS
alessio-perugini Oct 13, 2023
d9dd825
apply CR suggestions
alessio-perugini Oct 16, 2023
494e923
fix proto numeration
alessio-perugini Oct 19, 2023
8528612
docs: update to release 0.36.0
alessio-perugini Oct 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adapt 'core list' to use PlatformSearch instead of PlatformList
  • Loading branch information
cmaglie authored and alessio-perugini committed Oct 23, 2023
commit c80d0ffefe97d66e4991f656b3f1d537400fbefd
38 changes: 27 additions & 11 deletions internal/cli/core/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,32 @@ func List(inst *rpc.Instance, all bool, updatableOnly bool) {
}

// 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,
})
if err != nil {
feedback.Fatal(tr("Error listing platforms: %v", err), feedback.ErrGeneric)
}
return platf B02C orms.InstalledPlatforms

result := []*rpc.PlatformSummary{}
for _, platform := range platforms.GetSearchOutput() {
if !all && platform.InstalledVersion == "" {
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
platforms []*rpc.PlatformSummary
}

func (ir installedResult) Data() interface{} {
Expand All @@ -87,12 +97,18 @@ func (ir installedResult) String() string {
}
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 {
installedRelease := platform.GetInstalledRelease()
latestRelease := platform.GetLatestRelease()

name := installedRelease.GetName()
if name == "" {
name = latestRelease.GetName()
}
if platform.Metadata.Deprecated {
name = fmt.Sprintf("[%s] %s", tr("DEPRECATED"), name)
}
t.AddRow(p.Id, p.Installed, p.Latest, name)
t.AddRow(platform.Metadata.Id, platform.InstalledVersion, platform.LatestVersion, name)
}

return t.Render()
Expand Down
0