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

feat: add external plugin to build engine #2994

Merged
merged 13 commits into from
Oct 11, 2024
Merged

Conversation

matt2e
Copy link
Collaborator

@matt2e matt2e commented Oct 4, 2024

Adds languageplugin.externalPlugin for working with plugins over gRPC. This PR does not include any non-test implementations.

Part of #2452

@ftl-robot ftl-robot mentioned this pull request Oct 4, 2024
@matt2e matt2e force-pushed the matt2e/language-plugin-external branch 6 times, most recently from cb777b2 to f0ef049 Compare October 9, 2024 23:00
@matt2e matt2e mentioned this pull request Oct 9, 2024
38 tasks
@matt2e matt2e force-pushed the matt2e/language-plugin-external branch 8 times, most recently from bc8e94f to 436279f Compare October 10, 2024 23:15
@matt2e matt2e marked this pull request as ready for review October 10, 2024 23:16
@matt2e matt2e requested review from a team and alecthomas as code owners October 10, 2024 23:16
@matt2e matt2e requested review from a team and deniseli and removed request for a team October 10, 2024 23:16
@matt2e matt2e force-pushed the matt2e/language-plugin-external branch from e95d158 to e91dea9 Compare October 11, 2024 00:01

runCtx, cancel := context.WithCancel(ctx)

cmdErr := make(chan error)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't an errgroup be preferable here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think it'd work, but I might be missing how to do it.
The ping channel closes when ping succeeds or fails. The cmd chan closes if the plugin exits. In normal cases the plugin won't exit until plugin.Kill() is called, but can happen early for whatever reason.
So the select is looking for whichever of those 2 happens first, not waiting for both channels.

@matt2e matt2e force-pushed the matt2e/language-plugin-external branch 2 times, most recently from 43dff70 to 8e32669 Compare October 11, 2024 02:18
# Conflicts:
#	backend/protos/xyz/block/ftl/v1/language/mixins.go

# Conflicts:
#	frontend/cli/main.go
@matt2e matt2e force-pushed the matt2e/language-plugin-external branch from 8e32669 to 352df08 Compare October 11, 2024 02:19
@matt2e matt2e enabled auto-merge (squash) October 11, 2024 02:19
@matt2e matt2e merged commit 3ee5b10 into main Oct 11, 2024
95 checks passed
@matt2e matt2e deleted the matt2e/language-plugin-external branch October 11, 2024 02:47
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