Skip to content
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

gRPC: Use oneof clause where appropriate #2593

Closed
3 tasks done
cmaglie opened this issue May 6, 2024 · 0 comments · Fixed by #2608
Closed
3 tasks done

gRPC: Use oneof clause where appropriate #2593

cmaglie opened this issue May 6, 2024 · 0 comments · Fixed by #2608
Assignees
Labels
conclusion: resolved Issue was resolved topic: gRPC Related to the gRPC interface type: enhancement Proposed improvement

Comments

@cmaglie
Copy link
Member

cmaglie commented May 6, 2024

Describe the request

Some gRPC calls would benefit from the oneof clause, particularly all the streaming responses.

For example the PlatformInstallResponse, is currently defined as:

message PlatformInstallResponse {
  // Progress of the downloads of the platform and tool files.
  DownloadProgress progress = 1;
  // Description of the current stage of the installation.
  TaskProgress task_progress = 2;
}

could be rewritten as:

message PlatformInstallResponse {
  oneof message {
    // Progress of the downloads of the platform and tool files.
    DownloadProgress progress = 1;
    // Description of the current stage of the installation.
    TaskProgress task_progress = 2;
    // The install result.
    PlatformInstallResult result = 3;
  }
}

message PlatformInstallResult {}

making explicit the exclusive nature of the fields and reserving space for an explicit call result that could be expanded in the future.

Describe the current behavior

N/A

Arduino CLI version

nightly

Operating system

N/A

Operating system version

N/A

Additional context

Some of the gRPC calls have already been changed in a similar way, this request is to propagate the same change in all the API.

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the nightly build
  • My request contains all necessary details
@cmaglie cmaglie added the type: enhancement Proposed improvement label May 6, 2024
@cmaglie cmaglie added this to the Arduino CLI v1.0.0 milestone May 6, 2024
@cmaglie cmaglie added the topic: gRPC Related to the gRPC interface label May 6, 2024
@per1234 per1234 added the conclusion: resolved Issue was resolved label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: gRPC Related to the gRPC interface type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants