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

Implement SPICE-0009 External Readers #660

Merged
merged 15 commits into from
Oct 29, 2024
Merged

Conversation

HT154
Copy link
Contributor

@HT154 HT154 commented Sep 23, 2024

SPICE-0009

Includes the changes from #640

Adoption of this feature in language binding libraries:

@HT154 HT154 force-pushed the external-readers branch 4 times, most recently from 337ab5a to 9d8a587 Compare September 24, 2024 15:53
@HT154 HT154 force-pushed the external-readers branch 2 times, most recently from f6d8810 to 19bc962 Compare October 3, 2024 03:54
@HT154 HT154 marked this pull request as ready for review October 3, 2024 03:57
@HT154 HT154 mentioned this pull request Oct 6, 2024
@HT154 HT154 force-pushed the external-readers branch 9 times, most recently from a935e9d to 9251522 Compare October 11, 2024 05:50
Copy link
Contributor

@bioball bioball left a comment

Choose a reason for hiding this comment

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

Did a first pass.

This is looking pretty good! Looks pretty polished, with just a couple of issues.

Design question: what do we want to do about env vars or CWD of the process?

What should users expect if thay do:

pkl --env-var foo=bar --external-module-reader ldap=my-ldap-reader

Should my-ldap-reader receive foo=bar as an env var? Or should there be some way to configure the env vars that get passed to this reader?

Same question applies for --working-dir.

Thoughts: probably not appropriate to pass these values into the process, but it should be clearly documented. But, we should probably have some way to configure env var, as well as CWD for these processes.

pkl-commons/src/main/kotlin/org/pkl/commons/Strings.kt Outdated Show resolved Hide resolved
pkl-commons/src/main/kotlin/org/pkl/commons/Strings.kt Outdated Show resolved Hide resolved
pkl-server/src/main/kotlin/org/pkl/server/Server.kt Outdated Show resolved Hide resolved
stdlib/EvaluatorSettings.pkl Outdated Show resolved Hide resolved
stdlib/EvaluatorSettings.pkl Show resolved Hide resolved
stdlib/EvaluatorSettings.pkl Outdated Show resolved Hide resolved
stdlib/EvaluatorSettings.pkl Show resolved Hide resolved
@HT154 HT154 force-pushed the external-readers branch 3 times, most recently from 4fc48da to 98ec98f Compare October 16, 2024 00:35
@HT154 HT154 requested a review from bioball October 16, 2024 00:39
@HT154 HT154 force-pushed the external-readers branch 4 times, most recently from 9323690 to e561cc3 Compare October 17, 2024 20:33
Copy link
Contributor

@bioball bioball left a comment

Choose a reason for hiding this comment

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

One more pass. Getting close!

@HT154 HT154 requested a review from bioball October 18, 2024 06:36
Copy link
Contributor

@bioball bioball left a comment

Choose a reason for hiding this comment

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

Overall LGTM! Great work!

This also needs eyes from @holzensp @stackoverflow because it touches the core language.

Copy link
Contributor

@stackoverflow stackoverflow left a comment

Choose a reason for hiding this comment

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

Looks good. Some small things.

Copy link
Contributor

@holzensp holzensp left a comment

Choose a reason for hiding this comment

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

I had some minor nits remaining, but they all got addressed ;) LGTM.

@HT154 HT154 force-pushed the external-readers branch 2 times, most recently from 36f535f to 9972d3d Compare October 25, 2024 23:43
HT154 and others added 14 commits October 26, 2024 16:35
This is preparatory work for [SPICE-0009](apple/pkl-evolution#10).
It is being contributed in a separate pull request to ease review.

The Message, Message(En|De)coder, and MessageTransport types have been ported to Java and moved to a new `org.pkl.core.messaging` package.
Box Bytes, fix error CLI handling during project load

Bytes equals compare
Co-authored-by: Daniel Chao <[email protected]>

Apply suggestions from code review

Co-authored-by: Daniel Chao <[email protected]>

Rename --external-* CLI flags to --external-*-reader

Rename ExternalProcess -> ExternalReaderProcess

Add org.pkl.core.util.Readers.closeQuietly and deprecate ModuleReaders.closeQuietly

Clean up doc comments

Refactor ExternalReaderRuntime into pkl-config-java

Refactor out External*Resolver classes, rename ResourceReaders.ExternalDelegate and ModuleKeys.External to MessageTransport
Co-authored-by: Islon Scherer <[email protected]>
@HT154 HT154 force-pushed the external-readers branch 3 times, most recently from 280ef78 to 06708b6 Compare October 28, 2024 17:56
Work around weird kt interop issue
@bioball bioball merged commit 666f8c3 into apple:main Oct 29, 2024
5 checks passed
@HT154 HT154 deleted the external-readers branch October 29, 2024 01:33
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.

4 participants