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

Integrate reporter #1558

Merged
merged 31 commits into from
Sep 4, 2024
Merged

Integrate reporter #1558

merged 31 commits into from
Sep 4, 2024

Conversation

peraltafederico
Copy link
Contributor

@peraltafederico peraltafederico commented Aug 19, 2024

Normalize the Platform payload based on the new Reporter message definition from the Go kernel. Currently in this PR, the extension manually parses a notebook to create a valid Platform payload, but in the near future it will delegate that parsing to the Reporter service.

Depends on stateful/runme#655 and https://github.com/stateful/platform/pull/822.

Tests are failing until the proto files are generated.

@peraltafederico peraltafederico requested review from pastuxso and sourishkrout and removed request for pastuxso August 22, 2024 18:08
@peraltafederico peraltafederico marked this pull request as ready for review August 22, 2024 18:08
Copy link
Contributor

@pastuxso pastuxso left a comment

Choose a reason for hiding this comment

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

Should we consider rendering new lines here?

image

metadata: { ['runme.dev/frontmatter']: string },
kernel?: Kernel,
): Frontmatter {
const yamlDocs = YAML.parseAllDocuments(metadata['runme.dev/frontmatter'])
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @peraltafederico, should we consider offering support for frontmatter that isn't in YAML format?"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question, @pastuxso! Initially, I started parsing the metadata with gray-matter, but since we were already using yaml, I thought it would be a good idea to stay consistent.

I think what matters most now is how our current design aligns with this approach, so using yaml should be fine for now, but I’ll leave the final decision to @sourishkrout.

Copy link
Member

Choose a reason for hiding this comment

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

@peraltafederico do we have to serialize the frontmatter? runme.parser.v1.Frontmatter is well defined. If serialization is required on the backend side maybe that's where it should happen?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sourishkrout Just to confirm, you mean that I just parse the raw frontmatter in the Platform APi instead of doing it when marshaling the Notebook, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sourishkrout I just realized I'm marshaling the frontmatter to also get the session ID, see:

private static marshallFrontmatter(

I'm leaving this as is for now, but please let me know if there's a different approach I may be overlooking!

Copy link
Member

Choose a reason for hiding this comment

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

Okay, @peraltafederico. We can leave it in place for now. It's in the protos but if we skip out on the Kernel reporter API for now, that's no help.

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.

✅ LGTM

Copy link

sonarcloud bot commented Sep 4, 2024

@peraltafederico peraltafederico merged commit c9d0be3 into main Sep 4, 2024
3 checks passed
@peraltafederico peraltafederico deleted the feat/reporter branch September 4, 2024 14:26
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.

3 participants