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

Init reporter #655

Merged
merged 13 commits into from
Sep 3, 2024
Merged

Init reporter #655

merged 13 commits into from
Sep 3, 2024

Conversation

peraltafederico
Copy link
Contributor

@peraltafederico peraltafederico commented Aug 19, 2024

We've decided to forgo using the reporter to normalize the JSON payload and, instead, at a later stage, refactor it to report payloads to the remote backend. For now, disable the API; however, keep the types in place so it's not accidentally relied on.

Motivation

Normalize the payload before sending it to the Platform. The primary reason for this is to create a ready-to-use payload that can be sent to the Platform. Currently, it mainly filters out outputs that are not "stdout" but as we move the Platform GraphQL request to the Kernel, this behavior may change as needed.

(See also https://github.com/stateful/platform/pull/822 and stateful/vscode-runme#1558)

@@ -1,6 +1,6 @@
module github.com/stateful/runme/v3

go 1.22
go 1.22.0
Copy link
Contributor Author

@peraltafederico peraltafederico Aug 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to make it work in Linux

@peraltafederico peraltafederico marked this pull request as ready for review August 22, 2024 18:12
@peraltafederico peraltafederico requested review from pastuxso and removed request for duvanmonsa August 23, 2024 15:16

message TransformRequest {
runme.parser.v1.Notebook notebook = 1;
optional bool auto_save = 2;
Copy link
Member

@sourishkrout sourishkrout Aug 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ln 11-30, we should group into one or multiple sub-messages. Protos are practically immutable and this laundry list of properties at the request message level is likely a long-term liability. Host, Env, VSC? Honestly not even as important how it's grouped but it needs grouping.

I mean, I like ReporterExtension, ReporterGit, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. I structured it this way so the "Transform" function can return the payload in the shape defined by the proto file, eliminating the need to do this on the client side. But I totally get your point 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Perhaps group them under a single message that's part of TransformRequest.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addresed with a single "extension" message.

@sourishkrout
Copy link
Member

Normalize the payload before sending it to the Platform.

Can you please elaborate @peraltafederico why you chose to propose this "Transform" architecture?

@peraltafederico
Copy link
Contributor Author

Normalize the payload before sending it to the Platform.

Can you please elaborate @peraltafederico why you chose to propose this "Transform" architecture?

@sourishkrout Absolutely! The primary reason was to create a ready-to-use payload that can be sent to the Platform. Currently, it mainly filters out outputs that are not 'stdout,' but as we move the Platform GraphQL request to the Kernel, this behavior may change as needed.

Any suggestions on this approach?

@sourishkrout
Copy link
Member

Normalize the payload before sending it to the Platform.

Can you please elaborate @peraltafederico why you chose to propose this "Transform" architecture?

@sourishkrout Absolutely! The primary reason was to create a ready-to-use payload that can be sent to the Platform. Currently, it mainly filters out outputs that are not 'stdout,' but as we move the Platform GraphQL request to the Kernel, this behavior may change as needed.

Any suggestions on this approach?

In the PR's description, please. It's mainly to contextualize and memoize the intention of this PR more clearly.

@sourishkrout sourishkrout marked this pull request as draft August 28, 2024 20:03
@sourishkrout
Copy link
Member

Converted to draft. Let's keep this open while we finalize the other PRs mentioned. As discussed, we are deferring bringing the reporter API into the picture at a later time.

I'll be sure to make this mergeable so it won't dangle for too long.

@sourishkrout sourishkrout removed the request for review from pastuxso August 28, 2024 20:05
@sourishkrout sourishkrout self-assigned this Aug 28, 2024
@peraltafederico peraltafederico force-pushed the feat/reporter branch 2 times, most recently from b1f8cc2 to 0d58e0e Compare August 28, 2024 21:03
@sourishkrout sourishkrout marked this pull request as ready for review September 3, 2024 19:51
@sourishkrout sourishkrout self-requested a review September 3, 2024 20:22
Copy link
Member

@sourishkrout sourishkrout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging this as per the decision outlined in the description.

Copy link

sonarcloud bot commented Sep 3, 2024

@sourishkrout sourishkrout merged commit cde4682 into main Sep 3, 2024
7 checks passed
@sourishkrout sourishkrout deleted the feat/reporter branch September 3, 2024 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants