-
-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[breaking] Updated gRPC Platform API (#2357)
* Updated gRPC Pltform API, regenerated API * Adapted cores.Platform and PlatformRelease to the new gRPC API * Fixed search_test.go * Removed gRPC PlatformList command * Other adaptation of platform structures * Adapt arguuments completion to use PlatformSearch instead of PlatformList * Adapt 'core list' to use PlatformSearch instead of PlatformList * Adapt 'core upgrade' command to use PlatformSearch instead of PlatformList * Adapted some integration tests * Fix integreation test * apply changes to search vidpid * Better handling of 'core list' results * Better handling of 'core search' results * Better handling of 'core outdated' results * add 'orderedmap' data structure * Made orderedmap more generic * fix regression on 'ParseReference' * wip: fix 'core' integrationtests * wip: fix 'core' sorting tests * fix regression which skipped mannually instaled core in core list * wip: add more 'core' integration tests * regression: all flag takes precedence above updatable in core list * lint: ignore unexported-return (revive) * license: regenerate and add missin headers * tests: fix 'board' integrations * fix: regression not showing manually installed platform in 'core list' * wip: add test to orderedmap * add more orderdmap tests * orderdmap: add json tests * update DOCS * apply CR suggestions * fix proto numeration * docs: update to release 0.36.0 --------- Co-authored-by: Alessio Perugini <[email protected]>
- Loading branch information
1 parent
eb8f2f2
commit ad5dacc
Showing
41 changed files
with
2,329 additions
and
1,315 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,11 +145,6 @@ func main() { | |
log.Println("calling PlatformInstall(arduino:[email protected])") | ||
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) | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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:[email protected]" || | ||
boardPlatform.String() == "arduino:[email protected]" | ||
boardPlatformRelease.String() == "arduino:[email protected]" || | ||
boardPlatformRelease.String() == "arduino:[email protected]" | ||
|
||
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, | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.