|
2 | 2 |
|
3 | 3 | Here you can find a list of migration guides to handle breaking changes between releases of the CLI.
|
4 | 4 |
|
| 5 | +## 0.28.0 |
| 6 | + |
| 7 | +### Breaking changes in UpdateIndex API (both gRPC and go-lang) |
| 8 | + |
| 9 | +The gRPC message `cc.arduino.cli.commands.v1.UpdateIndexResponse` has been changed from: |
| 10 | + |
| 11 | +``` |
| 12 | +message UpdateIndexResponse { |
| 13 | + // Progress of the platforms index download. |
| 14 | + DownloadProgress download_progress = 1; |
| 15 | +} |
| 16 | +``` |
| 17 | + |
| 18 | +to |
| 19 | + |
| 20 | +``` |
| 21 | +message UpdateIndexResponse { |
| 22 | + oneof message { |
| 23 | + // Progress of the platforms index download. |
| 24 | + DownloadProgress download_progress = 1; |
| 25 | + // Report of the index update downloads. |
| 26 | + DownloadResult download_result = 2; |
| 27 | + } |
| 28 | +} |
| 29 | +
|
| 30 | +message DownloadResult { |
| 31 | + // Index URL. |
| 32 | + string url = 1; |
| 33 | + // Download result: true if successful, false if an error occurred. |
| 34 | + bool successful = 2; |
| 35 | + // Download error details. |
| 36 | + string error = 3; |
| 37 | +} |
| 38 | +``` |
| 39 | + |
| 40 | +even if not strictly a breaking change it's worth noting that the detailed error message is now streamed in the |
| 41 | +response. About the go-lang API the following functions in `github.com/arduino/arduino-cli/commands`: |
| 42 | + |
| 43 | +```go |
| 44 | +func UpdateIndex(ctx context.Context, req *rpc.UpdateIndexRequest, downloadCB rpc.DownloadProgressCB) (*rpc.UpdateIndexResponse, error) { ... } |
| 45 | +func UpdateCoreLibrariesIndex(ctx context.Context, req *rpc.UpdateCoreLibrariesIndexRequest, downloadCB rpc.DownloadProgressCB) error { ... } |
| 46 | +``` |
| 47 | + |
| 48 | +have changed their signature to: |
| 49 | + |
| 50 | +```go |
| 51 | +func UpdateIndex(ctx context.Context, req *rpc.UpdateIndexRequest, downloadCB rpc.DownloadProgressCB, downloadResultCB rpc.DownloadResultCB) error { ... } |
| 52 | +func UpdateCoreLibrariesIndex(ctx context.Context, req *rpc.UpdateCoreLibrariesIndexRequest, downloadCB rpc.DownloadProgressCB, downloadResultCB rpc.DownloadResultCB) error { ... } |
| 53 | +``` |
| 54 | + |
| 55 | +`UpdateIndex` do not return anymore the latest `UpdateIndexResponse` (it was always empty). Both `UpdateIndex` and |
| 56 | +`UpdateCoreLibrariesIndex` now accepts an `rpc.DownloadResultCB` to get download results, you can pass an empty callback |
| 57 | +if you're not interested in the error details. |
| 58 | + |
5 | 59 | ## 0.27.0
|
6 | 60 |
|
7 | 61 | ### Breaking changes in golang API `github.com/arduino/arduino-cli/arduino/cores/packagemanager.PackageManager`
|
|
0 commit comments