-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
Added gRPC interface to collect every sketch file #926
Conversation
Codecov link is failing again, the rest of the tests are fine. 🤷 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going to try how it behaves in the IDE. Thank you for creating the PR 👍
rpc/commands/commands.proto
Outdated
// Progress of the downloads of the platforms and libraries files. | ||
DownloadProgress progress = 2; | ||
// Description of the current stage of the upgrade. | ||
TaskProgress task_progress = 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea, I didn't manually change it, it's probably some auto formatting that I missed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not about the indentation; this is a change from 1
to 2
, and from 2
to 3
. Just asking though...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I noticed it. Still not sure how it did happen. 🤷
commands/instances.go
Outdated
func SketchLoad(ctx context.Context, req *rpc.SketchLoadReq) (*rpc.SketchLoadResp, error) { | ||
sketch, err := builder.SketchLoad(req.SketchPath, "") | ||
if err != nil { | ||
return nil, fmt.Errorf("Error loading sketch: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make req.SketchPath
as part of the error message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we could but think that some informationg is already in err
.
rpc/commands/commands.proto
Outdated
@@ -58,6 +58,9 @@ service ArduinoCore { | |||
// Get the version of Arduino CLI in use. | |||
rpc Version(VersionReq) returns (VersionResp) {} | |||
|
|||
// Returns all files composing a Sketch | |||
rpc SketchLoad(SketchLoadReq) returns (SketchLoadResp) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[minor]: Why not LoadSketch
? (verb + object)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've used the same name that's used in the builder
package: https://github.com/arduino/arduino-cli/blob/master/arduino/builder/sketch.go#L103
I can change it LoadSketch
with no issues by the way, I like the suggestion.
rpc/commands/commands.proto
Outdated
message SketchLoadReq { | ||
// Absolute path to single sketch file or a sketch folder | ||
string sketch_path = 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also include the instance
.
message SketchLoadReq {
Instance instance = 1;
// Absolute path to single sketch file or a sketch folder
string sketch_path = 2;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I do not know if it's required, but strange to not having symmetric APIs. @cmaglie, can you please help with this? Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't include it because it's actually not used by that command but I guess it costs nothing adding it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well so far, great simplification for the IDE. Thanks!
Fixed those issues you pointed out @kittaakos. |
This reverts commit 21d2533.
Please check if the PR fulfills these requirements
before creating one)
our contributing guidelines
Exposes a gRPC interface to collect all files composing a sketch.
gRPC interface is not exposed.
gRPC consumers have a way to collect all files composing a sketch.
Nope.
Fixes As a gRPC consumer, I want the CLI to collects all the files composing a sketch #837.
See how to contribute